How To Install Nmap on CentOS 8

Install Nmap on CentOS 8

In this tutorial, we will show you how to install Nmap on CentOS 8. For those of you who didn’t know, Nmap “Network Mapper” is a utility for network exploration or security auditing. It is one of the essential tools used by network administrators to troubleshooting network connectivity issues and port scanning. Most Unix and Windows platforms are supported in both GUI and command line modes.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step by step install of the Nmap security scanner on CentOS 8.

Install Nmap on CentOS 8

Step 1. First, let’s start by ensuring your system is up-to-date.

sudo dnf clean all
sudo dnf update

Step 2. Installing Nmap on CentOS 8.

Run the following command to install Nmap:

sudo dnf install nmap

To verify the installation and operation of Nmap, enter the following command to receive the version:

nmap -version

Step 3. Using Nmap.

The article covers the basic options this tool has to offer. For a full list of options visit the Nmap official page or access the manual from your command line:

man nmap

Scan IP range or subnet:

To obtain general information of a remote system type:

sudo nmap target-IP-address or

Instead of scanning individual IPs, scan a whole IP range by defining it in your command line:

sudo nmap

The following command scans the entire specified subnet:

sudo nmap

Port Scanning with Nmap

Nmap is an efficient port scanner that recognizes six port states:

  • open – actively accepting TCP connections, UDP datagrams, or SCTP associations
  • closed – accessible; however, no application is listening on the port
  • filtered – Nmap cannot determine whether the port is open due to packet filtering
  • unfiltered – the port is accessible; however, Nmap is unable to determine if it is open or closed
  • open|filtered – Nmap cannot determine if a port is open or filtered
  • closed|filtered – Nmap cannot establish if a port is closed or filtered

Port Specification and Scan Order

By default, Nmap scans the thousand most common ports for each protocol. It also offers options for specifying which ports are to be scanned and whether the scan is random or ordered.

The -p option allows you to specify port ranges and sequences:

sudo nmap –p 80,443

This command scans ports 80 and 443 for the defined host.

TCP SYN scan

Initiate TCP SYN for a fast and unobtrusive scan. Since this type of scan never completes TCP connections, it is often referred to as half-open scanning. To run a TCP SYN scan, use the command:
sudo nmap -sS

Congratulations! You have successfully installed Nmap. Thanks for using this tutorial for installing the Nmap security scanner on CentOS 8 systems. For additional help or useful information, we recommend you to check the official Nmap website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!