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 Replies to “Nmap on Cygwin”

  1. PaulAugust 19, 2011 at 3:07 am

    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. Felipe AlvarezAugust 28, 2011 at 12:49 pm

    @Paul. Thanks for the tip to keep /usr/local/bin cleaner. Thanks for visiting my site and I hope you visit again soon.

  3. CMRApril 10, 2012 at 11:12 pm

    Thanks Felipe, very helpful. +1 (if you were on facebook/google+)

  4. RobMay 3, 2012 at 1:41 pm

    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:

    PATH=".:/usr/loca/bin/nmap-5.51:$PATH"

    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!

  5. felipeMay 3, 2012 at 1:47 pm

    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”?

  6. RobMay 3, 2012 at 1:50 pm

    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.:

    /usr/local/bin/nmap/vcredist_x86.exe

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

    Thanks again!

  7. felipeMay 3, 2012 at 1:57 pm

    Added your tip to the instructions. Thanks.

  8. PedroNovember 8, 2012 at 1:25 am

    Nice post, that works fine!!

  9. Harvey BlueDecember 8, 2012 at 8:32 pm

    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.

  10. AntonFebruary 12, 2013 at 5:02 am

    works just great, tnx!!

  11. Stephen DeweyJune 13, 2013 at 9:52 am

    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.

  12. RApril 8, 2015 at 3:55 pm

    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/.
    Test
    nmap –help

Leave a Comment