Skip to content

Testing pull requests by TomSellers

Paulino Calderon edited this page Oct 8, 2017 · 2 revisions

If you are looking to build Nmap from GitHub and/or test pull requests you can use the instructions below. Note that they are not tailored towards those who will be modifying the code or creating pull requests themselves.

Note: The Nmap GitHub repository is a mirror of the official Nmap Subversion repository which is considered the 'source of truth' for the Nmap codebase.

Getting the code

  1. Clone the official repository

git clone [email protected]:nmap/nmap.git

  1. Change to the nmap directory

cd nmap

  1. Configure git to pull down PR information when you fetch a branch listing for the Nmap repo by adding the following line to the 'remote "origin"' section of .git/config:

fetch = +refs/pull//head:refs/remotes/origin/pr/

It should look something like this:

[remote "origin"] url = [email protected]:nmap/nmap.git fetch = +refs/heads/:refs/remotes/origin/ fetch = +refs/pull//head:refs/remotes/origin/pr/

  1. Update your branch listing

git fetch --all

  1. Check out the pull request you are interested in: git checkout origin/pr/<PR_number> git checkout origin/pr/977

Building the code

  1. Install any build dependencies. On Ubuntu I use the following:

sudo apt-get install build-essential autoconf libssl-dev

  1. To build nmap make sure you are in the top level nmap source directory and run the following:

./configure --without-zenmap make clean sudo make install

  1. As a matter of precaution I generally insruct Nmap to rebuild the script database after a fresh build/installation.

sudo nmap --script-updatedb

As a general reference for building Nmap from the official Subversion repository I created instructions at the link below. This page includes a variation of the script that I use to enure I have a clean environment as well as to copy any custom scripts that I might be working on.

https://github.com/TomSellers/Fathom/wiki/Installing-Nmap

Clone this wiki locally