用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
用tcping检查网站开放的端口的更多相关文章
- centos 利用iptables来配置linux禁止所有端口登陆和开放指定端口的方法
1.关闭所有的 INPUT FORWARD OUTPUT 只对某些端口开放. 下面是命令实现: iptables -P INPUT DROPiptables -P FORWARD DROPiptabl ...
- Centos7开启防火墙并且使MYSQL外网访问开放3306端口
http://www.cnblogs.com/kreo/p/4368811.html CentOS7默认防火墙是firewalle,不是iptables #先检查是否安装了iptables servi ...
- windows server 2008 IP安全策略关闭端口,禁止ping,修改远程连接3389端口,开放指定端口
windows server 2008 IP安全策略关闭端口: Tomcat服务访问不了情况解决. Windows默认情况下有很多端口是开放的,在你上网的时候,网络病毒和黑客可以通过这 ...
- CentOS/Linux开放某些端口
CentOS/Linux开放某些端口 CentOS/Linux 装载系统的时候只开启了少数端口如22,80(有些连80都没有开放)等. 结果再装完Nginx+PHP+MySQL 后不能访问网站. 当然 ...
- 监控端口是否开放,端口未开放关闭虚拟ip,端口开放启动虚拟IP
#!/bin/bash#该脚本监控本机的一个端口,当端口异常时,停止lvs的本地ip直到恢复.该脚本依托于lvs.sh启动脚本#目前只支持监控1个vip #定义常用变量#配置检查的ip以及端口chec ...
- 阿里云服务器Centos7.4开放80端口的记录
问题: 阿里云服务器安装的是centos7, 搭建网站安装lnmp1.5后发现访问不了, 不明所以, 在一论坛找到关于80端口未开放的原因. 需求: 开放80端口.于是有了下面第一,二,三部分关于开放 ...
- Centos 7和 Centos 6开放查看端口 防火墙关闭打开
Centos 7 firewall 命令: 查看已经开放的端口: firewall-cmd --list-ports 开启端口 firewall-cmd --zone=public --add-por ...
- CentOS/Linux 开放80、8080端口或者开放某个端口
装载系统的时候只开启了22端口.结果再装完Nginx+php+mysql 后不能访问网站. iptables -L -n 查看防火墙设置发现没开启80端口 由于Linux防火墙默认是关闭的.可以用两种 ...
- Linux开放80、8080端口或者开放某个端口
装载系统的时候只开启了22端口.结果再装完Nginx+php+mysql 后不能访问网站. 查看防火墙设置发现没开启80端口 iptables -L -n 由于Linux防火墙默认是关闭的.可以用两种 ...
随机推荐
- 一次关于shiro反序列化漏洞的思考
0x01前言 之前在我反序列化的那篇文章中(https://www.cnblogs.com/lcxblogs/p/13539535.html),简单说了一下反序列化漏洞,也提了一嘴常见的几种Java框 ...
- 题解 P5038 [SCOI2012]奇怪的游戏
题解 题目 做这题之前,做了一道叫星际战争的题,很容易想到二分 \(+\) 网络流,那么二分啥呢? 我们先推一下式子,因为是对相邻格子加数,那么可以联想到黑白染色类问题. 设有黑色格子 \(B\) 个 ...
- 【AIOT】智能感知--物
From: https://liudongdong1.github.io/ 1. 物体检测 .1. 流体 D. V. Q. Rodrigues, D. Rodriguez and C. Li, &qu ...
- tomcat9配置https-pfx
下载tomcat9 wget https://mirrors.bfsu.edu.cn/apache/tomcat/tomcat-9/v9.0.37/bin/apache-tomcat-9.0.37.t ...
- 10、二进制安装K8s之部署CoreDNS 和Dashboard
二进制安装K8s之部署CoreDNS 和Dashboard CoreDNS 和Dashboard 的yaml文件在 k8s源代码压缩包里面可以找到对应的配置文件,很多人从网上直接下载使用别人的,会导致 ...
- .NET Core:在ASP.NET Core WebApi中使用Cookie
一.Cookie的作用 Cookie通常用来存储有关用户信息的一条数据,可以用来标识登录用户,Cookie存储在客户端的浏览器上.在大多数浏览器中,每个Cookie都存储为一个小文件.Cookie表示 ...
- ProjectEuler 004题
1 #include<iostream> 2 using namespace std; 3 4 int main() { 5 bool isPalindromic (int num); 6 ...
- CentOS7中apache的部署与配置
一.apache的部署 输入命令 yum list | grep httpd 查看可安装的软件包,选择"httpd.x86_64"安装. 输入命令 yum install http ...
- React 性能调优记录(下篇),如何写高性能的代码
react性能非常重要,性能优化可以说是衡量一个react程序员水平的重要标准. 减少你的渲染 这个大家都明白,只要是父组件中用了子组件,子组件就算没用prop也会进行依次渲染, 可以用pureCom ...
- 改变this指向&闭包特性
Q:为什么用普通函数时,setTimeout里面的this指向的是window? //通过保留this的方式,通过闭包的特性去拿this let _this = this //...ajax setT ...