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.

  • 192.168.1.1 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 192.168.0.0/16 

As Network Address

We can provide targets with CIDR masks.

  • Scan C class 192.168.1.0 network

  • Scans between 192.168.0.0192.168.15.255

  • Scans between 192.168.0.0192.168.15.255
  • – 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  Arping Command Tutorial With Examples For Linux

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. 10.0.1.0/24 is a network address.

[rps-include post=6632]

Leave a Reply

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

Enjoy this blog? Please spread the word :)