首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >了解nmap输出的子网范围

了解nmap输出的子网范围
EN

Stack Overflow用户
提问于 2013-01-30 09:45:45
回答 2查看 941关注 0票数 0

我试图在一个大网络中找到子网范围,这是我的文章:我使用nmap来发现活着的主机,并对所有的主机进行跟踪。之后,我可以使用traceroute信息绘制网络拓扑,但不能将每个主机Ip与它所属的子网相关联,因为nmap无法提供这些信息。

这是nmap的输出:

代码语言:javascript
复制
<?xml version="1.0"?>
<?xml-stylesheet href="file:///usr/local/share/nmap/nmap.xsl" type="text/xsl"?>
<!-- Nmap 6.25 scan initiated Thu Jan 17 14:48:44 2013 as: /usr/local/bin/nmap -&#45;datadir /usr/local/share/nmap -oX - -sn -&#45;traceroute -f -&#45;badsum -T4 aa.bb.*.1-10 -->
<nmaprun scanner="nmap" args="/usr/local/bin/nmap -&#45;datadir /usr/local/share/nmap -oX - -sn -&#45;traceroute -f -&#45;badsum -T4 aa.bb.*.1-10" start="1358430524" startstr="Thu Jan 17 14:48:44 2013" version="6.25" xmloutputversion="1.04">
<verbose level="0"/>
<debugging level="0"/>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="61"/>
<address addr="aa.bb.5.5" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.254.13" rtt="435.69"/>
<hop ttl="4" ipaddr="aa.bb.5.5" rtt="6.54"/>
</trace>
<times srtt="8786" rttvar="6087" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="61"/>
<address addr="aa.bb.5.6" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.254.13" rtt="435.69"/>
<hop ttl="4" ipaddr="aa.bb.5.6" rtt="7.65"/>
</trace>
<times srtt="9876" rttvar="7052" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430540"><status state="up" reason="echo-reply" reason_ttl="61"/>
<address addr="aa.bb.16.5" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.138" rtt="27.07"/>
<hop ttl="4" ipaddr="aa.bb.16.5" rtt="15.74"/>
</trace>
<times srtt="61488" rttvar="76772" to="368576"/>
</host>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.16.8" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.138" rtt="27.07"/>
<hop ttl="4" ipaddr="aa.bb.16.8" rtt="16.64"/>
</trace>
<times srtt="18283" rttvar="14326" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.16.9" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.138" rtt="27.07"/>
<hop ttl="4" ipaddr="aa.bb.16.9" rtt="19.44"/>
</trace>
<times srtt="53411" rttvar="63923" to="309103"/>
</host>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.16.10" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.138" rtt="27.07"/>
<hop ttl="4" ipaddr="aa.bb.16.10" rtt="19.94"/>
</trace>
<times srtt="54037" rttvar="63398" to="307629"/>
</host>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="61"/>
<address addr="aa.bb.17.5" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.138" rtt="27.07"/>
<hop ttl="4" ipaddr="aa.bb.17.5" rtt="25.50"/>
</trace>
<times srtt="53848" rttvar="62222" to="302736"/>
</host>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="61"/>
<address addr="aa.bb.18.5" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.138" rtt="27.07"/>
<hop ttl="4" ipaddr="aa.bb.18.5" rtt="27.33"/>
</trace>
<times srtt="54679" rttvar="61420" to="300359"/>
</host>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.18.10" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.138" rtt="27.07"/>
<hop ttl="4" ipaddr="aa.bb.18.10" rtt="27.34"/>
</trace>
<times srtt="60353" rttvar="71855" to="347773"/>
</host>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="61"/>
<address addr="aa.bb.19.6" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.138" rtt="27.07"/>
<hop ttl="4" ipaddr="aa.bb.19.6" rtt="27.33"/>
</trace>
<times srtt="63600" rttvar="75779" to="366716"/>
</host>
<host starttime="1358430524" endtime="1358430536"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.32.8" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.129" rtt="11.90"/>
<hop ttl="4" ipaddr="aa.bb.32.8" rtt="59.18"/>
</trace>
<times srtt="13005" rttvar="18000" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430536"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.32.9" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.129" rtt="11.90"/>
<hop ttl="4" ipaddr="aa.bb.32.9" rtt="59.17"/>
</trace>
<times srtt="12991" rttvar="17989" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430536"><status state="up" reason="echo-reply" reason_ttl="61"/>
<address addr="aa.bb.33.5" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.129" rtt="11.90"/>
<hop ttl="4" ipaddr="aa.bb.33.5" rtt="59.15"/>
</trace>
<times srtt="23099" rttvar="23762" to="118147"/>
</host>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.33.8" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.129" rtt="11.90"/>
<hop ttl="4" ipaddr="aa.bb.33.8" rtt="59.21"/>
</trace>
<times srtt="9802" rttvar="17866" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430536"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.33.9" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.129" rtt="11.90"/>
<hop ttl="4" ipaddr="aa.bb.33.9" rtt="59.21"/>
</trace>
<times srtt="23098" rttvar="23772" to="118186"/>
</host>
<host starttime="1358430524" endtime="1358430540"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.33.10" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.129" rtt="11.90"/>
<hop ttl="4" ipaddr="aa.bb.33.10" rtt="3.55"/>
</trace>
<times srtt="6560" rttvar="6102" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="61"/>
<address addr="aa.bb.34.5" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.129" rtt="11.90"/>
<hop ttl="4" ipaddr="aa.bb.34.5" rtt="5.25"/>
</trace>
<times srtt="4278" rttvar="4028" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430527"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.34.8" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.129" rtt="11.90"/>
<hop ttl="4" ipaddr="aa.bb.34.8" rtt="5.26"/>
</trace>
<times srtt="2360" rttvar="4577" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430528"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.65.9" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.13" rtt="12.02"/>
<hop ttl="4" ipaddr="aa.bb.65.9" rtt="7.78"/>
</trace>
<times srtt="11350" rttvar="9916" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430528"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.65.10" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.13" rtt="12.02"/>
<hop ttl="4" ipaddr="aa.bb.65.10" rtt="7.77"/>
</trace>
<times srtt="17875" rttvar="17375" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430528"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.66.8" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.13" rtt="12.02"/>
<hop ttl="4" ipaddr="aa.bb.66.8" rtt="7.76"/>
</trace>
<times srtt="15675" rttvar="14863" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430528"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.66.9" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.13" rtt="12.02"/>
<hop ttl="4" ipaddr="aa.bb.66.9" rtt="7.77"/>
</trace>
<times srtt="18615" rttvar="18222" to="100000"/>
</host>
<host starttime="1358430524" endtime="1358430528"><status state="up" reason="echo-reply" reason_ttl="125"/>
<address addr="aa.bb.66.10" addrtype="ipv4"/>
<hostnames>
</hostnames>
<trace proto="icmp">
<hop ttl="1" ipaddr="aa.bb.190.1" rtt="11.64"/>
<hop ttl="2" ipaddr="aa.bb.252.5" rtt="5.03"/>
<hop ttl="3" ipaddr="aa.bb.252.13" rtt="12.02"/>
<hop ttl="4" ipaddr="aa.bb.66.10" rtt="8.98"/>
</trace>
<times srtt="19534" rttvar="18794" to="100000"/>
</host>
<runstats><finished time="1358430750" timestr="Thu Jan 17 14:52:30 2013" elapsed="226.36" summary="Nmap done at Thu Jan 17 14:52:30 2013; 2560 IP addresses (295 hosts up) scanned in 226.36 seconds" exit="success"/><hosts up="295" down="2265" total="2560"/>
</runstats>
</nmaprun>

我有一些问题:

  1. 我找不到可以帮助我的nmap选项或脚本。你知道这些能帮我什么吗?
  2. 如果我有像aa.bb.252.5、aa.bb.252.13和aa.bb.252.138这样的3个地址,那么如果这些地址以.252.x结束,它们是否属于同一个网络?
  3. 如果我有aa.bb.16.5,aa.bb.16.9,aa.bb.16.10,aa.bb.17.5,aa.bb.18.5,aa.bb.18.10,aa.bb.19.16这些地址可以属于同一个子网?
  4. 如果aa.bb.等于145.132。我可以说子网掩码是255.255.0.0吗?
  5. 假设(1)每个地址以149.132开头,(2)执行扫描的主机位于149.132.190.1的同一子网中,掩码为255.255.255.0,(3)路由跳为: .190.1 -> .252.5 --> .252.138 --> .16.5 .190.1 -> .252.5 --> .252.138 -> 16.8 .190.1 -> .252.5 -> 252.138 -> 16.9 .190.1 -> .252.5 --> .252.138 --> .17.5 .190.1 -> .252.5 --> .252.138 --> .18.5 .190.1 -> .252.5 --> .252.138 -> 18.10 .190.1 -> .252.5 --> .252.138 -> 19.6 使用此拓扑,如何理解一个节点(例如,149.132.16.5)是否属于另一个节点的同一子网(例如,149.132.18.10)?我能理解子网掩码或子网范围的推理对traceroute跳吗?

谢谢大家!

列奥纳多

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-01-30 22:44:50

  1. 当主机通过网络进行通信时,它们使用IP地址进行通信,而很少使用子网掩码进行通信。如果您能够访问实际的路由器/交换机,您将能够检索子网信息,但如果没有,我目前无法想到通过SSH和运行ifconfig连接到每个主机的其他方式。
  2. 不是的。您不能根据IP地址假设子网掩码为255.255.255.0。虽然这将是一个很好的猜测。
  3. 是的,它们都可以属于同一个子网。例如,255.255.0.0的子网掩码就能做到这一点。然而,正如我在上面的第2条中所回答的,您不能假设这一点。
  4. 不,见上文2和3。
  5. 基本上,不可能使用跟踪路由提供的信息100%确定地检索子网信息。然而,你可以很好地猜出它们会是什么,而且你可能会是正确的。
票数 0
EN

Stack Overflow用户

发布于 2013-01-30 09:53:28

你所有的地址都有一个网络地址。如果您用子网掩码掩码地址,您将得到网络地址。

=>相同的网络地址,相同的网络(子网)。

要做的步骤(可能是为了学习):

  • 写下地址(二进制)。
  • 写下子网掩码(二进制和直接在地址下)
  • 第三行填写"0“地址,子网掩码在这个位置上有"1”,然后写下"1“。

现在你有了网络地址。这样做的两个地址,如果出站有相同的网络地址,他们都在同一子网。

代码语言:javascript
复制
192.168.  0.1   => 1100 0000 . 1010 1000 . 0000 0000 . 0000 0001
255.255.255.0   => 1111 1111 . 1111 1111 . 1111 1111 . 0000 0000
network address => 1100 0000 . 1010 1000 . 0000 0000 . 0000 0000 => 192.168.0.0

192.168.  0.2   => 1100 0000 . 1010 1000 . 0000 0000 . 0000 0010
255.255.255.0   => 1111 1111 . 1111 1111 . 1111 1111 . 0000 0000
network address => 1100 0000 . 1010 1000 . 0000 0000 . 0000 0000 => 192.168.0.0

因此,192.168.0.1和192.168.0.2处于同一子网(称为192.168.0.0)。

(2)不。子网掩码可以将252.x分成2个子网(252.0~127和252.128 ~ 255 )。(3)是。如果子网掩码只分裂在aa.bb-级别(4)否。与(2)相同的原因,但向后。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14600858

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档