如何Ping指定的端口号?

Ping is a very popular term used by the system or network administrators. Ping means checking the given remote system whether it is up. A ping is a simple tool which uses ICMP protocol to check remote host. Some times ping port can be used with similar intentions. In this tutorial, we will look at how to ping remote system given ports.

Ping是系统或网络管理员使用的非常流行的术语。 Ping表示检查给定的远程系统是否已启动。 ping是使用ICMP协议检查远程主机的简单工具。 有时可以出于类似目的使用ping端口。 在本教程中,我们将研究如何ping给定端口的远程系统。

Ping远程系统 (Ping Remote System)

We will start with regular ping. This will show us that the remote system is up. In some situations, the remote systems may be up but do not respond ping.

我们将从常规ping开始。 这将向我们显示远程系统已启动。 在某些情况下,远程系统可能已启动,但不响应ping。

$ ping 192.168.47.133
Ping Remote System
Ping Remote System
Ping远程系统

使用Nmap Ping远程端口(Ping Remote Port with Nmap)

nmap is a very useful tool used by system administrators, network administrators, and pen testers. nmapprovides a lot of network-related scan features. For more information please follow tutorial below.

nmap是系统管理员,网络管理员和笔测试人员使用的非常有用的工具。 nmap提供了许多与网络相关的扫描功能。 有关更多信息,请遵循以下教程。

Nmap Tutorial

Nmap教程

In this example we will specify the port we want to ping with -p option. Keep in mind that this will be a TCP port. We will ping google.com port 443 or we can use a port name like  https .

在此示例中,我们将使用-p选项指定要ping的端口。 请记住,这将是一个TCP端口。 我们将ping google.com端口443 ,也可以使用https类的端口名。

$ nmap -p 443 google.com
Ping Remote Port with Nmap
Ping Remote Port with Nmap
使用Nmap Ping远程端口

As we can see the port is the open and remote host is up too.

如我们所见,端口是打开的,远程主机也已启动。

使用Netcat Ping远程端口 (Ping Remote Port with Netcat)

netcat is another useful tool which provides remote connection, listening ports and port scan. Detailed information about netcat can be found in the following tutorial.

netcat是另一个有用的工具,可提供远程连接,侦听端口和端口扫描。 可在以下教程中找到有关netcat的详细信息。

Netcat (nc) Command Tutorial With Examples

Netcat(nc)命令教程及示例

We can use netcat in order to scan remote systems ports. In this example, we will ping google.com port 443.

我们可以使用netcat来扫描远程系统端口。 在此示例中,我们将ping google.com端口443

$ nc google.com 443
Ping Remote Port with Netcat
Ping Remote Port with Netcat
使用Netcat Ping远程端口

After connecting remote port there will be meaningless responses which means the remote port is up.

连接远程端口后,将无意义的响应,这意味着远程端口已启动。

LEARN MORE  How To Scan Top Ports with Masscan?
了解更多信息如何使用Masscan扫描顶部端口?

使用Telnet ping远程端口 (Ping Remote Port with Telnet)

telnet is another useful tool used to connect remote telnet servers. But we can use this tool in order to ping remote TCP ports. We will ping google.com port 443 with the following command.

telnet是另一个用于连接远程telnet服务器的有用工具。 但是我们可以使用此工具来ping远程TCP端口。 我们将使用以下命令来ping google.com端口443

$ telnet google.com 443
Ping Remote Port with Telnet
Ping Remote Port with Telnet
使用Telnet ping远程端口

The connection is established and then after a timeout, it is closed which means ping is successful.

建立连接,然后在超时后将其关闭,这意味着ping成功。

使用PowerShell Test-NetConnection ping远程端口 (Ping Remote Port with PowerShell Test-NetConnection)

PowerShell provides cmdlets for different purposes. Test-NetConnection is a cmdlet that is used to test the remote specific port connection by providing the remote host and port number with the option -port. Below we will test google.com port 443 connection.

PowerShell提供cmdlet用于不同目的。 Test-NetConnection是一个cmdlet,用于通过为远程主机和端口号提供选项-port来测试特定于远程的端口连接。 下面我们将测试google.com端口443连接。

PS> Test-NetConnection google.com -port 443
PowerShell Test-NetConnection
PowerShell Test-NetConnection

Ping Remote Port with the curl Command

使用curl命令Ping远程端口

curl is a command used to download and upload over the network via command line for Linux systems. It is also provided for Windows systems as a 3rd party tool. We can use the curl to ping remote specific port. We will just provide the host and port by delimiting them with :. In the following example, we will ping google.com host port 443.

curl是用于Linux系统通过命令行通过网络下载和上传的命令。 Windows系统也将其作为第三方工具提供。 我们可以使用curl来ping远程特定端口。 我们将通过以下方式为主机和端口定界: 在以下示例中,我们将ping google.com主机端口443。

$ curl google.com:443

$ curl poftut.com:443

$ curl donotexist.com:443
Ping Specific Port with curl
Ping特定端口卷曲

We can see that google.com responds to connect to port 443 with an empty reply. This means the remote port is open.

我们可以看到google.com响应以空答复连接到端口443。 这意味着远程端口已打开。

Poftut.com is responded with a bad request error. This means the remote port is open.

Poftut.com被响应,并带有错误的请求错误。 这意味着远程端口已打开。

donotexist.com is failed to connect because the connection is refused which means there is no listening port on the donotexist.com.

donotexist.com无法连接,因为连接被拒绝,这意味着donotexist.com上没有侦听端口。

翻译自: https://www.poftut.com/ping-specified-port-number/

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
namp 2011-06-25 02:13:43| 分类: Linux | 标签:namp |字号大中小 订阅 . 进行ping扫描,打印出对扫描做出响应的主机,不做进一步测试(如端口扫描或者操作系统探测):   nmap -sP 192.168.1.0/24   仅列出指定网络上的每台主机,不发送任何报文到目标主机:   nmap -sL 192.168.1.0/24   探测目标主机开放的端口,可以指定一个以逗号分隔的端口列表(如-PS22,23,25,80):   nmap -PS 192.168.1.234 nmap -PS 127.0.0.1 -p 100-700   使用UDP ping探测主机:   nmap -PU 192.168.1.0/24   使用频率最高的扫描选项:SYN扫描,又称为半开放扫描,它不打开一个完全的TCP连接,执行得很快:   nmap -sS 192.168.1.0/24   当SYN扫描不能用时,TCP Connect()扫描就是默认的TCP扫描:   nmap -sT 192.168.1.0/24   UDP扫描用-sU选项,UDP扫描发送空的(没有数据)UDP报头到每个目标端口:   nmap -sU 192.168.1.0/24   确定目标机支持哪些IP协议 (TCP,ICMP,IGMP等):   nmap -sO 192.168.1.19   探测目标主机的操作系统:   nmap -O 192.168.1.19   nmap -A 192.168.1.19   另外,nmap官方文档中的例子:   nmap -v scanme.   这个选项扫描主机scanme中 所有的保留TCP端口。选项-v启用细节模式。   nmap -sS -O scanme./24   进行秘密SYN扫描,对象为主机Saznme所在的“C类”网段 的255台主机。同时尝试确定每台工作主机的操作系统类型。因为进行SYN扫描 和操作系统检测,这个扫描需要有根权限。   nmap -sV -p 22,53,110,143,4564 198.116.0-255.1-127   进行主机列举和TCP扫描,对象为B类188.116网段中255个8位子网。这 个测试用于确定系统是否运行了sshd、DNS、imapd或4564端口。如果这些端口 打开,将使用版本检测来确定哪种应用在运行。   nmap -v -iR 100000 -P0 -p 80   随机选择100000台主机扫描是否运行Web服务器(80端口)。由起始阶段 发送探测报文来确定主机是否工作非常浪费时间,而且只需探测主机的一个端口,因 此使用-P0禁止对主机列表。   nmap -P0 -p80 -oX logs/pb-port80scan.xml -oG logs/pb-port80scan.gnmap 216.163.128.20/20   扫描4096个IP地址,查找Web服务器(不ping),将结果以Grep和XML格式保存。   host -l | cut -d -f 4 | nmap -v -iL -   进行DNS区域传输,以发现中的主机,然后将IP地址提供给 Nmap。上述命令用于GNU/Linux -- 其它系统进行区域传输时有不同的命令。   其他选项:   -p (只扫描指定端口)   单个端口和用连字符表示的端口范 围(如 1-1023)都可以。当既扫描TCP端口又扫描UDP端口时,可以通过在端口号前加上T: 或者U:指定协议。 协议限定符一直有效直到指定另一个。 例如,参数 -p U:53,111,137,T:21-25,80,139,8080 将扫描UDP 端口53,111,和137,同时扫描列出的TCP端口。   -F (快速 (有限的端口) 扫描)namp 2011-06-25 02:13:43| 分类: Linux | 标签:namp |字号大中小 订阅 . 进行ping扫描,打印出对扫描做出响应的主机,不做进一步测试(如端口扫描或者操作系统探测):   nmap -sP 192.168.1.0/24   仅列出指定网络上的每台主机,不发送任何报文到目标主机:   nmap -sL 192.168.1.0/24   探测目标主机开放的端口,可以指定一个以逗号分隔的端口列表(如-PS22,23,25,80):   nmap -PS 192.168.1.234 nmap -PS 127.0.0.1 -p 100-700   使用UDP ping探测主机:   nmap -PU 192.168.1.0/24   使用频率最高的扫描选项:SYN扫描,又称为半开放扫描,它不打开一个完全的TCP连接,执行得很快:   nmap -sS 192.168.1.0/24   当SYN扫描不能用时,TCP Connect()扫描就是默认的TCP扫描:   nmap -sT 192.168.1.0/24   UDP扫描用-sU选项,UDP扫描发送空的(没有数据)UDP报头到每个目标端口:   nmap -sU 192.168.1.0/24   确定目标机支持哪些IP协议 (TCP,ICMP,IGMP等):   nmap -sO 192.168.1.19   探测目标主机的操作系统:   nmap -O 192.168.1.19   nmap -A 192.168.1.19   另外,nmap官方文档中的例子:   nmap -v scanme.   这个选项扫描主机scanme中 所有的保留TCP端口。选项-v启用细节模式。   nmap -sS -O scanme./24   进行秘密SYN扫描,对象为主机Saznme所在的“C类”网段 的255台主机。同时尝试确定每台工作主机的操作系统类型。因为进行SYN扫描 和操作系统检测,这个扫描需要有根权限。   nmap -sV -p 22,53,110,143,4564 198.116.0-255.1-127   进行主机列举和TCP扫描,对象为B类188.116网段中255个8位子网。这 个测试用于确定系统是否运行了sshd、DNS、imapd或4564端口。如果这些端口 打开,将使用版本检测来确定哪种应用在运行。   nmap -v -iR 100000 -P0 -p 80   随机选择100000台主机扫描是否运行Web服务器(80端口)。由起始阶段 发送探测报文来确定主机是否工作非常浪费时间,而且只需探测主机的一个端口,因 此使用-P0禁止对主机列表。   nmap -P0 -p80 -oX logs/pb-port80scan.xml -oG logs/pb-port80scan.gnmap 216.163.128.20/20   扫描4096个IP地址,查找Web服务器(不ping),将结果以Grep和XML格式保存。   host -l | cut -d -f 4 | nmap -v -iL -   进行DNS区域传输,以发现中的主机,然后将IP地址提供给 Nmap。上述命令用于GNU/Linux -- 其它系统进行区域传输时有不同的命令。   其他选项:   -p (只扫描指定端口)   单个端口和用连字符表示的端口范 围(如 1-1023)都可以。当既扫描TCP端口又扫描UDP端口时,可以通过在端口号前加上T: 或者U:指定协议。 协议限定符一直有效直到指定另一个。 例如,参数 -p U:53,111,137,T:21-25,80,139,8080 将扫描UDP 端口53,111,和137,同时扫描列出的TCP端口。   -F (快速 (有限的端口) 扫描)namp 2011-06-25 02:13:43| 分类: Linux | 标签:namp |字号大中小 订阅 . 进行ping扫描,打印出对扫描做出响应的主机,不做进一步测试(如端口扫描或者操作系统探测):   nmap -sP 192.168.1.0/24   仅列出指定网络上的每台主机,不发送任何报文到目标主机:   nmap -sL 192.168.1.0/24   探测目标主机开放的端口,可以指定一个以逗号分隔的端口列表(如-PS22,23,25,80):   nmap -PS 192.168.1.234 nmap -PS 127.0.0.1 -p 100-700   使用UDP ping探测主机:   nmap -PU 192.168.1.0/24   使用频率最高的扫描选项:SYN扫描,又称为半开放扫描,它不打开一个完全的TCP连接,执行得很快:   nmap -sS 192.168.1.0/24   当SYN扫描不能用时,TCP Connect()扫描就是默认的TCP扫描:   nmap -sT 192.168.1.0/24   UDP扫描用-sU选项,UDP扫描发送空的(没有数据)UDP报头到每个目标端口:   nmap -sU 192.168.1.0/24   确定目标机支持哪些IP协议 (TCP,ICMP,IGMP等):   nmap -sO 192.168.1.19   探测目标主机的操作系统:   nmap -O 192.168.1.19   nmap -A 192.168.1.19   另外,nmap官方文档中的例子:   nmap -v scanme.   这个选项扫描主机scanme中 所有的保留TCP端口。选项-v启用细节模式。   nmap -sS -O scanme./24   进行秘密SYN扫描,对象为主机Saznme所在的“C类”网段 的255台主机。同时尝试确定每台工作主机的操作系统类型。因为进行SYN扫描 和操作系统检测,这个扫描需要有根权限。   nmap -sV -p 22,53,110,143,4564 198.116.0-255.1-127   进行主机列举和TCP扫描,对象为B类188.116网段中255个8位子网。这 个测试用于确定系统是否运行了sshd、DNS、imapd或4564端口。如果这些端口 打开,将使用版本检测来确定哪种应用在运行。   nmap -v -iR 100000 -P0 -p 80   随机选择100000台主机扫描是否运行Web服务器(80端口)。由起始阶段 发送探测报文来确定主机是否工作非常浪费时间,而且只需探测主机的一个端口,因 此使用-P0禁止对主机列表。   nmap -P0 -p80 -oX logs/pb-port80scan.xml -oG logs/pb-port80scan.gnmap 216.163.128.20/20   扫描4096个IP地址,查找Web服务器(不ping),将结果以Grep和XML格式保存。   host -l | cut -d -f 4 | nmap -v -iL -   进行DNS区域传输,以发现中的主机,然后将IP地址提供给 Nmap。上述命令用于GNU/Linux -- 其它系统进行区域传输时有不同的命令。   其他选项:   -p (只扫描指定端口)   单个端口和用连字符表示的端口范 围(如 1-1023)都可以。当既扫描TCP端口又扫描UDP端口时,可以通过在端口号前加上T: 或者U:指定协议。 协议限定符一直有效直到指定另一个。 例如,参数 -p U:53,111,137,T:21-25,80,139,8080 将扫描UDP 端口53,111,和137,同时扫描列出的TCP端口。   -F (快速 (有限的端口) 扫描)

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值