Preventing the analyzed device to reach TinyCheck
This commit is contained in:
parent
4488a52631
commit
e4d63a7ef5
@ -290,8 +290,14 @@ class Network(object):
|
|||||||
try:
|
try:
|
||||||
sp.Popen("echo 1 > /proc/sys/net/ipv4/ip_forward",
|
sp.Popen("echo 1 > /proc/sys/net/ipv4/ip_forward",
|
||||||
shell=True).wait()
|
shell=True).wait()
|
||||||
|
|
||||||
|
# Enable forwarding.
|
||||||
sp.Popen(["iptables", "-A", "POSTROUTING", "-t", "nat", "-o",
|
sp.Popen(["iptables", "-A", "POSTROUTING", "-t", "nat", "-o",
|
||||||
self.iface_out, "-j", "MASQUERADE"]).wait()
|
self.iface_out, "-j", "MASQUERADE"]).wait()
|
||||||
|
|
||||||
|
# Prevent the device to reach the 80 of TinyCheck.
|
||||||
|
sp.Popen(["iptables", "-A", "INPUT", "-i", self.iface_in, "-d",
|
||||||
|
"192.168.100.1", "-p", "tcp", "--dport", "80", "-j" "DROP"]).wait()
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user