当 IP 用作 ARP 数据包中的范围时,Scapy 不工作

Scapy is not working when IP is used as range in the ARP packet

Python版本:3.8.1

Scapy 版本:2.4.3

在哪里工作?

使用单个 IP 地址工作正常。

哪里不工作?

在构造函数中传递 IP 范围时,它从未起作用。

但是当我们分配 IP 范围时,它有时会起作用。

尝试过的方法?

在脚本中尝试过,比如

from scapy.all import ARP
arp_request = ARP()
arp_request.pdst = ip
print(arp_request.summary())

使用 scapy 在终端中尝试,其屏幕截图附在上面

我知道这个问题已经在

上被问过了

Scapy ARP function not giving proper output when running it

但它没有答案。

编辑: 我尝试在网络中存在的其中一台设备上使用 Wireshark 分析主设备发送的数据包。

我发现尽管显示范围为 ??,有时 ARP 请求会覆盖整个范围 0-256 并且程序会成功停止。 但有时它会停在 192.168.43.170 并继续发送对 192.168.43.1 的请求。这也会阻止互联网。

我不知道为什么在 192.168.43.170,因为我的网关在 192.168.43.1,设备在 192.168.43.98 和 192.168.43.198

Wireshark 输出

这是 scapy 中的一个错误

错误:

https://github.com/secdev/scapy/issues/2400

最近修复了

修复:

https://github.com/secdev/scapy/pull/2395

最新代码。

https://github.com/secdev/scapy