NMAP + NCAT + ZENMAP on Ubuntu 20.04 and Kali Linux

Install nmap + ncat + zenmap from source on Ubuntu 20.04

We are going to install it form the subversion source code, so we need that package in order to download it from there:

sudo apt install subversion gdebi libssh2-1-dev

The first attempt to compile gave me errors. This library was missing: libssh2-1-dev. So, I had to install it. You will also need to have make and gcc compilers. I have them already as many other tools and libraries so far from the UbuntumaticS script, which is a result of what I have found to need may times in the past.

I like using gdebi to install deb packages because it solves any dependencies. Some others will prefer to do:

sudo dpkg -i packet.deb
sudo apt install -f

…instead. However, you won’t need to do the above if you just copy/paste the following code to write your own installation script:

#!/bin/bash
#Check if the following packages are installed. If not, install them:
	for i in {subversion,gdebi,libssh2-1-dev}
	do
		! [ -x "`which $i 2>/dev/null`" ] && PACKAGE=$PACKAGE"$i "
	done
sudo apt install $PACKAGE -y
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/p/pygtk/python-gtk2_2.24.0-5.1ubuntu2_amd64.deb
sudo gdebi -n python-gtk2_2.24.0-5.1ubuntu2_amd64.deb
#you can do: sudo dpkg -i python-gtk2_2.24.0-5.1ubuntu2_amd64.deb instead.
#We need to work on a directory and path with names with no spaces in between
cd $HOME
svn co https://svn.nmap.org/nmap
cd nmap
./configure
make "LUA_LIBS=../liblua/liblua.a -ldl -lm"
sudo make install
cd ..
sudo rm -fr nmap
sudo zenmap

you can call it nmap_src_install.sh, for example, and give it execution permissions:

chmod +x nmap_src_install.sh

And finally run it:

sudo ./nmap_src_install.sh

This example is included in the UbuntumaticS-20.04.sh installation script.

Install nmap + ncat + zenmap from source on Kali Linux 2021-2

The Script:

#------------------- NMAP + NCAT + ZENMAP from source -------------------
#!/bin/bash
cd $HOME
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/p/pygtk/python-gtk2_2.24.0-5.1ubuntu2_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/p/pycairo/python-cairo_1.16.2-2ubuntu2_amd64.deb
wget -c http://archive.ubuntu.com/ubuntu/pool/universe/p/pygobject-2/python-gobject-2_2.28.6-14ubuntu1_amd64.deb

sudo apt update
sudo apt upgrade -y
sudo apt full-upgrade -y
sudo apt install -y libssh2-1-dev autoconf
sudo dpkg -i python-cairo_1.16.2-2ubuntu2_amd64.deb python-gobject-2_2.28.6-14ubuntu1_amd64.deb python-gtk2_2.24.0-5.1ubuntu2_amd64.deb
svn co https://svn.nmap.org/nmap
cd nmap
./configure
make "LUA_LIBS=../liblua/liblua.a -ldl -lm"
sudo make install
cd ..
sudo rm -fr nmap
sudo zenmap

Leave a comment