mirror of
https://github.com/DanMcInerney/LANs.py.git
synced 2025-07-11 07:37:07 -07:00
Merge branch 'master' of github.com:rroy1590/LANs.py
This commit is contained in:
commit
037056a7ed
1 changed files with 16 additions and 6 deletions
20
LANs.py
20
LANs.py
|
@ -804,7 +804,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)
|
||||
|
@ -823,9 +823,12 @@ 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'
|
||||
|
@ -915,6 +918,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(' ')
|
||||
if args.routerip:
|
||||
routerIP = args.routerip
|
||||
|
@ -925,7 +931,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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue