我正在尝试对网络扫描仪进行编码,并且一旦我尝试打印响应,它就不会显示任何内容。
import scapy.all as scapy
def scan(ip):
packet1 = scapy.ARP(pdst=ip)
etherpacket = scapy.Ether(dst = 'ff:ff:ff:ff:ff:ff')
broadcast_packet = etherpacket/packet1
ans, unans = scapy.srp(broadcast_packet, timeout=10)
print(ans.summary())
scan("192.168.1.1-254")
下面是结果。
$sudo python3 networkscanner.py
Begin emission:
........Finished sending 1 packets.
..........
Received 18 packets, got 0 answers, remaining 1 packets
None