Network Mapping Using Nmap

Network Mapping is a process by which the devices on the network and their connectivity types can be discovered. It is very important for network engineer as well as a penetration tester or a hacker to know this tool. The most preferred way of mapping is using Nmap.

What is Nmap?

“Nmap is a security scanner, originally written by Gordon Lyon, used to discover hosts and services on a computer network, thus building a “map” of the network.” (Ref: Wikipedia)

Installing Nmap

  • On Linux: Kali Linux comes preinstalled with Nmap, so you can use right after the installation of Kali Linux
  • On Windows: On Windows, Nmap can be installed using multiple ways as mentioned below.
    • Download and install using Nmap Installer from here
    • Get Pentest Box which have nmap included. Here is the download link
  • On MAC: For MAC OS, download installer from here. More detailed instruction on installation can be found here

Using Nmap

  • To scan a particular ip or hostname:

    nmap ip or hostname


  • Scanning a specific port
    nmap -p 22

    The above command will scan the ip for port 22

  • For a range of ports
    nmap -p1-1000

    The above command will scan the ip from port range 1 to 1000

  • To check what service a port is running
    nmap -sV
  • Scanning an entire IP range
  • To scan all 65535 ports
    nmap -p-
  • OS detection
    nmap -O
  • To scan an IP using TCP conect
    nmap -sT
  • To scan using TCP SYN
    nmap -sS
  • For UDP scan
    nmap -sU

Nmap comes preloaded with lot of features for various type of scan which can be used depending upon the requirement and how the target server is setup. To get all the options and flags supported by nmap use the help command:

nmap -h

Leave a Reply

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