+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
使用nmap命令检查开放端口
nmap(Network exploration tool and security / port scanner)是功能强大的网络扫描工具,可以扫描单个主机和大型网络。它主要用于安全审核和渗透测试。是端口扫描的首选工具。
例如可使用如下命令进行端口扫描:sudo nmap -sT -p- 192.168.8.51。-sT 选项告诉nmap扫描TCP端口, -p-扫描所有端口(65535个)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
使用netcat命令检查开放端口
netcat(或nc)是一种命令行工具,可以使用TCP或UDP协议跨网络连接读取和写入数据。使用netcat可以扫描单个端口或端口范围。
例如,要扫描IP地址192.168.8.51在范围内的远程计算机上打开的TCP端口,4000-4004可以使用以下命令:
nc -z -v 192.168.8.51 4000-4004
1
-z选项指示nc仅扫描打开的端口,而不发送任何数据,并且-v用于获取更多详细信息。运行结果如下:
sl@Li:~/Works/brochain/corsac$ nc -z -v 192.168.8.51 4000-4004
Connection to 192.168.8.51 4000 port [tcp/*] succeeded!
nc: connect to 192.168.8.51 port 4001 (tcp) failed: Connection refused
nc: connect to 192.168.8.51 port 4002 (tcp) failed: Connection refused
nc: connect to 192.168.8.51 port 4003 (tcp) failed: Connection refused
nc: connect to 192.168.8.51 port 4004 (tcp) failed: Connection refused
参考:https://blog.csdn.net/s_lisheng/article/details/109185366