How to install and run the Nmap program through Cygwin in Windows?

Adam Dewhurst picture Adam Dewhurst · Feb 26, 2016 · Viewed 14k times · Source

I'm trying to get Cygwin to show what ports my laptop has open but when I try to run it, it says the command isn't found.

This is the command I'm trying: nmap -v -A <<IP address>>

Answer

Steve Chambers picture Steve Chambers · Feb 27, 2018

This blog post has some useful info about how to get this working. Have copied it below in case it ever goes away:

  1. Download nmap
  2. Install nmap “self-installer” .exe and install Npcap when asked by the Nmap installer.
  3. Cygwin: add to ~/.bash_profile:

    alias nmap="/cygdrive/c/Program\ Files\ \(x86\)/Nmap/nmap.exe"

    Note the \ and \( are vital for Cygwin shell to interpret the command correctly

  4. Open a new Cygwin window to start using nmap