博客
关于我
TCP端口测试简法
阅读量:597 次
发布时间:2019-03-12

本文共 1573 字,大约阅读时间需要 5 分钟。

  1. telnet法
TCP端口开了$ echo "" | telnet 123.1.2.3 8100Trying 123.1.2.3...Connected to 123.1.2.3.Escape character is '^]'.Connection closed by foreign host.TCP端口关了$ echo "" | telnet 123.1.2.3 8101Trying 123.1.2.3...telnet: connect to address 123.1.2.3: Connection refused

如果希望带源地址测试,可以

telnet -b source_ip destanation_ip port
  1. nc法
TCP端口开了$ nc -nzv 123.1.2.3 7205       Ncat: Version 7.50 ( https://nmap.org/ncat )Ncat: Connected to 123.1.2.3:7205.Ncat: 0 bytes sent, 0 bytes received in 0.03 seconds.TCP端口关了$ nc -nzv 123.1.2.3 7206Ncat: Version 7.50 ( https://nmap.org/ncat )Ncat: Connection timed out.

如果希望带源地址测试,可以

nc -s source_ip -zv destanation_ip port
  1. nmap法
TCP端口开了$ nmap -Pn -sT 123.1.2.3 -p 8100Starting Nmap 6.40 ( http://nmap.org ) at 2019-09-29 12:12 CSTNmap scan report for nothing.attdns.com (123.1.2.3)Host is up (0.0067s latency).PORT     STATE SERVICE8100/tcp open  xprint-serverNmap done: 1 IP address (1 host up) scanned in 0.07 secondsTCP端口关了$ nmap -Pn -sT 123.1.2.3 -p 8101Starting Nmap 6.40 ( http://nmap.org ) at 2019-09-29 12:12 CSTNmap scan report for nothing.attdns.com (123.1.2.3)Host is up.PORT     STATE    SERVICE8101/tcp filtered unknownNmap done: 1 IP address (1 host up) scanned in 2.08 secondsTCP端口开了啥$ nmap -Pn -sT 123.1.2.3 -p 8000-8300Starting Nmap 6.40 ( http://nmap.org ) at 2019-09-29 12:11 CSTNmap scan report for nothing.attdns.com (123.1.2.3)Host is up (0.0083s latency).Not shown: 299 filtered portsPORT     STATE SERVICE8081/tcp open  blackice-icecap8100/tcp open  xprint-serverNmap done: 1 IP address (1 host up) scanned in 10.00 seconds

转载地址:http://ssjxz.baihongyu.com/

你可能感兴趣的文章
Mysql之索引选择及优化
查看>>
mysql之联合查询UNION
查看>>
mysql之连接查询,多表连接
查看>>
mysql乱码
查看>>
Mysql事务。开启事务、脏读、不可重复读、幻读、隔离级别
查看>>
MySQL事务与锁详解
查看>>
MySQL事务原理以及MVCC详解
查看>>
MySQL事务及其特性与锁机制
查看>>
mysql事务理解
查看>>
MySQL事务详解结合MVCC机制的理解
查看>>
MySQL事务隔离级别:读未提交、读已提交、可重复读和串行
查看>>
MySQL事务隔离级别:读未提交、读已提交、可重复读和串行
查看>>
mysql五补充部分:SQL逻辑查询语句执行顺序
查看>>
mysql交互式连接&非交互式连接
查看>>
MySQL什么情况下会导致索引失效
查看>>
Mysql什么时候建索引
查看>>
MySql从入门到精通
查看>>
MYSQL从入门到精通(一)
查看>>
MYSQL从入门到精通(二)
查看>>
mysql以下日期函数正确的_mysql 日期函数
查看>>