How To Use Nmap For Scanning A Port?

How To Use Nmap For Scanning A Port?

There are lots of network mapping and security auditing tools available for reviewing and analyzing a computer network for possible security vulnerabilities and loopholes. These tools can be used by a network administrator or a computer security professional to evaluate the possible threats in their system. Nmap is from one of these tools, we are going to discuss it in this article.

What is Nmap?

Nmap (Network Mapper) is a free and open-source tool for network discovery and vulnerability scanning in a system connected to the Internet. Nmap can determine information like hosts available on the network, service that offered by those hosts, operating system that they are running, packet filters/firewalls they are using, etc. Nmap discovers this information by sending packets and analyzing the response on that network. Initially, it was released for Linux but later makes available for other major operating systems too.

How do we install it?

To install Nmap in Debian and its derivatives execute the following command in the terminal
sudo apt-get install nmap -y

In RPM-based Linux distributions execute the following command in the terminal
sudo yum install nmap -y

Or you can download it from here.

GUI tool for Nmap

Zenmap is the official Graphical user interface of the Nmap security scanner. It provides several options like scan results can be saved and viewed later, you can compare these saved scans to see how they differ, and also you can see the network topology maps. This application is available freely for multiple platforms.
You can install Zenmap by using the following command –
sudo apt-get install zenmap -y (In Debian and similar distributions)
sudo yum install zenmap -y (In RPM-based distributions)

Look at the snapshot below it shows the GUI of Nmap.

How to use Nmap for port scanning?

A beginner may find it easier to use Nmap in GUI while others can feel comfortable to use Nmap in their terminal. You can use either way for the security scan. The basic syntax of Nmap command is given below-
nmap [scan_type] [options] <target_specification>

For example –
nmap -A -T4

In this example-A is the option that is used to enable OS detection, version detection, script scanning and traceroute.-T is the timing template, Nmap offers six timing templates these can be specified with numbers (0-5) or with names. The timing template names with corresponding numbers are given below –


Where 0 is used for a slow network scan, and it uses a serial scan method while 5 is used for an extremely fast network scan it uses parallel scanning strategies.

Execute the Nmap command without any argument in the terminal to see the available options that can be used while scanning a target. These options are used to optimize a scan. Scanning every port of every single IP address is slow and usually unnecessary. So anyone should use the right options to meet the exact results with reasonably fast speed.

Is there any legal Issues in using Nmap?

Nmap is a tool that can be used to discover security loopholes in a system connected to the Internet. If it is used properly it can help you to protect your network from hackers. But if used improperly, it can get you into trouble. Intentionally anyone can attempt to gain unauthorized access to a computer system, and if get accessed the data of that system can be misused. Unauthorized port scanning is illegal in some jurisdictions. You should take a written authorization from the target network administrator before initiating a scan to avoid the legal issues.

If you are interested to know more about Nmap and its usage then you should follow the reference guide. If you have a query/suggestion related to this topic you can write us in the comments below.

Previous What Is apt-fast And Why Should You Use It?
Next How To Find A File Or Directory Quickly In Linux/Unix?

About author

You might also like

Uncategorized 0 Comments

The Concept Of RAID

Originally the term RAID defined as “Redundant Array of Inexpensive Disks” but now it is referred to as “Redundant Array of Independent Disk”. It is a data storage virtualization technology.

Uncategorized 0 Comments

How To Change Default Settings Of Grub Bootloader?

Grub Grub is a bootloader that is used to manage the multiple operating systems installed on a computer. A boot loader is the first program that runs when a computer

Uncategorized 0 Comments

File Ownership And Permissions In Linux/Unix

Linux and Unix are multi-user operating systems that means different users can access the operating system at a time and can use system resources simultaneously. So the files created by


No Comments Yet!

You can be first to comment this post!

Leave a Reply