Skip to content

Instantly share code, notes, and snippets.

@nelix
Created July 5, 2009 16:11
Show Gist options
  • Save nelix/141016 to your computer and use it in GitHub Desktop.
Save nelix/141016 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
from scapy import *
def arp_monitor_callback(pkt):
if ARP in pkt and pkt[ARP].op in (1,2): #who-has or is-at
return pkt.sprintf("%ARP.hwsrc% %ARP.psrc%")
sniff(prn=arp_monitor_callback, filter="arp", store=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment