Nmap on Cygwin

Installed nmap on cygwin. Dead easy!

  1. Download and install Cygwin
  2. Download and install WinPCAP
  3. Accept most defaults
  4. Do the default installation, typically C:\cygwin\
  5. Download nmap for windows (zip)
  6. Open the zip file
  7. Double click the folder inside the zip, a large list of files should appear
  8. Extract these files (and not the folder which contains them) to C:\cygwin\usr\local\bin
  9. Open cygwin
  10. Type
    • nmap --version
  11. Your nmap installation on cygwin is now complete

Update 3/May/2012: Try running the vcredist_x86.exe file found in the zip archive if nmap doesn’t seem to run.

For a general understanding of nmap, just type nmap. For a more detailed comprehension, read the manual, and search the web.

12 thoughts on “Nmap on Cygwin

  1. Rather than copying the contents of the cygwin zip file into /usr/local/bin, you should copy them to /usr/local/bin/nmap, and then add that directory to your PATH environment variable. That will keep your /usr/local/bin directory clean.

    Aside from that minor point, thanks for the tip — just what I needed.

  2. I followed your instructions however I can’t seem to get nmap to work properly.

    I installed the latest WinPCAP – version 4.1.2 – it installs via an installer, only option is whether you want the driver to start at boot time – default is that option checked – which is what I did.

    I extracted the contents of the nmap 5.51 zip file into /usr/local/bin (i.e. /usr/local/bin/nmap-5.51)

    I have added the following to my .bashrc file:


    When I run “nmap –version” at the cygwin command line in a new terminal window – nothing happens – simply it returns a new prompt.

    Any ideas what could be going on?

    Thank you!

  3. What do you see when you type “which nmap”? What do you see when you type “ls -l /usr/loca/bin/nmap-5.51”? What if you go to “cd /usr/loca/bin/nmap-5.51” then run nmap like “./nmap”?

  4. Ok I figured it out – with the new nmap zip it comes with installers for both winpcap and Microsoft Visual C++ Redistributable Package (see the nmap page for more info).

    If you followed the above instructions and get stuck – run the vcredist_x86.exe file inside your nmap directory, e.g.:


    I was able to successfully run nmap –version after that.

    Thanks again!

  5. I like to put the applications directory e.g. nmap in the bin directory /usr/local/bin/nmap-6.25

    I then create a symbolic link to the nmap executable:

    ln -s nmap /usr/local/bin/nmap-6.25/nmap.exe

    I choose this method to not have to add an application directory to my path every time.

  6. FYI, I think you can just use the Windows self-installer. It comes with everything (including the graphical interface), and since it’s added to the Path variable, it will also be available from the Cygwin commandline regardless.

  7. Very helpful tips. Thank you. This is how I “installed”. This method does not require path changes.
    1. Download zip copy to /usr/local/bin/nmap
    2. cd /usr/local/bin/nmap
    3. unzip downloaded_file.zip
    4. ln -s nmap-*/nmap.exe .
    5. ln -s /usr/local/bin/nmap/nmap.exe /bin/.
    nmap –help

Leave a Reply

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