【问题标题】:Why is ncat not found on Git Bash?为什么在 Git Bash 上找不到 ncat?
【发布时间】:2018-03-12 11:57:56
【问题描述】:
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 -

设置一个简单的服务器。我想用 ncat 连接它来学习 HTTP。

我安装ncat(pip install nmap):

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

然后,当我尝试连接时,找不到 cmd。它早些时候工作。不知道我是怎么弄坏的。

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

我在 Windows 上使用 git bash,我已经在 c 驱动器上设置了 python36 并相应地更改了 env 变量和路径。

【问题讨论】:

    标签: http nmap


    【解决方案1】:

    您使用pip install nmap 安装的Python“nmap”包只是一个输出解析库。它不包括 Nmap 二进制文件。适用于 Linux 的 Windows 子系统(也称为 Windows 上的 Bash,也称为 Windows 上的 Ubuntu)中可用的“nmap”包目前无法正常工作且不受支持。

    在 Windows 上以即用型格式(二进制可执行文件)获取 Nmap(和 Ncat)的唯一位置是 directly from nmap.org

    【讨论】:

      【解决方案2】:

      我今天遇到了这个问题,我解决了。 Nmap 命令必须位于发现服务帐户的 $PATH 环境变量中。要在 Windows 上执行此操作,请执行以下步骤

      1. 单击开始 > 控制面板 > 系统
      2. 单击“高级”选项卡,然后选择“环境变量”。
      3. 编辑Path系统变量,添加安装Nmap的目录。
      4. 重新启动计算机。

      如果您执行此任务,计算机上的服务应该可以使用 Nmap,并且 该命令将在终端中找到

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-02-11
        • 2016-08-16
        • 2016-06-25
        • 2020-08-11
        • 2015-11-28
        • 2017-11-19
        • 1970-01-01
        • 2012-12-23
        相关资源
        最近更新 更多