From 0e4ec27353f8ef7f9055ae29facebcb37ef73f7b Mon Sep 17 00:00:00 2001 From: DanMcInerney Date: Sat, 9 Nov 2013 01:50:35 -0700 Subject: [PATCH] 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')