Install nmap 5.0 in Ubuntu

Thursday, July 23, 2009

Insecure.org has released the latest version of nmap which brings this handy tool to version 5. They are reporting this is the biggest release since 1997 so I am sure you want to get your hands on it. Installing nmap 5 on Windows or Mac is fairly straight forward and well documented on their download page. However Ubuntu users cannot install nmap 5 the usual way they install software (apt-get install nmap) as it will install version 4.6 This means you must install from source (yes I know this sounds scary but it's simple and about time you learn to do this!) so read on.

First, if you currently have a past release of nmap installed you should uninstall it now by typing this at the terminal:
sudo apt-get remove nmap

Dependencies
If you have a standard Ubuntu install and have never installed a program from source (probably why you are here) you will need to install some packages first. The two packages I had to install on a fresh Ubuntu were g++ and libssl. g++ is a C compiler and what will allow you to compile the code from source and libssl is for some of nmap's new features to run without issues. Here is how to install these packages:
sudo apt-get install g++
sudo apt-get install libssl0.9.8

Compiling nmap
Obtain the nmap source from the insecure website and follow the instructions on the nmap download page:
wget http://nmap.org/dist/nmap-5.00.tar.bz2
bzip2 -cd nmap-5.00.tar.bz2 | tar xvf -
cd nmap-5.00
./configure
make
sudo make install

Verify
To verify you have the correct version installed:
nmap -v
ncat -v

Conclusion
And there you have it, you have compiled your first program in Ubuntu from source. The problem I have seen most people have other than using linux and never getting past the apt-get install stage is the need for the g++ package. This is most likely why you always get a C compiler error when trying to compile. I hope this has been useful.

Till next time,
Jorge Orchilles

Comments

One response to “Install nmap 5.0 in Ubuntu”
Post a Comment | Post Comments (Atom)

Anonymous said...

After doing this, how can I uninstall it if I don't want it anymore?

September 13, 2009 at 11:04 AM