diff --git a/dash.conf_example b/dash.conf_example index 03f02c7..5d33c7f 100644 --- a/dash.conf_example +++ b/dash.conf_example @@ -1,2 +1,3 @@ DASH_MAC_ADDRESS= DASH_URL_CALLBACK= +DASH_INTERFACE= diff --git a/docker-compose.yml b/docker-compose.yml index c52f649..8dd56bb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,7 @@ restart: always environment: - DASH_MAC_ADDRESS=${DASH_MAC_ADDRESS} + - DASH_INTERFACE=${DASH_INTERFACE} - DASH_URL_CALLBACK=${DASH_URL_CALLBACK} tmpfs: - /tmp diff --git a/docker/Dockerfile b/docker/Dockerfile index e0080a2..a6ad1c7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,8 +18,8 @@ # copy files ADD dash-listen.py ./dash-listen.py -COPY docker-entrypoint.sh / -RUN chmod +x /docker-entrypoint.sh +#COPY docker-entrypoint.sh / +#RUN chmod +x /docker-entrypoint.sh -ENTRYPOINT ["/docker-entrypoint.sh"] +#ENTRYPOINT ["/docker-entrypoint.sh"] CMD python ./dash-listen.py diff --git a/docker/dash-listen.py b/docker/dash-listen.py index c6f9236..440ab29 100644 --- a/docker/dash-listen.py +++ b/docker/dash-listen.py @@ -12,26 +12,21 @@ #URL_CALLBACK=os.environ.get('URL_CALLBACK') def arp_display(pkt): - print pkt[ARP].hwsrc + " " + pkt[ARP].psrc + " op:" + str(pkt[ARP].op) 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 - # end if + if pkt[ARP].hwsrc == 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 # end if # end if # end apr_display -#while True: -# try: -# print sniff(prn=arp_display, iface="eth0", filter="arp", store=0, count=10) -# except: -# pass -# # end try +while True: + try: + print sniff(prn=arp_display, iface=DASH_INTERFACE, filter="arp", store=0, count=10) + except: + pass + # end try # end while - -print sniff(prn=arp_display, iface=DASH_INTERFACE, filter="arp", store=0, count=10)