mirror of
https://github.com/DanMcInerney/LANs.py.git
synced 2025-07-15 01:23:49 -07:00
minor
This commit is contained in:
parent
6af7e18995
commit
0e4ec27353
1 changed files with 7 additions and 4 deletions
11
LANs.py
11
LANs.py
|
@ -816,12 +816,15 @@ def print_vars(DHCPsrvr, dnsIP, local_domain, routerIP, victimIP):
|
||||||
|
|
||||||
#Enable IP forwarding and flush possibly conflicting iptables rules
|
#Enable IP forwarding and flush possibly conflicting iptables rules
|
||||||
def setup(victimMAC):
|
def setup(victimMAC):
|
||||||
ipfwd = Popen(['/bin/cat', '/proc/sys/net/ipv4/ip_forward'], stdout=PIPE, stderr=DN)
|
# ipfwd = Popen(['/bin/cat', '/proc/sys/net/ipv4/ip_forward'], stdout=PIPE, stderr=DN)
|
||||||
if ipfwd.communicate()[0] != '1\n':
|
# if ipfwd.communicate()[0] != '1\n':
|
||||||
ipf = open('/proc/sys/net/ipv4/ip_forward', 'r+')
|
|
||||||
|
ipf = open('/proc/sys/net/ipv4/ip_forward', 'rw+')
|
||||||
|
ipfread = ipf.read()
|
||||||
|
if '0' in ipfread:
|
||||||
ipf.write('1\n')
|
ipf.write('1\n')
|
||||||
ipf.close()
|
ipf.close()
|
||||||
print '[*] Enabled IP forwarding'
|
print '[*] Enabled IP forwarding'
|
||||||
os.system('/sbin/iptables -F')
|
os.system('/sbin/iptables -F')
|
||||||
os.system('/sbin/iptables -X')
|
os.system('/sbin/iptables -X')
|
||||||
os.system('/sbin/iptables -t nat -F')
|
os.system('/sbin/iptables -t nat -F')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue