diff --git a/docker/dash-listen.py b/docker/dash-listen.py index b305c1a..f9078bf 100644 --- a/docker/dash-listen.py +++ b/docker/dash-listen.py @@ -11,17 +11,25 @@ #URL_CALLBACK=os.environ.get('URL_CALLBACK') def arp_display(pkt): - if pkt[ARP].op == 1: #who-has (request) - if pkt[ARP].psrc == '0.0.0.0': # ARP Probe - if pkt[ARP].hwsrc == DASH_MAC_ADDRESS: - #requests.get(URL_CALLBACK) + if pkt[ARP].op == 1: #who-has (request) + if pkt[ARP].psrc == '0.0.0.0': # ARP Probe + if pkt[ARP].hwsrc == DASH_MAC_ADDRESS: + #requests.get(URL_CALLBACK) print "ARP from " + pkt[ARP].hwsrc - else: - print "ARP Probe from unknown device: " + pkt[ARP].hwsrc + else: + print "ARP Probe from unknown device: " + pkt[ARP].hwsrc + # end if + # end if + # end if +# end apr_display while True: - try: - print sniff(prn=arp_display, filter="arp", store=0, count=10) - except: - pass + try: + print "start" + print sniff(prn=arp_display, filter="arp", store=0, count=10) + except: + pass + # end try +# end while +