英文:
How to scan a partial /23 subnet with NMAP?
问题
我想部分扫描/23子网,使用NMAP。例如,子网192.168.0.0/23的IP地址范围从192.168.0.1到192.168.1.255。
我不想执行完整的子网扫描,而只想进行部分扫描。例如,从IP 192.168.0.30到192.168.1.240的扫描。
我在Ubuntu操作系统上使用NMAP版本7.60。
我可以使用以下代码扫描完整的子网
nmap -sn -host-timeout 300 -n 192.168.0.0/23
然而,我想扫描不是整个子网的特定范围。
如何扫描特定范围,例如从IP 192.168.0.30到192.168.1.240?请注意,第三个八位组在变化,因为我正在扫描/23子网。
我还尝试过
nmap -sn -host-timeout 300 -n 192.168.0-1.30-240
但在那个版本中,我错过了一些IP地址。
英文:
I would like to partially scan /23 subnets with NMAP. For example, the subnet 192.168.0.0/23 ranges from IP address 192.168.0.1 to 192.168.1.255.
I don't want to perform a complete subnet scan, but only a partially scan. For example scanning from IP 192.168.0.30 to 192.168.1.240.
I'm using NMAP version 7.60 on Ubuntu OS.
I can scan the complete subnet with this code
nmap -sn -host-timeout 300 -n 192.168.0.0/23
However, I would like to scan not the complete subnet.
How to scan a specific range, for example from IP 192.168.0.30 to 192.168.1.240? Notice that the 3rd octet is changing since I'm scanning a /23 subnet.
I also tried
nmap -sn -host-timeout 300 -n 192.168.0-1.30-240
but in that version I'm missing some IP addresses.
答案1
得分: 1
在NMAP中,您可以通过空格分隔多个IP地址/范围。
由于您的示例仅包括192.168.0.和192.168.1.(其中*表示任意范围),您可以简单地列举它们,如下所示:
nmap -sn -host-timeout 300 -n 192.168.0.30-255 192.168.1.0-240
英文:
In NMAP, you can specify multiple IP addresses/ranges separated by a whitespace.
Since your example only includes 192.168.0.* and 192.168.1.* (where * is an arbitrary range), you can simply enumerate them like this:
nmap -sn -host-timeout 300 -n 192.168.0.30-255 192.168.1.0-240
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论