mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-08-14 02:37:06 -07:00
- Whole framework now requires root privs
- Added an internal DNS server - Proxy can now use our custom DNS server (DNSChef) or Twisted's - Removed priv check from plugins - DNS spoofing fully re-written - Iptables rules are now checked and set between plugins
This commit is contained in:
parent
c8732d60eb
commit
9a1c3b0ec4
22 changed files with 129 additions and 90 deletions
34
mitmf.py
34
mitmf.py
|
@ -36,14 +36,6 @@ from scapy.all import get_if_addr, get_if_hwaddr
|
|||
from plugins import *
|
||||
plugin_classes = plugin.Plugin.__subclasses__()
|
||||
|
||||
try:
|
||||
import netfilterqueue
|
||||
if netfilterqueue.VERSION[1] is not 6:
|
||||
print "[-] Wrong version of NetfilterQueue library installed!"
|
||||
print "[-] Download it from here https://github.com/fqrouter/python-netfilterqueue and manually install it!"
|
||||
except ImportError:
|
||||
print "[-] NetfilterQueue library missing! DNS tampering will not work"
|
||||
|
||||
try:
|
||||
import user_agents
|
||||
except ImportError:
|
||||
|
@ -52,9 +44,13 @@ except ImportError:
|
|||
mitmf_version = "0.9.6"
|
||||
sslstrip_version = "0.9"
|
||||
sergio_version = "0.2.1"
|
||||
dnschef_version = "0.4"
|
||||
|
||||
Banners().printBanner()
|
||||
|
||||
if os.geteuid() != 0:
|
||||
sys.exit("[-] When man-in-the-middle you want, run as r00t you will, hmm?")
|
||||
|
||||
parser = argparse.ArgumentParser(description="MITMf v%s - Framework for MITM attacks" % mitmf_version, version=mitmf_version, usage='', epilog="Use wisely, young Padawan.",fromfile_prefix_chars='@')
|
||||
#add MITMf options
|
||||
mgroup = parser.add_argument_group("MITMf", "Options for MITMf")
|
||||
|
@ -114,15 +110,6 @@ if config_args:
|
|||
sys.argv.append(arg)
|
||||
args = parser.parse_args()
|
||||
|
||||
#Check to see if called plugins require elevated privs
|
||||
try:
|
||||
for p in plugins:
|
||||
if (vars(args)[p.optname] is True) and (p.req_root is True):
|
||||
if os.geteuid() != 0:
|
||||
sys.exit("[-] %s plugin requires root privileges" % p.name)
|
||||
except AttributeError:
|
||||
sys.exit("[-] %s plugin is missing the req_root attribute" % p.name)
|
||||
|
||||
####################################################################################################
|
||||
|
||||
# Here we check for some variables that are very commonly used, and pass them down to the plugins
|
||||
|
@ -189,8 +176,18 @@ else:
|
|||
|
||||
from core.sslstrip.StrippingProxy import StrippingProxy
|
||||
from core.sslstrip.URLMonitor import URLMonitor
|
||||
from libs.dnschef.dnschef import DNSChef
|
||||
|
||||
URLMonitor.getInstance().setFaviconSpoofing(args.favicon)
|
||||
URLMonitor.getInstance().setResolver(args.configfile['MITMf']['DNS']['resolver'])
|
||||
URLMonitor.getInstance().setResolverPort(args.configfile['MITMf']['DNS']['port'])
|
||||
|
||||
DNSChef.getInstance().setCoreVars(args.configfile['MITMf']['DNS'])
|
||||
if args.configfile['MITMf']['DNS']['tcp'].lower() == 'on':
|
||||
DNSChef.getInstance().startTCP()
|
||||
else:
|
||||
DNSChef.getInstance().startUDP()
|
||||
|
||||
CookieCleaner.getInstance().setEnabled(args.killsessions)
|
||||
ProxyPlugins.getInstance().setPlugins(load)
|
||||
|
||||
|
@ -207,7 +204,8 @@ else:
|
|||
|
||||
print "|"
|
||||
print "|_ Sergio-Proxy v%s online" % sergio_version
|
||||
print "|_ SSLstrip v%s by Moxie Marlinspike running...\n" % sslstrip_version
|
||||
print "|_ SSLstrip v%s by Moxie Marlinspike online" % sslstrip_version
|
||||
print "|_ DNSChef v%s online\n" % dnschef_version
|
||||
|
||||
reactor.run()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue