Nmap Target Specification – POFTUT

Nmap Target Specification

[rps-include post=6632]

Requirement for scanning is target specification. Nmap provides different methodologies to set targets.

Single Host Address

This is the simplest and mostly used target specification. We only provide single ip address.

  • is the target ip address

Dns Name

Nmap can use DNS names as targets. It will resolve DNS addresses into ip addresses. Be sure that DNS is working in the system

  • localhost.com is the DNS name of our IP address

Multiple Dns Names

We can also provide multiple dns names into nmap to scan like below.

Multiple Host Address

As we see that scanning hosts one by one is tedious work. We may specify multiple hosts in very different ways.

  • 192.168.1.* is network address. means possible all values which mean from 0 to 255

  • As we expect we will scan /16 subnet in other words 

As Network Address

We can provide targets with CIDR masks.

echo '

  • Scan C class network

  • Scans between

  • Scans between
  • – is used to specify range

Reading From File Line By Line

In enterprise environment there is a lot ip hosts. So specifying them by network can not be a good way. There is an option which is reading target hosts/networks from file.

We create a file named db  and add hosts/networks line by line like below

LEARN MORE  Arp-Scan Command Tutorial With Examples

Now we can use -iL  to scan these hosts

  • We provide text file with -iL and the file name is db. As we see we can provide network addresses too. is a network address.

[rps-include post=6632]

Leave a Reply

Your email address will not be published. Required fields are marked *