How to install Nmap on Debian 9.0

To install Nmap on Debian 9.0

Nmap tool allows the users and system administrators to scan the large networks. It provides information to determine the hosts are up or not. It supports a large number of scanning techniques including UDP, TCP, TCP SYC, ICMP, IP protocol and null scan. This tutorial covers the installation procedure of Nmap on Debian 9.0.

Installation procedure

Before starting the installation, add the repo by using nano command to open the sources.list configuration file. Add the following lines at end of the file and save it.

root@debian:~# nano /etc/apt/sources.list

deb http://deb.debian.org/debian-security stable/updates main
deb-src http://deb.debian.org/debian-security stable/updates main

deb http://ftp.debian.org/debian stretch-backports main
deb-src http://ftp.debian.org/debian stretch-backports main

Once the repositories are added to the system. Update the apt sources.list file in your system.

root@linuxhelppp:~# apt-get update
Get:1 http://ftp.debian.org/debian stretch-backports InRelease [91.8 kB]
Ign:2 http://deb.debian.org/debian stable InRelease      
Hit:3 http://deb.debian.org/debian stable-updates InRelease
Get:4 http://deb.debian.org/debian-security stable/updates InRelease [62.9 kB]
Get:5 http://ftp.debian.org/debian stretch-backports/main Sources [86.6 kB]
Hit:6 http://deb.debian.org/debian stable Release                                  
Get:8 http://ftp.debian.org/debian stretch-backports/main amd64 Packages [136 kB]
Get:9 http://deb.debian.org/debian-security stable/updates/main Sources [63.8 kB]
Get:10 http://ftp.debian.org/debian stretch-backports/main Translation-en [71.9 kB]
Get:11 http://deb.debian.org/debian-security stable/updates/main amd64 Packages [163 kB]
Get:12 http://deb.debian.org/debian-security stable/updates/main Translation-en [75.0 kB]
Fetched 751 kB in 3s (190 kB/s)            
Reading package lists... Done

The target system is updated with the required repositories. Next install the nmap package by executing the following command.

root@linuxhelppp:~# apt-get install nmap
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  liblinear3 ndiff python-bs4 python-html5lib python-lxml python-webencodings
Suggested packages:
  liblinear-tools liblinear-dev python-genshi python-lxml-dbg python-lxml-doc
The following NEW packages will be installed:
  liblinear3 ndiff nmap python-bs4 python-html5lib python-lxml python-webencodings
0 upgraded, 7 newly installed, 0 to remove and 33 not upgraded.
Need to get 6,590 kB of archives.
After this operation, 27.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
.
.

Setting up python-html5lib (0.999999999-1) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...

Now the Nmap package is installed. To verify the version of Nmap, run the following command.

root@linuxhelppp:~# nmap --version

Nmap version 7.40 ( https://nmap.org )
Platform: x86_64-pc-linux-gnu
Compiled with: liblua-5.3.3 openssl-1.1.0c libpcre-8.39 libpcap-1.8.1 nmap-libdnet-1.12 ipv6
Compiled without:
Available nsock engines: epoll poll select

The installation procedure of Nmap is done successfully.

Tag : debian nmap
FAQ
Q
where to Enabling OS Detection with Nmap in linux?
A
you can execute the following command to Enabling OS Detection with Nmap in linux

# nmap -O 192.168.7.7
Q
how to Scan OS information and Traceroute in linux?
A
by using the following command to Scan OS information and Traceroute

# nmap -A 192.168.7.7
Q
how to install nmap package for fedora?
A
use the following command to install nmap

# dnf install nmap
Q
How to scan subnet or Iprange in linux?
A
execute the below command to see iprage

# nmap 192.168.1.5
Q
I don't want full ips in a subnet to be scanned some to be avoided?
A
Use exclude option for it (for example nmap 192.168.7.* --exclude 192.168.7.11)