nc是netcat的缩写。
[[email protected] ~]# nc -z -n 192.168.20.237 20-8088
Connection to 192.168.20.237 22 port [tcp/*] succeeded!
Connection to 192.168.20.237 80 port [tcp/*] succeeded!
Connection to 192.168.20.237 3306 port [tcp/*] succeeded!
z 参数告诉netcat使用0 IO,连接成功后立即关闭连接, 不进行数据交换
v 详细输出
n 参数告诉netcat 不要使用DNS反向查询IP地址的域名
netcat 命令会连接开放端口22 3306并且打印运行在这个端口上服务的banner信息
[[email protected] ~]# nc -v 192.168.20.237 22
Connection to 192.168.20.237 22 port [tcp/ssh] succeeded!
SSH-2.0-OpenSSH_5.3
[[email protected] ~]# nc -v 192.168.20.237 3306
Connection to 192.168.20.237 3306 port [tcp/mysql] succeeded!
J
5.6.35v[BwT|63?#._rB/d.UC/mysql_native_password
时间: 2024-10-14 03:07:08