Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import logging
  2. logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
  3. from scapy.all import *
  4.  
  5. routerip = sys.argv[1]
  6. macrouter = sys.argv[2]
  7.  
  8. def arp_monitor_callback(pkt):
  9.         if ARP in pkt and pkt[ARP].op == 2:
  10.  
  11.                 direhw = pkt.sprintf("%ARP.hwsrc%")
  12.         ip = pkt.sprintf("%ARP.psrc%")
  13.        
  14.         if ip == routerip and direhw != macrouter:
  15.            
  16.             print "Detectado ataque ARP SPOOF\n"
  17.             print "Direccion MAC atacante %s\n" % direhw
  18.  
  19. sniff(prn=arp_monitor_callback, filter="", store=0)