What is Nmap? How to use Nmap for Information Gathering

Nmap stands for Network Mapper, a powerful network scanning and host detection tool that is being used to perform reconnaissance in a very first step of penetration testing. It does not only gather information about the target or conduct enumeration to find potential attack vectors, but also has an ability to be used as a security scanner.

This makes this utility a multipurpose tool having flexibility to run on different operating systems including Linux. Windows and Mac. In most famous Linux penetration testing distributions namely Kali Linux and Parrot OS, nmap comes pre-installed. We can simply list down its capabilities as:

  1. It detects live host on a network
  2. It used to perform port scanning on the host
  3. It also detects what service is on at the targeted port
  4. It identifies the hardware address along with operating system and software version
  5. It helps to find vulnerability of the target

To download this tool just browse the address https://nmap.org/ which is the official website.

After the download and installation process complete, launch the tool by typing “nmap” in the command prompt, or if you are using a pentesting distro like Parrot OS or Kali Linux, launch it from the information gathering section.


You will see a detailed manual where all the commands and operations are explained to help you perform target scanning. At the end of the manual you will also find some examples to follow.

perform target scanningBasically, nmap is not a stealthy tool, and easily detectable by firewalls. Servers would get notified that they have been scanned so the real charm of nmap is how to perform scanning anonymously.

There are some useful commands to utilize this tool for stealthy scanning, but just for learning the basic commands we will use a free testing scanning machine given by nmap as shown in the example section: http://scanme.nmap.org/

Nmap allows you to scan this website as educational purpose so we will use this as our target machine.

Nmap allowsLet us just observe the first command in the example of the manual:

# nmap -v -A scanme.nmap.org

The parameter -v here specifies the address name and version number of the server while -A enables the Aggression mode which specifies OS detection, version detection, script scanning and traceout.

Another big advantage of using nmap is it allows users to write (and share) simple scripts and automate a wide variety of networking tasks. The scripts are compiled in Lua Programming language allowing users to discover the target’s vulnerabilities more effectively.

Nmap also provides an interactive GUI interface named as Zenmap an official Nmap Security Scanner GUI aims to provide the amateur pentesters an easy platform, practice more advance features of nmap while saving the scan results which can be viewed later. These results can also be compared to another to see the differences among them. The results of recent scans are stored in a searchable database.

searchable databas


Reconnaissance is the very first step of penetration testing and to perform it wisely, you need to grip on some amazing tools to get fruitful results. Nmap is one of those tools that every pentester must learn and be expert on it.

This article gives the basic know how of the usage of nmap. There are so many other things that you can do with the Nmap, and we will discuss them in the future articles.

Ehacking Staff
With more than 50 global partners, we are proud to count the world’s leading cybersecurity training provider. EH Academy is the brainchild of Ehacking, which has been involved in the field of training since the past Five years and continues to help in creating professional IT experts.

Most Popular

What is Deepfake, and how does it Affect Cybersecurity?

Producing deepfake is easy. It is hard to detect. They operate with a description of reality rather than reality itself (e.g., a video). Any...

Cyber Physical Systems for Smart Grid Applications

The smart grid is an emerging paradigm for more reliable and efficient power delivery. It requires monitoring, controlling, and managing the power grid in...

How Is Hospital Critical Infrastructure Protected?

Hospitals hold a lot of sensitive data. When they are hacked, patient information is exposed, putting patients at risk because the hackers can use...

Software Engineering for Cyber-Physical Systems

Cyber-physical systems (CPS) are engineered systems that integrate computation, networking, and physical process. CPS classifies in many ways, including their scale, embeddedness, and the...