Windows 10 机器上的 python2 scapy 出现未知的 pypcap 网络接口“eth0"错误 [英] Unknown pypcap network interface 'eth0' error with python2 scapy on windows 10 machine
问题描述
我正在尝试在 Windows 10 机器上使用 scapy(2.4.3)、python 2.7 创建一个简单的 Web 监控应用程序.我也安装了 winpcap(5.0.9983.830).
I am trying to create a simple web monitoring app with scapy(2.4.3), python 2.7 on a windows 10 machine. I also have winpcap(5.0.9983.830) installed.
这是我要运行的代码:
def http_header(packet):
print packet
sniff(iface='eth0', prn=http_header)
这是它抛出的错误:
raise ValueError("Unknown pypcap network interface %r" % pcap_name)
ValueError: Unknown pypcap network interface 'eth0'
我还安装了 .Microsoft Visual C++ Compiler for Python 2.7 只是为了安全,正如其他解决方案指出的那样,但没有成功.还尝试重新安装 scapy、winpcap 并重新创建虚拟环境,但还是没有运气.
I also installed .Microsoft Visual C++ Compiler for Python 2.7 just to be safe, as other solutions pointed out, but had no success. Also tried re-installing scapy, winpcap and recreating the Virtual Environment, but again had no luck.
推荐答案
如果您使用的是 Windows,则您的界面不称为 eth0
.
Your interface is not called eth0
if you are using Windows.
您可以使用ipconfig/all
来查看您所有的网络接口,并且您可以使用以太网接口的description
值作为Scapy 的接口名称.例如,在我的笔记本电脑中,它是:
You can use ipconfig /all
to see all your network interfaces, and you can use the description
value of the Ethernet interface as the interface name for Scapy.
So for example in my laptop it is:
IFACE_NAME="Intel(R) Ethernet Connection (2) I219-LM"
sniff(iface=IFACE_NAME, prn=http_header)
这篇关于Windows 10 机器上的 python2 scapy 出现未知的 pypcap 网络接口“eth0"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!