From a0882d676d07d5d6097f98ebe21ecaca1286ce90 Mon Sep 17 00:00:00 2001 From: DanMcInerney Date: Sat, 9 Nov 2013 01:20:11 -0700 Subject: [PATCH 1/4] minor --- LANspy.log.txt | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 LANspy.log.txt diff --git a/LANspy.log.txt b/LANspy.log.txt deleted file mode 100644 index 384dd7a..0000000 --- a/LANspy.log.txt +++ /dev/null @@ -1,18 +0,0 @@ -[*] Router IP: 10.0.0.1 -[*] victim IP: 10.0.0.8 -[*] Router MAC: cc:35:40:41:49:30 -[*] Victim MAC: 00:13:02:a6:8f:12 -[+] Starting Nmap 6.40 ( http://nmap.org ) at 2013-11-09 00:13 MST -[+] Nmap scan report for 10.0.0.8 -[+] Host is up (0.086s latency). -[+] Not shown: 999 closed ports -[+] PORT STATE SERVICE -[+] 80/tcp open http -[+] MAC Address: 00:13:02:A6:8F:12 (Intel Corporate) -[+] Device type: general purpose -[+] Running: Linux 2.6.X|3.X -[+] OS CPE: cpe:/o:linux:linux_kernel:2.6 cpe:/o:linux:linux_kernel:3 -[+] OS details: Linux 2.6.32 - 3.9 -[+] Network Distance: 1 hop -[+] OS detection performed. Please report any incorrect results at http://nmap.org/submit/ . -[+] Nmap done: 1 IP address (1 host up) scanned in 6.18 seconds From 0e4ec27353f8ef7f9055ae29facebcb37ef73f7b Mon Sep 17 00:00:00 2001 From: DanMcInerney Date: Sat, 9 Nov 2013 01:50:35 -0700 Subject: [PATCH 2/4] minor --- LANs.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/LANs.py b/LANs.py index ec6815e..e32fdff 100755 --- a/LANs.py +++ b/LANs.py @@ -816,12 +816,15 @@ def print_vars(DHCPsrvr, dnsIP, local_domain, routerIP, victimIP): #Enable IP forwarding and flush possibly conflicting iptables rules def setup(victimMAC): - ipfwd = Popen(['/bin/cat', '/proc/sys/net/ipv4/ip_forward'], stdout=PIPE, stderr=DN) - if ipfwd.communicate()[0] != '1\n': - ipf = open('/proc/sys/net/ipv4/ip_forward', 'r+') +# ipfwd = Popen(['/bin/cat', '/proc/sys/net/ipv4/ip_forward'], stdout=PIPE, stderr=DN) +# if ipfwd.communicate()[0] != '1\n': + + ipf = open('/proc/sys/net/ipv4/ip_forward', 'rw+') + ipfread = ipf.read() + if '0' in ipfread: ipf.write('1\n') ipf.close() - print '[*] Enabled IP forwarding' + print '[*] Enabled IP forwarding' os.system('/sbin/iptables -F') os.system('/sbin/iptables -X') os.system('/sbin/iptables -t nat -F') From c20bbef81b7b0b0acb835a300ac552fb95c4208d Mon Sep 17 00:00:00 2001 From: AMednyy Date: Sat, 9 Nov 2013 12:54:27 +0400 Subject: [PATCH 3/4] Patch for right determination of IPprefix if have more than one network interface. --- LANs.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/LANs.py b/LANs.py index a0a1b4f..47875a6 100755 --- a/LANs.py +++ b/LANs.py @@ -905,6 +905,9 @@ def main(): #Find the gateway and interface ipr = Popen(['/sbin/ip', 'route'], stdout=PIPE, stderr=DN) ipr = ipr.communicate()[0] + iprs = ipr.split('\n') + for route in range(1,len(iprs)): + iprs[route]=iprs[route].split() ipr = repr(ipr).split(' ') routerIP = ipr[2] IPprefix = ipr[8][2:] @@ -912,7 +915,11 @@ def main(): interface = args.interface else: interface = ipr[4] - + for ip in iprs: + for i in ip: + if i == interface: + IPprefix=ip[0] + break if args.ipaddress: victimIP = args.ipaddress else: From 309e823d551d8ad16a40fbaf9e61c388cd72a542 Mon Sep 17 00:00:00 2001 From: DanMcInerney Date: Sat, 9 Nov 2013 09:05:36 -0700 Subject: [PATCH 4/4] fixed monmode error --- LANs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LANs.py b/LANs.py index e32fdff..c9f7f71 100755 --- a/LANs.py +++ b/LANs.py @@ -797,7 +797,7 @@ class active_users(): promisc = promiscSearch.communicate()[0] monmodeSearch = re.search('monitor mode enabled on (.+)\)', promisc) self.monmode = monmodeSearch.group(1) - except OSError, e: + except: exit('[-] Enabling monitor mode failed, do you have aircrack-ng installed?') sniff(iface=self.monmode, prn=self.pkt_cb, store=0)