简体   繁体   中英

Scapy not picking up a single ARP request

I have the following running (finally after installing libnet etc) on my Mac trying to listen for a Dash button's MAC address:

from scapy.all import *

def arp_display(pkt):
  if pkt[ARP].op == 1: #who-has (request)
    if pkt[ARP].psrc == '0.0.0.0': # ARP Probe
      print ("ARP Probe from: " + pkt[ARP].hwsrc)

print (sniff(prn=arp_display, filter="arp", store=0, count=300))

However, this just runs indefinitely and nothing is picked up even after numerous presses on the Dash and many other devices connecting and disconnecting.

I tried the following too

from scapy.all import *

print (sniff(filter="arp",count=10).summary())

Which also yields no results. Nothing I find online tells me what might be causing this.

Any ideas? Or even how I could debug?

The new buttons don't put out the same ARP request as the old ones. Remove this line and it should work.

if pkt[ARP].psrc == '0.0.0.0': # ARP Probe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM