Let’s walk you through the tutorial for installing Nmap for Ubuntu:
Step-1: Updating the system package list
Before installing Nmap in Ubuntu, make sure to update and upgrade your system packages with the latest available versions from Ubuntu.
To upgrade all the packages, open the terminal and run the following command:
sudo apt update && sudo apt upgrade
Step-2: Installing Nmap
In the next step, you can download and install Nmap and the respective dependencies from the Ubuntu repo. This can be performed by running the below command:
sudo apt install nmap
The installation process may take a few minutes to complete, so make sure to have a stable internet connection.
Step-3: Verifying the Installation
After the successful installation of Nmap, you can verify the installed files by writing the below command:
dpkg -L nmap
It will list down all the installed files and if something is missing you can check here.
Step-4: Check Version
To check the currently installed version of Nmap on your system, you can write:
nmap –-version
Step-5: Scan using Nmap
After the successful installation of Nmap on your system, you can use it to scan for hosts and services on your network. Below is the syntax for the command:
nmap <options><target_ip>
The command with an example:
nmap 192.168.1.0/24
This command is going to scan all the current online hosts with IP range 192.168.1.0 to 192.168.1.255. The resulting list will show the number of IP addresses and their corresponding hostnames, with the status of each host (up or down).
If you want to scan a specific host or IP address, then you can write this command (for example):
nmap 192.168.1.1
This will specifically show the host of this IP address and will also show an open SSH port 22.
Step-6: Scanning for open ports
Another important task that you can perform is to scan open ports on a host. The syntax of the command is:
sudo nmap -p <port-number><host-ip-address>
To scan for open ports on a specific host, write the below command:
sudo nmap -p 1-65535 192.168.1.1
The above command will scan all ports ranging from 1 to 65535 on host 192.168.1.1, and output a list of open ports and all services that are running on them.
Step-7: Check all available options
If you want to see all the tools available on Nmap, use the nmap -h command.
Wrapping Up:
These were the easy steps involved in installing Nmap on Ubuntu 20, a popular Linux distribution. By following the steps mentioned in the article, you can easily install Nmap on Ubuntu and start exploring and auditing your network. If you want to have a better understanding of your network infrastructure and want to improve network security then explore Nmap. Nmap can be used for both legitimate network administration and ethical hacking.
Leave a Reply