UbuntuUbuntu Based

How To Install Nmap on Ubuntu 24.04 LTS

Install Nmap on Ubuntu 24.04

In this tutorial, we will show you how to install Nmap on Ubuntu 24.04 LTS. Nmap, short for Network Mapper, is a powerful open-source tool used for network discovery and security auditing. It is widely utilized by network administrators and security professionals to identify devices on a network, discover open ports, and detect vulnerabilities. With the release of Ubuntu 24.04 LTS, users can take advantage of the latest features and improvements in this long-term support version.

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 the step-by-step installation of the Nmap on Ubuntu 24.04 (Noble Numbat). You can follow the same instructions for Ubuntu 22.04 and any other Debian-based distribution like Linux Mint, Elementary OS, Pop!_OS, and more as well.

Prerequisites

Before installing Nmap on Ubuntu 24.04 LTS, ensure your system meets the following requirements:

  • A server running one of the following operating systems: Ubuntu and any other Debian-based distribution like Linux Mint.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies.
  • An Ubuntu 24.04 system with root access or a user with sudo privileges.

Install Nmap on Ubuntu 24.04 LTS

Step 1. Updating the Package Repository.

Before installing any new software, it’s crucial to update your system packages to the latest versions. This ensures compatibility and security.

sudo apt update
sudo apt upgrade

The apt update command refreshes the package list, while apt upgrade installing the available updates. This step helps resolve any dependency issues and provides access to the latest security patches and bug fixes.

Step 2. Installing Nmap on Ubuntu 24.04.

  • Install Nmap Using APT Package Manager

The easiest and most common method to install Nmap on Ubuntu 24.04 LTS is using the APT (Advanced Package Tool) package manager. APT is a powerful command-line tool that simplifies the process of installing, upgrading, and removing software packages. To install Nmap using APT, follow these steps:

sudo apt install nmap

Once the installation is finished, you can verify the installed version of Nmap by running:

nmap --version
  • Install Nmap Using Snap

Snap is a universal package manager developed by Canonical, the company behind Ubuntu. It allows users to install and manage applications across different Linux distributions. If you prefer using Snap, you can install Nmap with the following steps:

sudo apt install snapd

Once Snapd is installed, you can install Nmap using the following command:

sudo snap install nmap

To verify the installation, run:

nmap --version
  • Install Nmap from Source

In some cases, you may want to install Nmap from the source code. This method allows you to compile Nmap with specific options and features that may not be available in the pre-compiled packages. To install Nmap from the source, follow these steps:

First, install the necessary build dependencies:

sudo apt install build-essential libpcap-dev libpcre3-dev libssl-dev

Download the Nmap source code from the official website. Replace <version> with the desired version number:

wget https://nmap.org/dist/nmap-7.95.tar.bz2

Extract the downloaded archive:

tar -xvjf nmap-7.95.tar.bz2

Change to the extracted directory:

cd nmap-7.95

Configure the build options:

./configure

Compile the source code:

make

Install Nmap:

sudo make install

 Regardless of the installation method you choose, it’s essential to verify that Nmap is correctly installed and operational. To do this, simply run the following command in your terminal:

nmap --version

Step 3. Basic Usage of Nmap.

Now that you have successfully installed Nmap on your Ubuntu 24.04 LTS system, let’s explore some basic usage examples to get you started.

  • Scanning a Single Host

To scan a single host, use the following command:

nmap 192.168.1.77
  • Scanning Multiple Hosts

To scan multiple hosts simultaneously, you can specify an IP address range:

nmap 192.168.1.0/24
  • Port Scanning

Nmap allows you to scan specific ports or a range of ports on a target host. To scan all ports (1-65535) on a host, use:

nmap -p 1-65535 192.168.1.77
  • Service Version Detection

To detect the versions of services running on open ports, use the -sV option:

nmap -sV <IP address>
  • Operating System Detection

Nmap can also attempt to detect the operating system of the target host. To enable OS detection, use the -O option:

nmap -O <IP address>

Congratulations! You have successfully installed Nmap. Thanks for using this tutorial for installing the Nmap on the Ubuntu 24.04 LTS system. For additional help or useful information, we recommend you check the 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!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button