#tcp监测端口是否存活

方法一: 使用telnet命令

  1. telnet xxx.xxx.xxx.xxx 80

能进入说明端口是通的,一直显示正在连接说明端口不通

方法二: 使用tcping

  1. C:\Users\Administrator>tcping www.baidu.com 80
  2. Probing 182.61.200.6:80/tcp - Port is open - time=6.721ms
  3. Probing 182.61.200.6:80/tcp - Port is open - time=5.817ms
  4. Probing 182.61.200.6:80/tcp - Port is open - time=6.254ms
  5. Probing 182.61.200.6:80/tcp - Port is open - time=6.856ms
  6. Ping statistics for 182.61.200.6:80
  7. 4 probes sent.
  8. 4 successful, 0 failed. (0.00% fail)
  9. Approximate trip times in milli-seconds:
  10. Minimum = 5.817ms, Maximum = 6.856ms, Average = 6.412ms

#udp监测端口是否存活

#不存活案例

  1. #显示是?,说明udp 1733不是存活的
  2. C:\Users\Administrator>nc -zuv 106.3.140.58 1733
  3. 106.3.140.58: inverse host lookup failed: h_errno 11004: NO_DATA
  4. (UNKNOWN) [106.3.140.58] 1733 (?) open

#存活案例

#显示是对应的服务,说明是存活的
C:\Users\Administrator>nc -zuv 106.3.140.58 4500
106.3.140.58: inverse host lookup failed: h_errno 11004: NO_DATA
(UNKNOWN) [106.3.140.58] 4500 (ipsec-msft) open

C:\Users\Administrator>nc -zuv 106.3.140.58 1701
106.3.140.58: inverse host lookup failed: h_errno 11004: NO_DATA
(UNKNOWN) [106.3.140.58] 1701 (l2tp) open

nc工具安装

下载链接https://eternallybored.org/misc/netcat/
netcat-win32-1.11.zip
image.png
将压缩包内nc.exe和nc64.exe放入C:\Windows\System32目录下。

tcping工具安装

下载地址https://download.elifulkerson.com//files/tcping/0.39/tcping.exe
tcping.rar
tcping.exe 放入C:\Windows\System32目录下。