Skip to main content

NMAP: How to scan list targets (part-5)

Scan a List of Targets
If you have a large number of systems to scan, you can enter the IP address (or host
names) in a text file and use that file as input for Nmap on the command line.
$ cat list.txt
192.168.10.1
192.168.10.100
192.168.10.101
Target IP addresses in a text file
The list.txt file above contains a list of hosts to be scanned. Each entry in the list.txt
file must be separated by a space, tab, or newline. The -iL parameter is used to
instruct Nmap to extract the list of targets from the list.txt file.



Usage syntax: nmap -iL [list.txt]
$ nmap -iL list.txt
Starting Nmap 5.00 ( http://nmap.org ) at 2009-08-07 19:44 CDT
Interesting ports on 192.168.10.1:
Not shown: 997 filtered ports
PORT
STATE
SERVICE
20/tcp closed ftp-data
21/tcp closed ftp
80/tcp open
http
Interesting ports on 192.168.10.100:
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open
ssh
...
Nmap scan using a list for target specification
The resulting scan displayed above will be performed for each host in the list.txt file.