Skip to content

Instantly share code, notes, and snippets.

@hughdbrown
Forked from eob/dash-listen-2.py
Last active November 6, 2015 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hughdbrown/6ded4aae98a0eed88426 to your computer and use it in GitHub Desktop.
Save hughdbrown/6ded4aae98a0eed88426 to your computer and use it in GitHub Desktop.
from scapy.all import *
AMAZON_TABLE = {
'74:75:48:5f:99:30': 'Huggies,
'10:ae:60:00:4d:f3': 'Elements',
}
def is_arp(arp):
return (arp.op, arp.prc) == (1, '0.0.0.0')
def arp_display(pkt):
arp = pkt[ARP]
if is_arp(arp):
print(AMAZON_TABLE.get(arp.hwsrc, "ARP Probe from unknown device: ".format(arp.hwsrc)))
print sniff(prn=arp_display, filter="arp", store=0, count=10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment