diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2013-07-21 00:00:55 +0200 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2013-07-21 00:00:55 +0200 |
commit | 581c3a81fc81db5065ad8939d36ac284420f73c2 (patch) | |
tree | c543e7e7a591b1fc60fbd39db7336b2276b5f7d3 | |
parent | jsaccess: TODO++ (diff) | |
download | laurent-tools-581c3a81fc81db5065ad8939d36ac284420f73c2.tar.xz laurent-tools-581c3a81fc81db5065ad8939d36ac284420f73c2.zip |
autoscan - keep logs of visited networks
XXX IN PROGRESS, DONT EXPECT THIS TO WORK
-rw-r--r-- | autoscan/autoscan.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/autoscan/autoscan.py b/autoscan/autoscan.py new file mode 100644 index 0000000..0c9a06b --- /dev/null +++ b/autoscan/autoscan.py @@ -0,0 +1,30 @@ +#!/bin/env python + +# autoscan - keep logs of visited networks +# XXX IN PROGRESS 20130721 laurent +# 2013, Laurent Ghigonis <laurent@gouloum.fr> + +# Each time internet connectivity become available after a cut-off, +# keep a log of the following +# * ifconfig +# * if WIFI, iwconfig +# * route -n +# * traceroute +# * local net IP scan + +import subprocess + +TARGET = "8.8.8.8" +LOG = "autoscan.log" + +log = open(LOG, "a") + +res = -1 +while True: + res = subprocess.call(['ping', '-W', '1', '-c', '1', TARGET]) + if res == 0: + print "ping to", address, "OK" + elif res == 2: + print "no response from", address + else: + print "ping to", address, "failed!" |