我的代码应该发送数据包并返回mac地址,但我遇到了一些错误, 守则:
def scan(ip):
arp_request = scapy.ARP(pdst=ip)
broadcast = scapy.Ether(dst="ff:ff:ff:ff:ff:ff")
arp_request_broadcast = broadcast/arp_request
print(arp_request_broadcast.summary())
scan("10.0.2.1/24")
错误是:
Ether / ARP who has ?? says ??
传递给层ARP的值很好。 但是您的代码没有向网络发送/接收任何数据包
让我们修复您的代码:
在我的网络中为我提供:
请注意,您需要在sudo中运行该代码,因为它需要对网络进行读/写操作
您可以在这里看到完整的解决方案:https://www.thepythoncode.com/article/building-network-scanner-using-scapy
相关问题 更多 >
编程相关推荐