mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-07-06 04:52:22 -07:00
Update packetfilter.py
Added multi filter support
This commit is contained in:
parent
2dc1dd4f12
commit
37937f74ba
1 changed files with 7 additions and 6 deletions
|
@ -26,11 +26,12 @@ class PacketFilter:
|
||||||
data = pkt.get_payload()
|
data = pkt.get_payload()
|
||||||
packet = IP(data)
|
packet = IP(data)
|
||||||
|
|
||||||
try:
|
for filter in self.filter:
|
||||||
execfile(self.filter)
|
try:
|
||||||
except Exception:
|
execfile(i)
|
||||||
log.debug("Error occurred in filter")
|
except Exception:
|
||||||
print_exc()
|
log.debug("Error occurred in filter", filter)
|
||||||
|
print_exc()
|
||||||
|
|
||||||
pkt.set_payload(str(packet)) #set the packet content to our modified version
|
pkt.set_payload(str(packet)) #set the packet content to our modified version
|
||||||
pkt.accept() #accept the packet
|
pkt.accept() #accept the packet
|
||||||
|
@ -38,4 +39,4 @@ class PacketFilter:
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.nfqueue.unbind()
|
self.nfqueue.unbind()
|
||||||
set_ip_forwarding(0)
|
set_ip_forwarding(0)
|
||||||
iptables().flush()
|
iptables().flush()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue