2022年10月25日 星期二

netcat 使用

 netcat 可分兩種執行模式client mode和server mode。可以使用client mode去確認TCP/UDP port是否開啟。


##############################

參數:

-z :  -z: Zero-I/O mode (Don’t send any data, just emit a packet without payload)

-l:    localhost

 -v 則是會顯示該port 

##############################

TCP:

開啟 server :

nc -l 8080


傳送封包:

nc -z 127.0.0.1 8080


傳送檔案

https://www.digitalocean.com/community/tutorials/how-to-use-netcat-to-establish-and-test-tcp-and-udp-connections


##############################

UTP:

傳送封包:

nc -zu  ip port



##############################

參考

1. https://unix.stackexchange.com/questions/589561/what-is-nc-z-used-for

2, https://blog.gtwang.org/linux/linux-utility-netcat-examples/

3. https://shazi.info/netcat-%E7%B6%B2%E8%B7%AF%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7-nc%E6%8C%87%E4%BB%A4-%E7%AD%86%E8%A8%98/

沒有留言:

張貼留言