aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2013-11-01 23:07:03 +0100
committerLaurent Ghigonis <laurent@p1sec.com>2013-11-01 23:07:03 +0100
commit8f821f0ca589fda38166e1b1a025d1ceb1a92910 (patch)
treed4a173d107b1fa247f72428a3ed9f47c76cf1bd8
parentmove wifcap to github (diff)
downloadlaurent-tools-master.tar.xz
laurent-tools-master.zip
autoscan: move to https://github.com/P1sec/autoscanHEADmaster
git clone https://github.com/P1sec/autoscan.git
Diffstat (limited to '')
-rw-r--r--autoscan/Makefile8
-rw-r--r--autoscan/README.txt186
-rwxr-xr-xautoscan/autoscan.py334
-rw-r--r--autoscan/tests/Makefile5
-rwxr-xr-xautoscan/tests/spoofbin/curl3
-rwxr-xr-xautoscan/tests/spoofbin/ifconfig12
-rwxr-xr-xautoscan/tests/spoofbin/iwconfig4
-rwxr-xr-xautoscan/tests/spoofbin/nmap16
-rwxr-xr-xautoscan/tests/spoofbin/route7
-rwxr-xr-xautoscan/tests/spoofbin/traceroute18
-rwxr-xr-xautoscan/tests/test_autoscan.sh24
11 files changed, 0 insertions, 617 deletions
diff --git a/autoscan/Makefile b/autoscan/Makefile
deleted file mode 100644
index 0c13c1c..0000000
--- a/autoscan/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-all:
- @echo "noting to do"
-
-tests:
- make -C tests/
-
-.PHONY: tests
-
diff --git a/autoscan/README.txt b/autoscan/README.txt
deleted file mode 100644
index d442ecd..0000000
--- a/autoscan/README.txt
+++ /dev/null
@@ -1,186 +0,0 @@
-autoscan - automatic fingerprint of visited networks
-
-autscan remembers network parameters (addresses, dns...) and runs a basic
-fingerprinting (traceroute, scan) of the network you are connected to.
-It has 2 modes:
-* runnow: run the fingerprint on the specified interface
-* monitor: daemonize and wait on the specified interface, and everytime you
-connect to a new network it will do the fingerprint
-
-Fingerprinting steps:
-_test_pcap
- records a 15s PCAP in the background (tcpdump)
-_test_ifconfig
- remembers ipv4 and ipv6 attributed by DHCP (ifconfig)
-_test_iwconfig
- remembers AP name and MAC (iwconfig)
-_test_route
- remembers routing table (route -n)
-_test_resolv
- remembers DNS attributed by dhcp (resolv.conf)
-_test_pubip_get
- gets your internet public IP (curl ifconfig.me)
-_test_pubip_ping
- tests if an arbitrary public IP answers to ping (ping 8.8.8.8)
-_test_pubip_traceroute
- runs a traceroute to an arbitrary public IP (ping 8.8.8.8)
-_test_resolv_traceroute
- runs a traceroute to the DNS given by dhcp (traceroute)
-The following steps can be disabled using -x to run faster:
-_test_explor_traceroute
- runs traceroute to arbitrary private IP ranges (traceroute)
-_test_explor_scan
- runs an nmap scan on the local /24 IP range (nmap)
-
-===============================================================================
-Example usage: Run fingerprinting on wlan0
-
-$ sudo ./autoscan.py wlan0
-20130724-143501 [>] wlan0: _do_tests
-20130724-143501 [-] wlan0: _test_pcap
-20130724-143501 [-] wlan0: _test_ifconfig
-20130724-143501 [-] wlan0: _test_iwconfig
-20130724-143501 [-] wlan0: _test_route
-20130724-143502 [-] wlan0: _test_resolv
-20130724-143502 [-] wlan0: _test_pubip_get
-20130724-143510 [-] wlan0: _test_pubip_ping
-20130724-143510 [-] wlan0: _test_pubip_traceroute
-20130724-143516 [-] wlan0: _test_resolv_traceroute
-20130724-143527 [-] wlan0: _test_explor_traceroute
-20130724-143710 [-] wlan0: _test_explor_scan
-20130724-143725 [*] wlan0: ./20130724_123501_wlan0_82.247.82.44_freeflo
-
-The last line indicates where the file where saved.
-(Use -o to specify a parent directory).
-List the generated files:
-
-find ./20130724_123501_wlan0_82.247.82.44_freeflo
-./20130724_123501_wlan0_82.247.82.44_freeflo
-./20130724_123501_wlan0_82.247.82.44_freeflo/resolv_traceroute
-./20130724_123501_wlan0_82.247.82.44_freeflo/resolv_traceroute/out
-./20130724_123501_wlan0_82.247.82.44_freeflo/pubip_get
-./20130724_123501_wlan0_82.247.82.44_freeflo/pubip_get/ip
-./20130724_123501_wlan0_82.247.82.44_freeflo/pubip_traceroute
-./20130724_123501_wlan0_82.247.82.44_freeflo/pubip_traceroute/out
-./20130724_123501_wlan0_82.247.82.44_freeflo/iwconfig
-./20130724_123501_wlan0_82.247.82.44_freeflo/iwconfig/ap
-./20130724_123501_wlan0_82.247.82.44_freeflo/iwconfig/essid
-./20130724_123501_wlan0_82.247.82.44_freeflo/iwconfig/out
-./20130724_123501_wlan0_82.247.82.44_freeflo/route
-./20130724_123501_wlan0_82.247.82.44_freeflo/route/gw
-./20130724_123501_wlan0_82.247.82.44_freeflo/route/out
-./20130724_123501_wlan0_82.247.82.44_freeflo/pcap
-./20130724_123501_wlan0_82.247.82.44_freeflo/pcap/tcpdump.pcap
-./20130724_123501_wlan0_82.247.82.44_freeflo/resolv
-./20130724_123501_wlan0_82.247.82.44_freeflo/resolv/dns0
-./20130724_123501_wlan0_82.247.82.44_freeflo/resolv/dns1
-./20130724_123501_wlan0_82.247.82.44_freeflo/resolv/resolv.conf
-./20130724_123501_wlan0_82.247.82.44_freeflo/ifconfig
-./20130724_123501_wlan0_82.247.82.44_freeflo/ifconfig/up
-./20130724_123501_wlan0_82.247.82.44_freeflo/ifconfig/ip4
-./20130724_123501_wlan0_82.247.82.44_freeflo/ifconfig/ip6
-./20130724_123501_wlan0_82.247.82.44_freeflo/ifconfig/out
-./20130724_123501_wlan0_82.247.82.44_freeflo/explor_scan
-./20130724_123501_wlan0_82.247.82.44_freeflo/explor_scan/localnet.nmap
-./20130724_123501_wlan0_82.247.82.44_freeflo/explor_scan/localnet.xml
-./20130724_123501_wlan0_82.247.82.44_freeflo/explor_scan/localnet.gnmap
-./20130724_123501_wlan0_82.247.82.44_freeflo/explor_scan/out
-./20130724_123501_wlan0_82.247.82.44_freeflo/explor_traceroute
-./20130724_123501_wlan0_82.247.82.44_freeflo/explor_traceroute/out_172.16.0.1
-./20130724_123501_wlan0_82.247.82.44_freeflo/explor_traceroute/out_192.168.0.1
-./20130724_123501_wlan0_82.247.82.44_freeflo/explor_traceroute/out_192.168.2.1
-./20130724_123501_wlan0_82.247.82.44_freeflo/explor_traceroute/out_10.0.0.1
-./20130724_123501_wlan0_82.247.82.44_freeflo/explor_traceroute/out_192.168.1.1
-./20130724_123501_wlan0_82.247.82.44_freeflo/pubip_ping
-./20130724_123501_wlan0_82.247.82.44_freeflo/pubip_ping/code
-./20130724_123501_wlan0_82.247.82.44_freeflo/pubip_ping/out
-
-Look at the output of iwconfig:
-$ more ./20130724_123501_wlan0_82.247.82.44_freeflo/iwconfig/out
-wlan0 IEEE 802.11abgn ESSID:"freeflo"
- Mode:Managed Frequency:2.462 GHz Access Point: 7A:A4:42:11:E9:B3
- Bit Rate=54 Mb/s Tx-Power=15 dBm
- Retry long limit:7 RTS thr:off Fragment thr:off
- Encryption key:off
- Power Management:off
- Link Quality=62/70 Signal level=-48 dBm
- Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
- Tx excessive retries:18 Invalid misc:1208 Missed beacon:0
-
-Look at the SSID:
-$ more ./20130724_123501_wlan0_82.247.82.44_freeflo/iwconfig/essid
-freeflo
-
-Look at the public IP:
-$ more ./20130724_123501_wlan0_82.247.82.44_freeflo/pubip_get/ip
-82.247.82.44
-
-===============================================================================
-Example usage: Run in monitor mode on wlan0
-
-$ sudo ./autoscan.py -m wlan0
-
-# I connect to WIFI networks "freeflo" then "FreeWifi"
-
-$ cat autoscan.log
-20130724-144805 [>] wlan0: _wait_up # autoscan waits for a network
-20130724-144808 [>] wlan0: _do_tests # I just connected to "freeflo"
-20130724-144808 [-] wlan0: _test_pcap
-20130724-144808 [-] wlan0: _test_ifconfig
-20130724-144811 [-] wlan0: _test_iwconfig
-20130724-144811 [-] wlan0: _test_route
-20130724-144811 [-] wlan0: _test_resolv
-20130724-144811 [-] wlan0: _test_pubip_get
-20130724-144814 [-] wlan0: _test_pubip_ping
-20130724-144815 [-] wlan0: _test_pubip_traceroute
-20130724-144821 [-] wlan0: _test_resolv_traceroute
-20130724-144842 [-] wlan0: _test_explor_traceroute
-20130724-145041 [-] wlan0: _test_explor_scan
-20130724-145050 [*] wlan0: ./20130724_124808_wlan0_82.247.82.44_freeflo
-20130724-145050 [>] wlan0: _wait_down # autoscan waits for me to disconnect
-20130724-145455 [>] wlan0: _wait_up # I disconnected from "freeflo"
-20130724-145514 [>] wlan0: _do_tests # I connect to "FreeWifi"
-20130724-145514 [-] wlan0: _test_pcap
-20130724-145514 [-] wlan0: _test_ifconfig
-20130724-145514 [-] wlan0: _test_iwconfig
-20130724-145514 [-] wlan0: _test_route
-20130724-145514 [-] wlan0: _test_resolv
-20130724-145514 [-] wlan0: _test_pubip_get
-20130724-145515 [-] wlan0: _test_pubip_ping
-20130724-145518 [-] wlan0: _test_pubip_traceroute
-20130724-145549 [-] wlan0: _test_resolv_traceroute
-20130724-145604 [-] wlan0: _test_explor_traceroute
-20130724-145835 [-] wlan0: _test_explor_scan
-20130724-150202 [*] wlan0: ./20130724_125514_wlan0_78.251.248.51_FreeWifi
-20130724-150202 [>] wlan0: _wait_down
-
-===============================================================================
-Hint for showing results
-
-find ./20130724_123501_wlan0_82.247.82.44_freeflo |while read a; do [[ -f $a ]] && echo -e "\n====== $a =====" && cat $a || echo -e "\n>>>>>> $a <<<<<<"; done |less
-
->>>>>> ./20130724_123501_wlan0_82.247.82.44_freeflo <<<<<<
-
->>>>>> ./20130724_123501_wlan0_82.247.82.44_freeflo/resolv_traceroute <<<<<<
-
-====== ./20130724_123501_wlan0_82.247.82.44_freeflo/resolv_traceroute/out =====
-traceroute to 212.27.40.241 (212.27.40.241), 30 hops max, 60 byte packets
- 1 192.168.0.254 (192.168.0.254) 15.454 ms 15.740 ms 16.317 ms
- 2 82.247.82.254 (82.247.82.254) 36.635 ms 36.634 ms 38.103 ms
- 3 78.254.0.94 (78.254.0.94) 38.338 ms 39.373 ms 39.829 ms
- 4 bob75-1-v900.intf.nra.proxad.net (78.254.255.9) 40.014 ms 41.213 ms 41.528 ms
- 5 mna75-1-v902.intf.nra.proxad.net (78.254.255.5) 43.312 ms 43.646 ms 45.755 ms
- 6 mna75-1-v904.intf.nra.proxad.net (78.254.254.33) 46.562 ms 20.566 ms 25.581 ms
- 7 th2-6k-2-1-po1.intf.nra.proxad.net (78.254.255.1) 28.249 ms * *
- 8 bzn-crs16-1-be1004.intf.routers.proxad.net (212.27.50.173) 35.308 ms 35.552 ms 35.797 ms
- 9 bzn-6k-2-po20.intf.routers.proxad.net (212.27.50.62) 35.870 ms * *
-10 bzn-49m-7-v940.intf.routers.proxad.net (212.27.56.78) 35.917 ms 37.020 ms 38.331 ms
-11 dns2.proxad.net (212.27.40.241) 38.524 ms 38.589 ms 38.468 ms
-
->>>>>> ./20130724_123501_wlan0_82.247.82.44_freeflo/pubip_get <<<<<<
-
-====== ./20130724_123501_wlan0_82.247.82.44_freeflo/pubip_get/ip =====
-82.247.82.44
-
->>>>>> ./20130724_123501_wlan0_82.247.82.44_freeflo/pubip_traceroute <<<<<<
-[...]
diff --git a/autoscan/autoscan.py b/autoscan/autoscan.py
deleted file mode 100755
index 0cd8860..0000000
--- a/autoscan/autoscan.py
+++ /dev/null
@@ -1,334 +0,0 @@
-#!/bin/env python
-
-# autoscan - automatic fingerprint of visited networks
-# 2013, Laurent Ghigonis <laurent@gouloum.fr>
-
-import sys
-import os
-import time
-import subprocess
-import traceback
-import re
-import argparse
-import shutil
-import errno
-import logging
-
-class Autoscan_iface(object):
- def __init__(self, iface, outdir=".", logfile=None, loglevel=logging.INFO, target_pubip="8.8.8.8", noexplore=False):
- logstream = None
- if not logfile:
- logstream = sys.stdout
- logging.basicConfig(filename=logfile, level=loglevel,
- stream=logstream,
- format='%(asctime)s %(message)s',
- datefmt="%Y%m%d-%H%M%S")
- self.iface = iface
- self.outdir = outdir
- self.target_pubip = target_pubip
- self.noexplore = noexplore
- self.date = None # set by _do_tests()
- if 'SUDO_UID' in os.environ and 'SUDO_GID' in os.environ:
- self.perm_uid = int(os.environ['SUDO_UID'])
- self.perm_gid = int(os.environ['SUDO_GID'])
- else:
- self.perm_uid = os.getuid()
- self.perm_gid = os.getgid()
- self.found_ip4 = None
- self.found_ip6 = None
- self.found_pubip = None
- self.found_dns = list()
- self.found_essid = None
-
- def run_now(self):
- self._do_tests()
-
- def monitor(self):
- self._wait_up()
- self._do_tests()
- while True:
- self._wait_down()
- self._wait_up()
- self._do_tests()
-
- def _wait_up(self):
- logging.info("[>] %s: _wait_up", self.iface)
- while True:
- out, err, code = self._exec(
- ['ifconfig', self.iface])
- # iface up
- up = re.search(r'UP', out)
- ip4 = re.search(r'inet (\S+)', out)
- ip6 = re.search(r'inet6 (\S+)', out)
- if up and ip4: # XXX no ip6 because too fast
- break
- # loop
- time.sleep(0.5)
- time.sleep(3) # XXX wait for network to be configured
-
- def _wait_down(self):
- logging.info("[>] %s: _wait_down", self.iface)
- last_ip4 = None
- last_ip6 = None
- last_t = None
- while True:
- out, err, code = self._exec(
- ['ifconfig', self.iface])
- # iface down
- up = re.search(r'UP', out)
- if not up:
- break
- # iface ip change
- ip4 = re.search(r'inet (\S+)', out)
- if ip4: ip4 = ip4.group(1)
- if (not ip4 and last_ip4) or \
- (ip4 and last_ip4 and ip4 != last_ip4):
- break
- last_ip4 = ip4
- ip6 = re.search(r'inet6 (\S+)', out)
- if ip6: ip6 = ip6.group(1)
- if (not ip6 and last_ip6) or \
- (ip6 and last_ip6 and ip6 != last_ip6):
- break
- last_ip6 = ip6
- # sleep detection
- t = time.clock()
- if last_t and (t - last_t > 1):
- break
- last_t = t
- # loop
- time.sleep(0.5)
-
- def _do_tests(self):
- logging.info("[>] %s: _do_tests", self.iface)
- self.date = time.strftime("%Y%m%d_%H%M%S", time.gmtime())
- self._do_tests_run(self._test_pcap)
- self._do_tests_run(self._test_ifconfig)
- self._do_tests_run(self._test_iwconfig)
- self._do_tests_run(self._test_route)
- self._do_tests_run(self._test_resolv)
- self._do_tests_run(self._test_pubip_get)
- self._do_tests_run(self._test_pubip_ping)
- self._do_tests_run(self._test_pubip_traceroute)
- self._do_tests_run(self._test_resolv_traceroute)
- if not self.noexplore:
- self._do_tests_run(self._test_explor_traceroute)
- self._do_tests_run(self._test_explor_scan)
- self._storepath_rename()
-
- def _do_tests_run(self, func):
- try:
- logging.info("[-] %s: %s" % (self.iface, func.__name__))
- func()
- except Exception, e:
- logging.info("[!] %s: test %s failed: %s" % (self.iface, func, e))
- logging.info(traceback.format_exc())
-
- def _test_pcap(self):
- if os.fork() != 0:
- return
- # child
- os.system("$(tcpdump -ni %s -w %s 2>/dev/null & sleep 15; kill %%1) &" % (
- self.iface, self._storepath_get("pcap/tcpdump.pcap")))
- sys.exit(0)
-
- def _test_ifconfig(self):
- out, err, code = self._exec(
- ['ifconfig', self.iface])
- self._store("ifconfig/out", out)
- up = re.search(r'UP', out)
- if up: self._store("ifconfig/up", "")
- ip4 = re.search(r'inet (\S+)', out)
- if ip4:
- self._store("ifconfig/ip4", ip4.group(1))
- self.found_ip4 = ip4.group(1)
- ip6 = re.search(r'inet6 (\S+)', out)
- if ip6:
- self._store("ifconfig/ip6", ip6.group(1))
- self.found_ip6 = ip6.group(1)
-
- def _test_iwconfig(self):
- self.found_essid = None
- out, err, code = self._exec(
- ['iwconfig', self.iface])
- if len(out) == 0:
- return # not a WIFI interface
- self._store("iwconfig/out", out)
- essid = re.search(r'ESSID:(\S+)', out)
- if essid:
- essid = essid.group(1).replace("\"", "")
- self.found_essid = essid
- self._store("iwconfig/essid", essid)
- ap = re.search(r'Access Point: (\S+)', out)
- if ap:
- self._store("iwconfig/ap", ap.group(1))
-
- def _test_route(self):
- out, err, code = self._exec(
- ['route', '-n'])
- self._store("route/out", out)
- gw = re.findall(r'(\S+)', out.split('\n')[2])[1]
- if gw: self._store("route/gw", gw)
-
- def _test_resolv(self):
- shutil.copy("/etc/resolv.conf", self._storepath_get("resolv/resolv.conf"))
- n = 0
- with open("/etc/resolv.conf") as f:
- for line in f:
- r = re.search('nameserver (\S+)', line)
- if r:
- dns = r.group(1)
- self._store("resolv/dns%d" % n, dns)
- self.found_dns.append(dns)
- n += 1
-
-
- def _test_pubip_get(self):
- out, err, code = self._exec(
- ['curl', '--retry', '3', 'ifconfig.me'])
- if re.search(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$', out):
- self._store("pubip_get/ip", out)
- self.found_pubip = out.strip()
- else:
- self._store("pubip_get/out", out)
- self.found_pubip = None
-
- def _test_pubip_ping(self):
- out, err, code = self._exec(
- ['ping', '-W', '3', '-c', '1', self.target_pubip])
- self._store("pubip_ping/code", code)
- self._store("pubip_ping/out", out)
-
- def _test_pubip_traceroute(self):
- self._store("pubip_traceroute/out",
- self._util_traceroute(self.target_pubip))
-
- def _test_resolv_traceroute(self):
- for dns in self.found_dns:
- self._store("resolv_traceroute/out",
- self._util_traceroute(dns))
-
- def _test_explor_traceroute(self):
- targets = ["192.168.0.1", "192.168.1.1", "192.168.2.1", "10.0.0.1", "172.16.0.1"]
- for t in targets:
- self._store("explor_traceroute/out_%s" % t,
- self._util_traceroute(t))
-
- def _test_explor_scan(self):
- target = re.sub('\.[0-9]+$', '', self.found_ip4) + ".0/24" # XXX v6
- out, err, code = self._exec(
- ['nmap', '-oA', self._storepath_get("explor_scan/localnet"), '-p', '21,22,23,445,80,443,8080,8081,8082,8083', target])
- self._store("explor_scan/out", out)
- if len(err) > 0:
- self._store("explor_scan/err", err)
-
- def _exec(self, cmd):
- p = subprocess.Popen(cmd,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- out, err = p.communicate()
- return out, err, p.returncode
-
- def _store(self, suffix, txt):
- name = self._storepath_get(suffix)
- logging.debug("%s = %s" % (name, txt))
- f = open(name, "w+")
- f.write(str(txt))
- f.close()
- os.chown(name, self.perm_uid, self.perm_gid)
-
- def _storepath_get(self, suffix=None):
- path = "%s/%s_%s" % (self.outdir, self.date, self.iface)
- if suffix:
- path += "/" + suffix
- d = os.path.dirname(path)
- if not os.path.isdir(d):
- os.makedirs(d)
- subprocess.check_output(['chown', '-R', '%s:%s' % (self.perm_uid, self.perm_gid), self.outdir]) # pythonic way is awefull
- return path
-
- def _storepath_rename(self):
- if self.found_pubip:
- suffix = self.found_pubip
- else:
- suffix = self.found_ip4
- if self.found_essid:
- suffix += "_" + self.found_essid
- newpath = self._storepath_get() + "_" + suffix
- logging.info("[*] %s: %s" % (self.iface, newpath))
- os.rename(self._storepath_get(), newpath)
-
- def _util_traceroute(self, target):
- out, err, code = self._exec(
- ['traceroute', target])
- return out
-
-
-if not os.geteuid() == 0:
- sys.exit('must be root')
-
-# XXX all ifaces by default, use netifaces
-
-parser = argparse.ArgumentParser()
-parser.add_argument("interfaces", nargs='+',
- help="Interface(s) to use")
-parser.add_argument("-m", "--monitor", action="store_true",
- help="Mode monitor: Stay in the background and automaticaly run when interface turns up")
-parser.add_argument("-r", "--runnow", action="store_true",
- help="Mode runnow (default): Run tests/scans now and exit")
-parser.add_argument("-f", "--foreground", action="store_true",
- help="Run in foreground for monitor mode, do not daemonize")
-parser.add_argument("-o", "--outdir", action="store", default=".",
- help="Use DIR as output directory")
-parser.add_argument("-x", "--noexplore", action="store_true",
- help="Do not run explore tests (traceroute to arbitrary local ranges + nmap scan)")
-parser.add_argument("-p", "--pubip", action="store", default="8.8.8.8",
- help="Use target IP for public IP tests")
-parser.add_argument("-q", "--quiet", action="store_true",
- help="Quiet logging (warning only)")
-parser.add_argument("-v", "--verbose", action="store_true",
- help="Verbose logging")
-args = parser.parse_args()
-
-if args.runnow and args.monitor:
- print "Cannot specify both monitor and runnow modes !"
- sys.exit(1)
-if args.runnow and args.foreground:
- print "Cannot specify foreground with runnow, it's implicit !"
- sys.exit(1)
-if args.verbose and args.quiet:
- print "Cannot specify both verbose and quiet !"
- sys.exit(1)
-
-if not args.runnow and not args.monitor:
- args.runnow = True
-if args.runnow:
- args.foreground = True
-if args.foreground:
- logfile = None
-else:
- logfile = "autoscan.log"
-if args.verbose:
- loglevel = logging.DEBUG
-elif args.quiet:
- loglevel = logging.WARN
-else:
- loglevel = logging.INFO
-
-for iface in args.interfaces:
- if os.fork() == 0:
- autoscan = Autoscan_iface(iface, args.outdir,
- logfile=logfile,
- loglevel=loglevel,
- target_pubip=args.pubip,
- noexplore=args.noexplore)
- if args.runnow:
- autoscan.run_now()
- else:
- autoscan.monitor()
- # UNREACHED
-
-if args.foreground:
- while True:
- try: os.wait()
- except: break
-
diff --git a/autoscan/tests/Makefile b/autoscan/tests/Makefile
deleted file mode 100644
index 77bebab..0000000
--- a/autoscan/tests/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-all: clean
- ./test_autoscan.sh
-
-clean:
- rm -rf test_output/
diff --git a/autoscan/tests/spoofbin/curl b/autoscan/tests/spoofbin/curl
deleted file mode 100755
index f3788e4..0000000
--- a/autoscan/tests/spoofbin/curl
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-echo "1.2.3.4"
diff --git a/autoscan/tests/spoofbin/ifconfig b/autoscan/tests/spoofbin/ifconfig
deleted file mode 100755
index 0df746d..0000000
--- a/autoscan/tests/spoofbin/ifconfig
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-echo "eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
- inet 10.137.2.9 netmask 255.255.255.255 broadcast 10.255.255.255
- inet6 fe80::216:3eff:fe5e:6c07 prefixlen 64 scopeid 0x20<link>
- ether 00:16:3e:5e:6c:07 txqueuelen 1000 (Ethernet)
- RX packets 74405 bytes 93418449 (89.0 MiB)
- RX errors 0 dropped 0 overruns 0 frame 0
- TX packets 54640 bytes 5365525 (5.1 MiB)
- TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
- device interrupt 47
-"
diff --git a/autoscan/tests/spoofbin/iwconfig b/autoscan/tests/spoofbin/iwconfig
deleted file mode 100755
index 2302264..0000000
--- a/autoscan/tests/spoofbin/iwconfig
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-echo "eth0 no wireless extensions.
-"
diff --git a/autoscan/tests/spoofbin/nmap b/autoscan/tests/spoofbin/nmap
deleted file mode 100755
index 513ad52..0000000
--- a/autoscan/tests/spoofbin/nmap
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-oa=""
-while true; do
- case $1 in
- -oA) oa=$2; shift ;;
- *) shift ;;
- esac
- [[ $# -eq 1 ]] && break
-done
-
-if [ X"$oa" != X"" ]; then
- touch $oa.xml
- touch $oa.gnmap
- touch $oa.nmap
-fi
diff --git a/autoscan/tests/spoofbin/route b/autoscan/tests/spoofbin/route
deleted file mode 100755
index 20abcc3..0000000
--- a/autoscan/tests/spoofbin/route
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-
-echo "Kernel IP routing table
-Destination Gateway Genmask Flags Metric Ref Use Iface
-0.0.0.0 10.137.2.1 0.0.0.0 UG 0 0 0 eth0
-10.137.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
-"
diff --git a/autoscan/tests/spoofbin/traceroute b/autoscan/tests/spoofbin/traceroute
deleted file mode 100755
index 36546a5..0000000
--- a/autoscan/tests/spoofbin/traceroute
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-echo "traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
- 1 10.137.2.1 (10.137.2.1) 0.781 ms 0.683 ms 0.608 ms
- 2 172.28.194.1 (172.28.194.1) 115.733 ms 115.752 ms 115.763 ms
- 3 * * *
- 4 * * *
- 5 bhs-g2-6k.qc.ca (198.27.73.15) 124.822 ms 125.331 ms 129.664 ms
- 6 198.27.73.206 (198.27.73.206) 139.953 ms * *
- 7 ash-1-6k.va.us (178.32.135.233) 124.985 ms 134.881 ms *
- 8 198.27.73.105 (198.27.73.105) 182.568 ms 182.509 ms 182.519 ms
- 9 216.239.46.250 (216.239.46.250) 138.474 ms 216.239.46.248 (216.239.46.248) 137.078 ms 216.239.46.250 (216.239.46.250) 123.555 ms
-10 72.14.236.146 (72.14.236.146) 124.983 ms 72.14.236.148 (72.14.236.148) 121.850 ms 127.460 ms
-11 72.14.235.12 (72.14.235.12) 131.885 ms 133.096 ms 133.784 ms
-12 72.14.234.53 (72.14.234.53) 133.715 ms 72.14.234.55 (72.14.234.55) 133.535 ms 72.14.234.67 (72.14.234.67) 135.416 ms
-13 * * *
-14 google-public-dns-a.google.com (8.8.8.8) 131.568 ms 131.605 ms 133.601 ms
-"
diff --git a/autoscan/tests/test_autoscan.sh b/autoscan/tests/test_autoscan.sh
deleted file mode 100755
index 4c488cc..0000000
--- a/autoscan/tests/test_autoscan.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-err() {
- echo "ERROR: $1"
- exit 1
-}
-
-sudo PATH="./spoofbin/:$PATH" ../autoscan.py -v -p 127.0.0.1 -o test_output/ -r eth0 ||err "autoscan execution failed"
-
-# XXX test output dirs
-dir="test_output/$(ls -1 test_output |tail -n1)"
-[[ -e $dir/pcap/tcpdump.pcap ]] ||err "pcap/tcpdump.pcap"
-[[ $(cat $dir/ifconfig/ip4) = "10.137.2.9" ]] ||err "ifconfig/ip4"
-[[ $(cat $dir/ifconfig/ip6) = "fe80::216:3eff:fe5e:6c07" ]] ||err "ifconfig/ip6"
-[[ $(cat $dir/route/gw) = "10.137.2.1" ]] ||err "route/gw"
-[[ $(cat $dir/pubip_ping/code) = "0" ]] ||err "pubip_ping/code"
-[[ -e $dir/resolv/resolv.conf ]] ||err "resolv/resolv.conf"
-[[ $(cat $dir/pubip_get/ip) = "1.2.3.4" ]] ||err "pubip_get/ip"
-[[ -e $dir/pubip_traceroute/out ]] ||err "pubip_traceroute/out"
-[[ -e $dir/resolv_traceroute/out ]] ||err "resolv_traceroute/out"
-[[ -e "$dir/explor_traceroute/out_192.168.0.1" ]] ||err "explor_traceroute/out_192.168.0.1"
-[[ -e $dir/explor_scan/localnet.nmap ]] ||err "explor_scan/localnet.nmap"
-
-echo "TEST OK"