Search
Close this search box.

How to Install Nmap on Ubuntu 20.04

Table of Contents

How to Install Nmap on Ubuntu 20.04

Nmap is a network exploration and security auditing tool used by security professionals, network administrators, and individuals alike to assess network security, discover vulnerabilities, and troubleshoot network problems. It is an open-source tool that can be installed on Ubuntu, one of the most popular Linux distributions.
This article will explore Nmap installation on Ubuntu, providing an in-depth understanding of what it is, its features, advantages, disadvantages, use cases, and conclusions.


What is Nmap?


Nmap stands for Network Mapper. It is a free and open-source network exploration and security auditing tool. Nmap can discover hosts and services on a computer network, create a network map, identify vulnerabilities in network services, and manage service upgrade schedules.
Nmap is designed to be a flexible tool that can be used for various purposes, including network inventory, network security auditing, and host monitoring. It can scan both small and large networks and single hosts. Nmap is available for various operating systems, including Ubuntu.

 

 Let’s get started with the installation.

 

 

Step 1: Configure the VPSie cloud server

 
  1. Sign in to your system or register a newly created one by logging in to your VPSie account. 
  2. Connect by SSH using the credentials we emailed you.
  3. Once you have logged into your CenOS instances and updating your system.

 

Step 2: Installing Nmap

Installing Nmap on Ubuntu via apt

 

Use this command to update repository index,

 # sudo apt update

Install Nmap,

# sudo apt install nmap

Your internet speed will determine how long it takes to install. If the installation is complete, you can verify it and check the Nmap version by running the command below,

 

# nmap --version

 

# nmap --version
Nmap version 7.80 ( https://nmap.org ) Platform: x86_64-pc-linux-gnu Compiled with: liblua-5.3.3 openssl-1.1.1d nmap-libssh2-1.8.2 libz-1.2.11 libpcre-8.39 libpcap-1.9.1 nmap-libdnet-1.12 ipv6 Compiled without: Available nsock engines: epoll poll select

 

 

Installing Nmap using Ubuntu source code

 

 

The package build-essential should be installed. Run the following command,

 

# sudo apt install build-essential

 

You can download Nmap’s latest version in tar.bz2 format from Nmap’s official Downloads page. Alternatively, using the following command, you can download 7.92 from the Nmap website.

# wget https://nmap.org/dist/nmap-7.92.tar.bz2

 

You can extract the tar.bz2 archive using the following command,

 

# tar xf nmap-7.92.tar.bz2

 

Browse to the extracted directory,

 

# cd nmap-7.92/

 

Check that the system meets the prerequisites to install the software by running the configure script. This will require you to install the requirements if it indicates an error.

 

# sudo ./configure

 

The following view would appear on your Terminal if the configuration were successful.

 

 

            .       .
            \`-"'"-'/
             } 6 6 {
            ==. Y ,==
              /^^^\  .
             /     \  )  Ncat: A modern interpretation of classic Netcat
            (  )-(  )/
            -""---""---   /
           /   Ncat    \_/
          (     ____
           \_.=|____E
Configuration complete.

          :================:
         /||# nmap -A _   ||
        / ||              ||
       |  ||              ||
        \ ||              ||
          ==================
   ........... /      \.............
   :\        ############            \
   : ---------------------------------
   : |  *   |__________|| ::::::::::  |
   \ |      |          ||   .......   |
     --------------------------------- 8

  NMAP IS A POWERFUL TOOL -- USE CAREFULLY AND RESPONSIBLY

 

Build Nmap software using the make command,

 

 

# sudo make

 

 

Install Nmap by running the following command,

 

 

# sudo make install

 

The following lines will appear at the end of the output once Nmap is installed.

 

/usr/bin/install -c -c -m 644 docs/nping.1 /usr/local/share/man/man1/
NPING SUCCESSFULLY INSTALLED
make[1]: Leaving directory '/root/nmap-7.92/nping'
NMAP SUCCESSFULLY INSTALLED

 

Check the installed version of Nmap,

# nmap --version

 

Step 2: Uninstalling Nmap

 

Nmap can be removed from an Ubuntu system using the following command,

 

# sudo apt remove nmap

 

It is necessary to remove all configuration files associated with Nmap to execute the command,

 

# sudo apt purge nmap

 

You can remove Nmap as follows if you have installed it from the source,

# cd nmap-7.91/

 

Then,

 

sudo make uninstall

 

Nmap on Ubuntu:

Ubuntu is a widespread Linux distribution widely used in servers and desktops. Installing Nmap on Ubuntu is a straightforward process. Ubuntu users can install Nmap using the apt package manager, which can be done by opening a terminal and entering the following command:

Sudo apt install nmap

Once Nmap is installed, it can be run by entering the command “nmap” in the terminal.

 

Use Cases of Nmap:

  1. Network inventory – Nmap can create a list of hosts and services on a computer network. This is useful for network administrators who need to keep track of the devices and services on their network.
  2. Network security auditing – Nmap can be used to identify vulnerabilities in network services. This is useful for security professionals assessing network security and identifying potential vulnerabilities.
  3. Host monitoring – Nmap can monitor hosts for uptime and check for changes in open ports and services. This is useful for system administrators who need to ensure the availability and security of their hosts.

 

Features of Nmap:

  1. Port scanning – Nmap can scan for open ports on a host or network. This is useful for identifying potential vulnerabilities in network services.
  2. Service detection – Nmap can detect the services running on a host or network. This is useful for identifying the software and versions of software running on a host or network.
  3. OS detection – Nmap can detect the operating system running on a host or network. This is useful for identifying the software and versions of software running on a host or network.

 

Advantages of Nmap:

  1. Free and open-source – Nmap is free to use and is open-source software. Users can modify the source code to meet their specific needs.
  2. Flexible – Nmap is a flexible tool that can be used for various purposes, including network inventory, network security auditing, and host monitoring.
  3. Powerful – Nmap is a powerful tool that can scan both small and large networks and single hosts.

 

Disadvantages of Nmap:

  1. Complexity – Nmap can be a complex tool, especially for users new to network scanning and security auditing.
  2. False positives – Nmap can sometimes generate false positives, wasting time and resources.
  3. Risk of network disruption – Nmap can sometimes cause network disruption, mainly if not used carefully.

 

Conclusion:

Nmap is a powerful tool for network exploration and security auditing. It can be installed on Ubuntu, one of the most popular Linux distributions. Nmap is free and open-source, flexible, and powerful. However, it can be a complex tool, generating false positives and potentially causing network disruption if not used carefully.

 

Overall, Nmap is essential for network administrators and security professionals who must assess network security, identify potential vulnerabilities, and troubleshoot network problems. While there are some disadvantages to using Nmap, its advantages make it a valuable tool for any organization that relies on computer networks.

 

When using Nmap, it is essential to use it carefully and responsibly. Nmap can be a powerful tool but can also cause network disruption if not used carefully. Before scanning a network, obtaining permission from the network owner is essential to ensure that the scan will not cause any interruption.

 

In conclusion, Nmap is essential for network administrators and security professionals. It is a free and open-source tool that can be installed on Ubuntu, making it accessible to many users. While there are some disadvantages to using Nmap, its advantages make it a valuable tool for any organization that relies on computer networks.

 

 

That’s all for now; I hope you’ve found this informational.

 

A Simple Way to Reset Ubuntu to the Default Settings

 

Fast DirectAdmin Install

FAQ

Nmap (Network Mapper) is a free and open-source utility used for network exploration and security auditing. It can be used to discover hosts and services on a network, as well as to identify vulnerabilities and security issues.

Nmap is a command-line utility, and it offers a variety of options and parameters that can be used to customize the scan. Here are some common examples:

  • To scan a single host, use the command nmap [host]. For example, nmap 192.168.1.1.
  • To scan a range of hosts, use the command nmap [start_ip]-[end_ip]. For example, nmap 192.168.1.1-10.
  • To scan a network, use the command nmap [network_address/mask]. For example, nmap 192.168.1.0/24.
  • To scan a host and identify open ports, use the command nmap -p [port_range] [host]. For example, nmap -p 1-1000 192.168.1.1.
  • To perform a more detailed scan, use the command nmap -A [host]. This will enable OS detection, version detection, and script scanning.

Nmap is a powerful tool that can be used for both legitimate and malicious purposes. It is important to use Nmap responsibly and within legal boundaries. In some jurisdictions, the use of Nmap may be subject to legal restrictions, so it is important to consult local laws and regulations before using Nmap for any purpose.

To update Nmap on Ubuntu, use the APT package manager to install the latest version. Here are the steps:

  1. Open a terminal window.
  2. Update the package index by running the command sudo apt-get update.
  3. Upgrade the Nmap package by running the command sudo apt-get upgrade nmap.
  4. Verify the installation by running the command nmap -v to display the version information.

Nmap provides several options to customize the output of the scan. Here are some common examples:

  • To save the output to a file, use the command nmap [options] [host] -oN [filename]. For example, nmap -p 1-1000 192.168.1.1 -oN scan_results.txt.
  • To display only open ports, use the command nmap --open [host]. For example, nmap --open 192.168.1.1.
  • To display the output in XML format, use the command nmap [options] [host] -oX [filename]. For example, nmap -A 192.168.1.1 -oX scan_results.xml.
  • To display the output in a verbose format, use the command `nmap –
Make a Comment
Share on
Facebook
Twitter
LinkedIn
Print
VPSie Cloud service

Fast and Secure Cloud VPS Service

Try FREE
For a month

The First 1 orders gets free discount today! Try Sign up on VPSie to get a chance to get the discount.