In this tutorial, we will show you how to install Nmap on Debian 11. For those of you who didn’t know, Network Mapper (Nmap) is a free, open-source network security scanning tool. Nmap works by sending data packets on a specific target (by IP) and the incoming packets will be interpreted to determine what ports are open/closed, what services are running on the scanned system, whether firewalls or filters are set up and enabled, and finally what operating system is running.
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 installation of the Nmap network discovery and security auditing on a Debian 11 (Bullseye).
Prerequisites
- A server running one of the following operating systems: Debian 11 (Bullseye).
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Nmap on Debian 11 Bullseye
Step 1. Before we install any software, it’s important to make sure your system is up to date by running the following apt
commands in the terminal:
sudo apt update sudo apt upgrade
Step 2. Installing Nmap on Debian 11.
By default, Nmap is available on Debian 11 base repository. Now install Nmap to your Debian system using the following command below:
sudo apt install nmap
Verify Nmap installation:
nmap --version
Step 3. Use NMAP Security Scanner.
Once you complete the installation process, run the command “nmap
” on a terminal. 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 target-domain.com
Instead of scanning individual IPs, scan a whole IP range by defining it in your command line:
sudo nmap 192.168.88.2-222
The following command scans the entire specified subnet:
sudo nmap 192.168.88.0/24
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 192.168.88.21
This command scans ports 80 and 443 for the defined host.
TCP SYN scan
sudo nmap -sS 192.168.88.21
Congratulations! You have successfully installed Nmap. Thanks for using this tutorial for installing the latest version of Nmap network discovery and security auditing on Debian 11 Bullseye. For additional help or useful information, we recommend you check the official Nmap website.