小编Rak*_*lah的帖子

scapy 没有发送数据包

我尝试创建 scapy 工具来测试嗅探,这是我的代码:

def scan(ip):
    arp_req = sc.ARP(pdst=ip)
    bc = sc.Ether(dst="ff:ff:ff:ff:ff:ff")
    arp_req_bc = bc/arp_req
    answer = sc.srp(arp_req_bc, timeout=1, verbose=True)[0]
    print("IP\t\t\tMAC Address\n-----------------------")
    for element in answer:
        print(element[1].psrc + "\t\t" + element[1].hwsrc)

scan("192.168.43.1/24")
Run Code Online (Sandbox Code Playgroud)

输出是:

    "Sniffing and sending packets is not available at layer 2: "
RuntimeError: Sniffing and sending packets is not available at layer 2: winpcap is not installed. You may use conf.L3socket orconf.L3socket6 to access layer 3
Run Code Online (Sandbox Code Playgroud)

python scapy python-3.x

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

python ×1

python-3.x ×1

scapy ×1