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安装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变量和路径。
我今天遇到了这个问题,我已经解决了。Nmap命令必须位于发现服务帐户的$ PATH环境变量中。要在Windows上执行此操作,请执行以下步骤
- 单击开始>控制面板>系统
- 单击高级选项卡,然后选择环境变量。
- 编辑Path系统变量并添加Nmap的安装目录。
- 重新启动计算机。
如果执行此任务,则计算机上的服务应该可以使用Nmap,并且在终端中将找到该命令
与pip install nmap
一起安装的Python“ nmap”软件包只是一个输出解析库。它不包含Nmap二进制文件。适用于Linux的Windows子系统(Windows上为Bash,Windows上为Ubuntu)的“ nmap”软件包当前无法正常工作,不受支持。
在Windows上,以即用型格式(二进制可执行文件)获取Nmap(和Ncat)的唯一位置是directly from nmap.org。