Update mitmf.py

Added multi filter support
This commit is contained in:
hackereg35 2016-11-03 15:55:13 +02:00 committed by GitHub
parent 2dc1dd4f12
commit 726c823628

View file

@ -59,7 +59,7 @@ sgroup.add_argument("-r", '--read-pcap', type=str, help='Parse specified pcap fo
sgroup.add_argument("-l", dest='listen_port', type=int, metavar="PORT", default=10000, help="Port to listen on (default 10000)") sgroup.add_argument("-l", dest='listen_port', type=int, metavar="PORT", default=10000, help="Port to listen on (default 10000)")
sgroup.add_argument("-f", "--favicon", action="store_true", help="Substitute a lock favicon on secure requests.") sgroup.add_argument("-f", "--favicon", action="store_true", help="Substitute a lock favicon on secure requests.")
sgroup.add_argument("-k", "--killsessions", action="store_true", help="Kill sessions in progress.") sgroup.add_argument("-k", "--killsessions", action="store_true", help="Kill sessions in progress.")
sgroup.add_argument("-F", "--filter", type=str, help='Filter to apply to incoming traffic') sgroup.add_argument("-F", "--filter", type=str, help='Filter to apply to incoming traffic', nargs='+')
#Initialize plugins and pass them the parser NameSpace object #Initialize plugins and pass them the parser NameSpace object
plugins = [plugin(parser) for plugin in plugin.Plugin.__subclasses__()] plugins = [plugin(parser) for plugin in plugin.Plugin.__subclasses__()]
@ -126,7 +126,8 @@ if options.filter:
from core.packetfilter import PacketFilter from core.packetfilter import PacketFilter
pfilter = PacketFilter(options.filter) pfilter = PacketFilter(options.filter)
print "|_ PacketFilter online" print "|_ PacketFilter online"
print " |_ Applying filter {} to incoming packets".format(options.filter) for filter in options.filter:
print " |_ Applying filter {} to incoming packets".format(filter)
try: try:
pfilter.start() pfilter.start()
except KeyboardInterrupt: except KeyboardInterrupt:
@ -179,4 +180,4 @@ else:
reactor.run() reactor.run()
print "\n" print "\n"
shutdown() shutdown()