Building Nmap from source

To install Nmap from source, three steps must be taken:

  1. Download the source code.
  2. Compile the code.
  3. Install the compiled tool.

Downloading the code with a tool such as wget is very simple; all we need to do is type wget http://nmap.org/dist/nmap-6.47.tar.bz2 (or whatever is the current version of Nmap).

Once the tool is downloaded, it must be removed from its tarball—or compressed—state. This is done using the tar command by typing tar xvf nmap-6.47.tar.bz2.

At this stage, we now have a new directory filled with Nmap source code. If we change the directory by typing cd nmap-6.47, we are then able to compile this code. For those users that are familiar with installing tools on Linux, the next step will be familiar. We need to ...

Get Nmap Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.