如何修复 OSError: b'打开适配器时出错:找不到指定的设备。 (20)'

发布于 2025-01-11 19:00:56 字数 571 浏览 2 评论 0原文

我试图运行这个简单的 python 代码只是为了开始学习嗅探器的工作原理,但我得到这个持续的错误:

OSError: b'Error opening adapter: 找不到指定的设备。 (20)'

请注意,“找不到指定的设备”是我的语言,我翻译成英语,所以可能有点不同。我尝试运行的代码是:

import scapy.all as scapy

def process_packet(packet):
    print(packet)

def sniffing(interface):
    scapy.sniff(iface=interface, store=False, prn=process_packet)


sniffing('Wi-Fi')

我观看的视频在这里: https://www.youtube.com/watch?v=rI0rTpH0f1o

感谢您的支持你的时间。如果您需要原始错误(用我的语言),请发表评论,我会写它。

i'm trying to run this simple python code just to start learning how a sniffer works, but i get this constant error:

OSError: b'Error opening adapter: Cannot find specified device. (20)'

Please note that the "Cannot find specified device" was in my language, and i translated in english, so it might be a little bit different. The code that i'm trying to run is:

import scapy.all as scapy

def process_packet(packet):
    print(packet)

def sniffing(interface):
    scapy.sniff(iface=interface, store=False, prn=process_packet)


sniffing('Wi-Fi')

The video i watched is here:
https://www.youtube.com/watch?v=rI0rTpH0f1o

Thank you for your time. If you need the original error (in my language) please post a comment and i'll write it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

隔纱相望 2025-01-18 19:00:56

感谢丹尼尔·库尔曼提供答案。对于遇到相同问题的其他用户,将 sniffing('Wi-Fi') 替换为 sniffing(None) 解决了该问题。

请注意:Windows 10 上已修复问题

Thanks to dianiel kullmann for providing an answer. To other users having the same issue, replacing sniffing('Wi-Fi') with sniffing(None) solved the issue.

Please note: issue fixed on windows 10

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文