diff --git a/docker/dash-listen.py b/docker/dash-listen.py index 440ab29..952871b 100644 --- a/docker/dash-listen.py +++ b/docker/dash-listen.py @@ -12,12 +12,10 @@ #URL_CALLBACK=os.environ.get('URL_CALLBACK') def arp_display(pkt): - if pkt[ARP].op == 1: #who-has (request) - if pkt[ARP].hwsrc == DASH_MAC_ADDRESS: + if (pkt.haslayer(DHCP)): + if (pkt[Ether].src == DASH_MAC_ADDRESS): #requests.get(URL_CALLBACK) - print "ARP from " + pkt[ARP].hwsrc + " " + pkt[ARP].psrc - else: - print "ARP Probe from unknown device: " + pkt[ARP].hwsrc + " " + pkt[ARP].psrc + print "DHCP from " + pkt[Ether].src # end if # end if # end apr_display @@ -25,7 +23,7 @@ while True: try: - print sniff(prn=arp_display, iface=DASH_INTERFACE, filter="arp", store=0, count=10) + print sniff(prn=arp_display, iface=DASH_INTERFACE, filter="ip", store=0, count=0) except: pass # end try