Left Menu





Howto compile and use NMAP (Network Mapper) for first time

Nmap ("Network Mapper") is a free and open source (license) utility for network exploration or security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. It was designed to rapidly scan large networks, but works fine against single hosts. Nmap runs on all major computer operating systems, and official binary packages are avalable for Linux, Windows, and Mac OS X. In addition to the classic command-line Nmap executable, the Nmap suite includes an advanced GUI and results viewer (Zenmap), a flexible data transfer, redirection, and debugging tool (Ncat), and a utility for comparing scan results (Ndiff).

In this "howto" we will show you how to compile and use this powerful TPC/UDP Port scanner. If you do NOT know what TCP/UDP protocols are refer to our Protocols page.
Let's compile nmap and do some easy scans

NOTE: There is 99% chance that nmap is in the official three of you distribution so :
Ubuntu/Debian : apt-get install <package>
Gentoo : emerge <package>
Sabayon : equo install <package>
ArchLinux : pacman <package>
and so on ... it depends on the distribution
If not follow this easy steps:

1. Download
~ $ wget http://nmap.org/dist/nmap-5.00.tar.bz2
At this time this is the latest stable version, if you want to check for a leter version check HERE.

2. Extract the tarball
~ $ tar vxf nmap-5.00.tar.bz2

3. Enter (use "cd") the direcotry.
~ $ cd nmap-5.00

4. Configure and compile
 ~/nmap-5.00 $ ./configure --prefix=/usr/sbin
The --prefix options specify where you want it compiled

~/nmap-5.00 $ make && sudo make install
For the second command you will need the current users password

5. Start nmap
~/nmap-5.00 $ nmap -v -A scanme.nmap.org
This will simply scan the test domain with OS detection


Using NMAP:
NOTE: To get full advantage of nmap you will need to perform the scannings as SuperUser a.k.a root.

The simpliest TPC SYN  port scan:

# nmap -sS scanme.nmap.org

 
Also you can save the output to a file :
#nmap -sS scanme.nmap.org -oN outfile
you can use -oM and -oX (for XML format)


Unfortunately ident scanning is no longer supported

Another useful options is -O , os detection, this output will show you all the services running on a particular host and the ports that thay are using.


Another useful and very simple scan is with -v -A options :

If the host is blocking the scan you can use -PN options ... This will treat all host as up, it will skip host discovery.

Of course there are many many other options on using nmap, we just showed you the basics.

If you have any questions refer to our FORUM



|Home | LinuXchange| Updates | Contact Us | About The Project | Unique Visitors| Sponsorship|