通过VPN隧道的Nmap ping扫描返回所有活着的主机?

我很好奇为什么在通过思科站点到站点IPSec隧道链接的远程子网上运行nmap -sP (ping扫描)会为范围内的每个IP返回“主机启动”状态。

 [root@xt ~]# nmap -sP 192.168.108.* Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2012-11-22 14:08 CST Host 192.168.108.0 appears to be up. Host 192.168.108.1 appears to be up. Host 192.168.108.2 appears to be up. Host 192.168.108.3 appears to be up. Host 192.168.108.4 appears to be up. Host 192.168.108.5 appears to be up. . . . Host 192.168.108.252 appears to be up. Host 192.168.108.253 appears to be up. Host 192.168.108.254 appears to be up. Host 192.168.108.255 appears to be up. Nmap finished: 256 IP addresses (256 hosts up) scanned in 14.830 seconds 

但是,一个已知的IP平ping只是超时或不返回任何东西…

 [root@xt ~]# ping 192.168.108.201 PING 192.168.108.201 (192.168.108.201) 56(84) bytes of data. --- 192.168.108.201 ping statistics --- 144 packets transmitted, 0 received, 100% packet loss, time 143001ms 

扫描以这种方式连接的现场设备是否有更有效的方法?

可能是TCP RST。 nmap手册摘录(v 5.00):

-sP选项默认发送ICMP回应请求,TCP SYN到端口443,TCP ACK到端口80,以及ICMP时间戳请求。 当由非特权用户执行时,只有SYN数据包被发送(使用连接呼叫)到目标上的端口80和443。 当特权用户尝试扫描本地以太网上的目标时,除非指定了–send-ip,否则将使用ARP请求。 -sP选项可以与任何发现探测types(-P *选项,不包括-PN)结合使用,以获得更大的灵活性。 如果使用这些探测器types和端口号选项中的任何一个,则覆盖默认探测器。 当运行Nmap的源主机和目标networking之间存在严格的防火墙时,build议使用这些高级技术。 否则,当防火墙丢弃探测器或其响应时,可能会丢失主机。

如下所示:

 # nmap -sP 10.99.10.19 Host 10.99.10.19 is up (0.0015s latency). 21:31:13.338418 IP (tos 0x0, ttl 51, id 28548, offset 0, flags [none], proto ICMP (1), length 28) 10.0.0.20 > 10.99.10.19: ICMP echo request, id 57832, seq 0, length 8 21:31:13.338625 IP (tos 0x0, ttl 50, id 7277, offset 0, flags [none], proto TCP (6), length 44) 10.0.0.20.63105 > 10.99.10.19.443: Flags [S], cksum 0xe71d (correct), seq 4106918263, win 3072, options [mss 1460], length 0 21:31:13.338780 IP (tos 0x0, ttl 52, id 11356, offset 0, flags [none], proto TCP (6), length 40) 10.0.0.20.63105 > 10.99.10.19.80: Flags [.], cksum 0x3276 (correct), seq 4106918263, ack 774547350, win 1024, length 0 21:31:13.339771 IP (tos 0x0, ttl 55, id 35529, offset 0, flags [none], proto ICMP (1), length 40) 10.0.0.20 > 10.99.10.19: ICMP time stamp query id 23697 seq 0, length 20 21:31:13.340590 IP (tos 0x0, ttl 255, id 63189, offset 0, flags [none], proto TCP (6), length 40) 10.99.10.19.80 > 10.0.0.20.63105: Flags [R.], cksum 0x3272 (correct), seq 1, ack 0, win 1024, length 0 

就我而言,我在本地有一对思科ASA,在远程运行Linux和strongswan。 这可能是偏远的一方,因为隧道上的平均时间大约为7-9毫秒。 我看到对方发出了arp who-has,但是就目前而言,我没有解密远端ipsec peers数据包。