用tcping检查网站开放的端口

麦新杰之前分享过一款小巧玲珑工具软件:tcping,即在tcp层进行端口的ping。

tcping可以用来检查和确认我们的网站有哪些端口是开放的,使用很顺手。比如麦新杰这几天在研究如何关闭mysql的3306端口,就通过使用tcping工具来确认关闭端口是否成功。Linux下有有个netstat命令,总是对其输出看得云里雾里,虽然netstat -l的输出看不到3306端口,是tcping还能ping通,而且百度云检测也能检测到3306端口的开放状态并告警。

首先下载并在合适的位置存放tcping工具,请参考:TCPING小工具的使用和下载

然后,打开cmd窗口,使用如下命令检查网站开放的端口:

检查网站Web服务器的80端口:

C:\Users\Administrator>tcping 114.215.183.12 80

Probing 114.215.183.12:80/tcp - Port is open - time=25.839ms
Probing 114.215.183.12:80/tcp - Port is open - time=16.662ms
Probing 114.215.183.12:80/tcp - Port is open - time=13.375ms
Probing 114.215.183.12:80/tcp - Port is open - time=15.192ms

Ping statistics for 114.215.183.12:80
4 probes sent.
4 successful, 0 failed.
Approximate trip times in milli-seconds:
Minimum = 13.375ms, Maximum = 25.839ms, Average = 17.767ms

C:\Users\Administrator>

80端口打开,网站可以被访问。

检查网站数据库服务器的3306端口:

C:\Users\Administrator>tcping 114.215.183.12 3306

Probing 114.215.183.12:3306/tcp - Port is open - time=25.296ms
Probing 114.215.183.12:3306/tcp - Port is open - time=15.218ms
Probing 114.215.183.12:3306/tcp - Port is open - time=14.877ms
Probing 114.215.183.12:3306/tcp - Port is open - time=14.629ms

Ping statistics for 114.215.183.12:3306
4 probes sent.
4 successful, 0 failed.
Approximate trip times in milli-seconds:
Minimum = 14.629ms, Maximum = 25.296ms, Average = 17.505ms

C:\Users\Administrator>

MySQL数据库3306端口打开,存在安全隐患。

除了使用简单,还可以看到各个端口的响应时间,这个响应时间比3层的ping的时间更精准更有参考价值。

网站响应时间可是SEO的一个重要参数哦。

用tcping查看一个没有打开的端口:

C:\Users\Administrator>tcping 114.215.183.12 12345

Probing 114.215.183.12:12345/tcp - No response - time=2011.028ms
Probing 114.215.183.12:12345/tcp - No response - time=2001.356ms
Probing 114.215.183.12:12345/tcp - No response - time=2001.396ms
Probing 114.215.183.12:12345/tcp - No response - time=2000.701ms

Ping statistics for 114.215.183.12:12345
4 probes sent.
0 successful, 4 failed.
Was unable to connect, cannot provide trip statistics.

C:\Users\Administrator>

随便写一个12345端口,看到No response,就是没有打开的。

请同学们自己查看一下FTP 21端口,SSH 22端口。

tcping有局限性,它只能检查tcp端口,而不能检查udp端口。这个要注意。

转至:http://www.maixj.net/wz/tcping-duankou-16414

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
通过tcping软件能够知道对应IP的某一端口是否能够连通。 -------------------------------------------------------------- tcping.exe by Eli Fulkerson Please see http://www.elifulkerson.com/projects/ for updates. -------------------------------------------------------------- Usage: C:\Users\dell1\Desktop\tcping64.exe [-flags] server-address [server-port] Usage (full): C:\Users\dell1\Desktop\tcping64.exe [-t] [-d] [-i interval] [-n ti mes] [-w ms] [-b n] [-r times] [-s] [-v] [-j] [-js size] [-4] [-6] [-c] [-g coun t] [-S source_address] [--file] [--tee filename] [-h] [-u] [--post] [--head] [-- proxy-port port] [--proxy-server server] [--proxy-credentials username:password] [-f] server-address [server-port] -t : ping continuously until stopped via control-c -n 5 : for instance, send 5 pings -i 5 : for instance, ping every 5 seconds -w 0.5 : for instance, wait 0.5 seconds for a response -d : include date and time on each line -b 1 : enable beeps (1 for on-down, 2 for on-up, 3 for on-change, 4 for always) -r 5 : for instance, relookup the hostname every 5 pings -s : automatically exit on a successful ping -v : print version and exit -j : include jitter, using default rolling average -js 5 : include jitter, with a rolling average size of (for instance) 5. --tee : mirror output to a filename specified after '--tee' -4 : prefer ipv4 -6 : prefer ipv6 -c : only show an output line on changed state --file : treat the "server-address" as a filename instead, loop through file li ne by line... 详细参数请查看”--help“

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值