Why is ncat not found on Git Bash?

mrj picture mrj · Oct 1, 2017 · Viewed 7.7k times · Source
user_1 (master *) 1_EchoServer $ python -m http.server 8000

Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
127.0.0.1 - - [30/Sep/2017 18:57:11] "GET / HTTP/1.1" 200 -

Set up a simple server. I want to connect to it with ncat to learn HTTP.

I install ncat (pip install nmap):

    user_1 Documents $ pip install nmap
    Requirement already satisfied: nmap in c:\python36\lib\site-packages

Then, when I try and connect, cmd not found. It was working earlier. Not sure how I broke it.

user_1 Documents $ pip install nmap
Requirement already satisfied: nmap in c:\python36\lib\site-packages
user_1 Documents $ ncat -l 9999
bash: ncat: command not found

I am using git bash on windows, and I have set up python36 on c drive and changed env variables and path accordingly.

Answer

Aya Muhammad picture Aya Muhammad · Feb 9, 2019

I have been in this problem today and I solved it. the Nmap command must be in the $PATH environment variable for the discovery service account. To do this on windows do the following steps

  1. Click Start > Control Panel > System
  2. Click the Advanced tab, and select Environment Variables.
  3. Edit the Path system variable and add the directory where Nmap is installed.
  4. Restart the computer.

If you do this task, Nmap should be available to services on the computer and the command will be found in the terminal