LINUX 網絡工具中的“瑞士軍刀” nc 命令
LINUX 網絡工具中的“瑞士軍刀” nc 命令
查看端口是否被佔用
$ nc -l 6379 nc: Address already in use
端口掃描
$ nc -n 127.0.0.1 -z 1230-1234 -v nc: connect to 127.0.0.1 port 1230 (tcp) failed: Connection refused nc: connect to 127.0.0.1 port 1231 (tcp) failed: Connection refused nc: connect to 127.0.0.1 port 1232 (tcp) failed: Connection refused nc: connect to 127.0.0.1 port 1233 (tcp) failed: Connection refused Connection to 127.0.0.1 1234 port [tcp/*] succeeded!
TCP/UDP連接測試
$ nc 127.0.0.1 1234 hello 编程珠玑
HTTP連接測試
$ nc google.com 80
數據傳輸
$ nc 127.0.0.1 1234 < in.txt
2 thoughts on “LINUX 網絡工具中的“瑞士軍刀” nc 命令”
安裝 nc指令
sudo apt install netcat
用 nc 指令取代 telnet 指令
https://www.arthurtoday.com/2015/10/ubuntu-replace-telnet-with-nc-command.html
$ sudo nc -v jashliao.eu 80 #確定通訊PORT[端口]
$ sudo nc -zv jashliao.eu 1-1024 #掃描確定通訊PORT[端口]