Scanning random targets on the internet
Nmap supports a very interesting feature that allows us to run scans against random targets on the internet for research reasons. Although it is not recommended (and not legal in some countries) to do aggressive scans blindly, you could generate a sample of random hosts when conducting research about hosts facing the internet.
This recipe shows you how to generate random hosts as targets for your Nmap scans.
How to do it...
- To generate a random target list of n hosts, use the following Nmap command:
$ nmap -iR <n>
For example, to generate a list of 100 hosts, use the following:
$ nmap -iR 100
- Now, let's check how common ICMP is in remote servers. Let's launch host discovery against three random targets:
$ nmap -sn -iR 3 Nmap scan report for host86-190-227-45.wlms-broadband.com (86.190.227.45) Host is up (0.000072s latency). Nmap scan report for 126.182.245.207 Host is up (0.00023s latency). Nmap scan report for 158...