Compiling nmap from source code and creating a .deb package
From Cryptolife
This tutorial describe howto compile from the source code the Nmap and build a .deb package . (updated to Nmap 5.20)
A few words aboutNmap. Originally written by Fyodor Vaskovich (the pseudonim of Gordon Lyon). Nmap is used to discover computers and services with the capacity to detect passive services on the network , many details can be retrieved from a Nmap scan, operating system, device type, uptime, software product used to run a service, exact version number of that product, presence of some firewall .
Tested on Ubuntu 9.10 (all the flavors), Debian 5.0 (Lenny), Backtrack4 (pre fina
apt-get install build-essential checkinstall
Get the latest Nmap source code
wget http://nmap.org/dist/nmap-5.20.tar.bz2
Decompress with :
bzip2 -cd nmap-5.20.tar.bz2 | tar xvf -
cd nmap-5.20
./configure && make
run
checkinstall
Enter a number to change any of them or press ENTER to continue: 0 Enter the maintainer's name and e-mail address: >> pbailey@cryptolife.org This package will be built according to these values: 0 - Maintainer: [ pbailey@cryptolife.org ] 1 - Summary: [ Package created with checkinstall 1.6.1 ] 2 - Name: [ nmap ] 3 - Version: [ 4.85BETA9 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ i386 ] 8 - Source location: [ nmap-5.20 ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ nmap ] Enter a number to change any of them or press ENTER to continue:
**********************************************************************
Done. The new package has been installed and saved to
/tmp/nmap-5.20/nmap_5.20-1_i386.deb
You can remove it from your system anytime using:
dpkg -r nmap
**********************************************************************
install nmap with:
dpkg -i nmap_5.20-1_i386.deb
check the Nmap version installed
nmap -V Nmap version 5.20 ( http://nmap.org )
Testing Nmap
nmap -sS host_to_scan Interesting ports on host_to_scan (xxx.xxx.xxx.xxx): Not shown: 985 closed ports PORT STATE SERVICE 21/tcp open ftp 22/tcp open ssh 25/tcp open smtp 53/tcp open domain 80/tcp open http 106/tcp open pop3pw 110/tcp open pop3 111/tcp open rpcbind 143/tcp open imap 443/tcp open https 587/tcp open submission 993/tcp open imaps 995/tcp open pop3s 3306/tcp open mysql 8080/tcp open http-proxy Nmap done: 1 IP address (1 host up) scanned in 51.66 seconds
comments and feedback are welcome @

