HakTip 92 – NMap 101: Scanning For Multiple Targets
This week on HakTip Shannon is scanning for multiple targets in NMap.
Last week we discussed the simple task of installing NMap and scanning for a selected Target. I chose to scan my Synology NAS to show you a quick outline of what to expect whenever your scan has completed. Now lets say you want to scan multiple targets at once. Instead of scannin them one at a time, you can just do them all in one command like this: nmap 192.168.10.1 192.168.10.15 192.168.10.56 and so on. This will list each of them in the same order, starting with your first IP address, then second… then third… The list will look similar to just scanning one target. Also, if they are all on the same subnet you can also type your command like this: nmap 192.168.10.1,15,56 and it’ll output the same information.
If you wanted to scan a range of IP’s, that looks a little different. You would simply type: nmap 192.168.10.1-100 and it will output any and all networked hardware that is currently on and connected between those IP address ranges. If you want, you can also change this to a different class of subnet, or a range of networks by doing the same thing, but typing 192.168.1-100.*. That wildcard (remember our Linux Terminal 101 series?) will scan ALL ranges from 0-255 in that subnet. After the break, we’ll try scanning an entire subnet.
Ready to scan an entire subnet. Back in the terminal, let’s type: nmap 192.168.10.1/24. This /24 looks a little weird. It is a CIDR notation of the network address and the subnet mask in binary bits. Again, this command will give you very similar information on a long list of outputs.
Here is a fun one. You can scan a list of targets from IP addresses you had previously entered into a text file. We will create a list: cat list.txt. Then, we will enter a few IP addresses that we want to scan. This time we are adding a syntax. Type: nmap -iL list.txt. Nmap will scan IP addresses in the ‘list’ of targets from list.txt. It will read each line as a new IP address.
The scan will look the same as all others above.
What would you like to see next about NMAP? Send me a comment below or email us at [email protected]
And be sure to check out our sister show, Hak5 for more great stuff just like this. I’ll be there, reminding you to trust your technolust.