Ping Sweep_ Nmap method - TheGetch/Penetration-Testing-Methodology GitHub Wiki
Ping Sweep: Nmap method
To perform a ping sweep in nmap, the -sn flag is vital. In its simplest form, any of the following three options could be used for scanning:
nmap -sn x.x.x.x/24
nmap -sn x.x.x.1-254
nmap -sn x.x.x.*
You can also grep out the IPs and cut out fluf:
nmap -sn 172.x.x.x/24 | grep "172" | cut -f 5 -d ' '
A slower, more stealthier approach that utilizes the files containing the IP address split (as seen in the first section above) would be:
nmap --randomize-hosts -sn -T2 -oN nmap_discoveryScan_x.x.x.x-16.txt -iL x.x.x.x_IP_range.split.txt
This will export the results into a text file (-oN
). Randomized hosts is optional, depending on the customer and the testing situation. The flag, -oA
, can be used in place of -oX
or -oN
, as -oA
will output the results to all output formats.
The results for both command options shown above will be the list of hosts that responded to the ping, thus are up and alive.