我一直在使用“愤怒的IP扫描仪”( Angry ),通过在两个文本框中放置启动IP和结束IP,我可以轻松地扫描IP范围。现在在nmap中,我想知道如何扫描一个IP范围,给出两个IP :凝视IP和结束IP。例如,我喜欢这样使用nmap:
nmap 10.10.10.10 10.10.15.254.254
请注意,我不想在IP的末尾使用那个/24。
发布于 2020-04-11 22:46:16
来自man nmap
CIDR notation is short but not always flexible enough. For example, you might want to scan 192.168.0.0/16 but skip any IPs ending with .0 or .255 because they may be used as subnet network and broadcast addresses. Nmap supports this through octet range addressing. Rather than specify a normal IP address, you can specify a comma-separated list of numbers or ranges for each octet. For example, 192.168.0-255.1-254 will skip all addresses in the range that end in .0 or .255, and 192.168.3-5,7.1 will scan the four addresses 192.168.3.1, 192.168.4.1, 192.168.5.1, and 192.168.7.1. Either side of a range may be omitted; the default values are 0 on the left and 255 on the right. Using - by itself is the same as 0-255, but remember to use 0- in the first octet so the target specification doesn't look like a command-line option. Ranges need not be limited to the final octets: the specifier 0-255.0-255.13.37 will perform an Internet-wide scan for all IP addresses ending in 13.37. This sort of broad sampling can be useful for Internet surveys and research.
所以你需要弄清楚你的开始和结束范围是什么。据我所见,您正在通过10.10.10.10
通过10.10.15.254
(您的终结IP的10.10.15.254.254
是一个无效的地址)进行操作,但这涵盖了6个整个子网,每个子网以一个.1开始,以一个.254 IP结束,因此您可能不想在.10上启动每个子网,因为您将跳过每个子网的前9个IP。所以,这样做吧:(我添加了a-(S)可以命令和搜索(N)o端口扫描(前称-sP)将扫描1,524个IP地址的主机)。
nmap -sn 10.10.10-15.1-254
但根据你写的,这就是我认为你想要的。
希望这能帮上忙!
https://askubuntu.com/questions/1226310
复制相似问题