信息中心

 技术文摘
 技术文摘
您当前的位置是:网站首页 > 信息中心 > 技术文摘
TCPING端口测试工具使用
发布时间:2025-01-23 11:10   发布人: 系统管理员

相信大家对ping命令很熟悉,基于ICMP协议,常用于测试网络通断,但是要想测试端口是否能连通,就需要今天的tcping工具了。如果对方禁ping,那就非常有用了。

工具地址

https://www.elifulkerson.com/projects/tcping.php

安装

Windows:

32位

https://download.elifulkerson.com//files/tcping/0.39/tcping.exe

64位

https://download.elifulkerson.com/files/tcping/0.39/x64/tcping64.exe

最好下载64位,并重命名为tcping.exe,复制到C:\Windows下,这样打开cmd就可以使用了

Centos:

yum install python3-pip
pip3 install tcping
tcping --helpUsage: tcping [OPTIONS] HOST

Options:
  -p, --port INTEGER      Tcp port
  -c, --count INTEGER     Try connections counts
  -t, --timeout FLOAT     Timeout seconds
  --report / --no-report  Show report to replace statistics
  --help                  Show this message and exit.

Ubuntu:

sudo apt install tcptraceroute
sudo wget http://www.vdberg.org/~richard/tcpping -O /usr/bin/tcping
sudo chmod +x /usr/bin/tcping
tcping
tcpping v1.7 Richard van den Berg <richard@vdberg.org>Usage: tcping [-d] [-c] [-C] [-w sec] [-q num] [-x count] ipaddress [port]

        -d   print timestamp before every result
        -c   print a columned result line
        -C   print in the same format as fping's -C option
        -w   wait time in seconds (defaults to 3)
        -r   repeat every n seconds (defaults to 1)
        -x   repeat n times (defaults to unlimited)

最常用的用法

tcping IP或域名 端口(不加默认是80)

C:\tcping www.baidu.comProbing 110.242.68.4:80/tcp - Port is open - time=29.061msProbing 110.242.68.4:80/tcp - Port is open - time=22.090msProbing 110.242.68.4:80/tcp - Port is open - time=29.488msProbing 110.242.68.4:80/tcp - Port is open - time=23.341msPing statistics for 110.242.68.4:80
     4 probes sent.
     4 successful, 0 failed.  (0.00% fail)Approximate trip times in milli-seconds:
     Minimum = 22.090ms, Maximum = 29.488ms, Average = 25.995ms

常用的命令:

-4/-6 (优先使用IPv4/IPv6地址)

-d (带时间戳)

-t (-t是持续运行,使用ctrl + c退出)

-h (http模式)

-u (与-h命令连用,输出目标的url)

-n (次数,默认4次)

-i (发送间隔时间,默认1s,可以为小数)

-w ( 超时时间,默认2s,正常1s就够用了)

还可以根据自己需求编辑个bat,用着很方便

@echo off
tcping.exe  -n 2 -w 1 %1 %2 | findstr Pro

效果

C:\t www.baidu.com 443Probing 110.242.68.3:443/tcp - Port is open - time=22.560msProbing 110.242.68.3:443/tcp - Port is open - time=21.744ms