Precompiled packages always take time to prepare and test, causing delays between releases. If you want to stay up-to-date with the latest additions, compiling Nmap's source code is highly recommended.
This recipe describes how to compile Nmap's source code in the Unix environment.
Make sure the following packages are installed in your system:
gcc
openssl
make
Install the missing software using your favorite package manager or build it from source code. Instructions to build these packages from source code are out of the scope of this book but are available online.
$ ./configure
An ASCII dragon warning you about the power of Nmap will be displayed (as shown in the following screenshot) if successful, otherwise lines specifying an error will be displayed.
$ make
If you don't see any errors, you have built the latest version of Nmap successfully. You can check this by looking for the compiled binary Nmap
in your current directory.
If you want to make Nmap available for all the users in the system, enter the following command:
# make install
We used the script configure
to set up the different parameters and environmental variables affecting your system and desired configuration. Afterwards, GNUs make
generated the binary files by compiling the source code.
If you only need the Nmap binary, you can use the following configure directives to avoid installing Ndiff, Nping, and Zenmap:
--without-ndiff
--without-zenmap
--without-nping
OpenSSL is optional when building Nmap. Enabling it allows Nmap to access the functions of this library related to multiprecision integers, hashing, and encoding/decoding for service detection and Nmap NSE scripts.
The name of the OpenSSL development package in Debian systems is libssl-dev
.
There are several configure directives that can be used when building Nmap. For a complete list of directives, use the following command:
$ ./configure --help
There are several precompiled packages available online (http://nmap.org/download.html) for those who don't have access to a compiler, but unfortunately, it's very likely you will be missing features unless its a very recent build. Nmap is continuously evolving. If you are serious about harnessing the power of Nmap, keep your local copy up-to-date with the official repository.
3.146.176.88