How To Install Nmap From Source

How to Install Nmap From Source

How To Install Nmap

Nmap is a network mapping tool used during the Information Gathering phase of a network penetration testing engagement. It is completely free and open source. Click on the following link for more information about the Nmap Project. In this step-by-step tutorial you will learn how to install Nmap from source on an Ubuntu Linux machine.

Most modern Linux distributions come with a pre-packaged version of Nmap that can be installed with a simple command. However, we recommend compiling from source for two main reasons. The first reason is that it ensures the latest available release is being used. The second (and probably the most important) is the amount of NSE Scripts (which are extremely useful!) is constantly growing so keeping up to date with the bleeding edge version of Nmap is critical.

Install Nmap Dependencies: How To Install Nmap

First you will need to obtain the necessary dependencies in order for Nmap to install successfully.

$ sudo apt-get install git wget build-essential checkinstall libpcre3-dev libssl-dev libpcap-dev

Clone The Git Repository: How To Install Nmap

Next you’ll want to check out the source repository from the Nmap Github page in order to install nmap from the latest available version.

$ git clone https://github.com/nmap/nmap.git

Configure Nmap Installation: How To Install Nmap

Next run the configuration script. If you see any errors or warnings make sure you go back and install the necessary libraries from Step 1.

$ ./configure

Compile The Build Files: How To Install Nmap

Next run make and then make install to compile and install nmap on your system.

$ make && make install

Verify Your Installation: How To Install Nmap

When you are all done you should be able to run nmap with the “-V” option to see that you are running the latest version from source. At the time this article was published the command output would have looked like this. Thats all there is to it, now you know how to install nmap from source. If you have any questions leave a comment below.

$ nmap -V

Nmap version 7.25SVN ( https://nmap.org )
Platform: x86_64-unknown-linux-gnu
Compiled with: nmap-liblua-5.3.3 openssl-1.0.1f libpcre-8.31 nmap-libpcap-1.7.3 nmap-libdnet-1.12 ipv6
Compiled without:
Available nsock engines: epoll poll select


Share this article

Facebooktwittergoogle_plusredditpinterestlinkedinmailFacebooktwittergoogle_plusredditpinterestlinkedinmail
4 Comments
  • Hi Royce,

    $ make && make install

    gives me the following error”static assertion failed: comparison object must be invocable as const”

    Any idea what the problem here is?

    Thanks!

  • sudo apt-get install libpcap-dev

    You forgot about libpcap!

  • Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Share This

    Recent Posts

    Subscribe To Our Mailing List

    The Ultimate Burp Suite Training Program

    Learn Network Penetration Testing

    Penetration Testing

    Categories

    Metasploit

    Web Application Hacking


    Copyright 2024

    css.php

    Are You Using the Top 5 Pentest Tools?

    Enter your email address to download your copy of our FREE e-book and find out now!

    Thank you, now go check your email!!