diff --git a/libs/banners.py b/libs/banners.py new file mode 100644 index 0000000..67b718a --- /dev/null +++ b/libs/banners.py @@ -0,0 +1,79 @@ +#! /usr/bin/env python2.7 +# -*- coding: utf-8 -*- + +import random + +banner1 = """ + __ __ ___ .--. __ __ ___ +| |/ `.' `. |__| | |/ `.' `. _.._ +| .-. .-. '.--. .| | .-. .-. ' .' .._| +| | | | | || | .' |_ | | | | | | | ' +| | | | | || | .' || | | | | | __| |__ +| | | | | || |'--. .-'| | | | | ||__ __| +| | | | | || | | | | | | | | | | | +|__| |__| |__||__| | | |__| |__| |__| | | + | '.' | | + | / | | + `'-' |_| +""" + +banner2= """ + ███▄ ▄███▓ ██▓▄▄▄█████▓ ███▄ ▄███▓ █████▒ +▓██▒▀█▀ ██▒▓██▒▓ ██▒ ▓▒▓██▒▀█▀ ██▒▓██ ▒ +▓██ ▓██░▒██▒▒ ▓██░ ▒░▓██ ▓██░▒████ ░ +▒██ ▒██ ░██░░ ▓██▓ ░ ▒██ ▒██ ░▓█▒ ░ +▒██▒ ░██▒░██░ ▒██▒ ░ ▒██▒ ░██▒░▒█░ +░ ▒░ ░ ░░▓ ▒ ░░ ░ ▒░ ░ ░ ▒ ░ +░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ +░ ░ ▒ ░ ░ ░ ░ ░ ░ + ░ ░ ░ +""" + +banner3 = """ + ▄▄▄▄███▄▄▄▄ ▄█ ███ ▄▄▄▄███▄▄▄▄ ▄████████ + ▄██▀▀▀███▀▀▀██▄ ███ ▀█████████▄ ▄██▀▀▀███▀▀▀██▄ ███ ███ + ███ ███ ███ ███▌ ▀███▀▀██ ███ ███ ███ ███ █▀ + ███ ███ ███ ███▌ ███ ▀ ███ ███ ███ ▄███▄▄▄ + ███ ███ ███ ███▌ ███ ███ ███ ███ ▀▀███▀▀▀ + ███ ███ ███ ███ ███ ███ ███ ███ ███ + ███ ███ ███ ███ ███ ███ ███ ███ ███ + ▀█ ███ █▀ █▀ ▄████▀ ▀█ ███ █▀ ███ +""" + +banner4 = """ +MMMMMMMM MMMMMMMMIIIIIIIIIITTTTTTTTTTTTTTTTTTTTTTTMMMMMMMM MMMMMMMM ffffffffffffffff +M:::::::M M:::::::MI::::::::IT:::::::::::::::::::::TM:::::::M M:::::::M f::::::::::::::::f +M::::::::M M::::::::MI::::::::IT:::::::::::::::::::::TM::::::::M M::::::::M f::::::::::::::::::f +M:::::::::M M:::::::::MII::::::IIT:::::TT:::::::TT:::::TM:::::::::M M:::::::::M f::::::fffffff:::::f +M::::::::::M M::::::::::M I::::I TTTTTT T:::::T TTTTTTM::::::::::M M::::::::::M f:::::f ffffff +M:::::::::::M M:::::::::::M I::::I T:::::T M:::::::::::M M:::::::::::M f:::::f +M:::::::M::::M M::::M:::::::M I::::I T:::::T M:::::::M::::M M::::M:::::::Mf:::::::ffffff +M::::::M M::::M M::::M M::::::M I::::I T:::::T M::::::M M::::M M::::M M::::::Mf::::::::::::f +M::::::M M::::M::::M M::::::M I::::I T:::::T M::::::M M::::M::::M M::::::Mf::::::::::::f +M::::::M M:::::::M M::::::M I::::I T:::::T M::::::M M:::::::M M::::::Mf:::::::ffffff +M::::::M M:::::M M::::::M I::::I T:::::T M::::::M M:::::M M::::::M f:::::f +M::::::M MMMMM M::::::M I::::I T:::::T M::::::M MMMMM M::::::M f:::::f +M::::::M M::::::MII::::::II TT:::::::TT M::::::M M::::::Mf:::::::f +M::::::M M::::::MI::::::::I T:::::::::T M::::::M M::::::Mf:::::::f +M::::::M M::::::MI::::::::I T:::::::::T M::::::M M::::::Mf:::::::f +MMMMMMMM MMMMMMMMIIIIIIIIII TTTTTTTTTTT MMMMMMMM MMMMMMMMfffffffff +""" + +banner5 = """ + ___ ___ ___ + /\ \ /\ \ /\__\ + |::\ \ ___ ___ |::\ \ /:/ _/_ + |:|:\ \ /\__\ /\__\ |:|:\ \ /:/ /\__\ + __|:|\:\ \ /:/__/ /:/ / __|:|\:\ \ /:/ /:/ / + /::::|_\:\__\ /::\ \ /:/__/ /::::|_\:\__\ /:/_/:/ / + \:\~~\ \/__/ \/\:\ \__ /::\ \ \:\~~\ \/__/ \:\/:/ / + \:\ \ ~~\:\/\__\ /:/\:\ \ \:\ \ \::/__/ + \:\ \ \::/ / \/__\:\ \ \:\ \ \:\ \ + \:\__\ /:/ / \:\__\ \:\__\ \:\__\ + \/__/ \/__/ \/__/ \/__/ \/__/ + +""" + +def get(): + banners = [banner1, banner2, banner3, banner4, banner5] + return random.choice(banners) diff --git a/libs/sslstrip/ClientRequest.py b/libs/sslstrip/ClientRequest.py index 73f38fd..a163070 100644 --- a/libs/sslstrip/ClientRequest.py +++ b/libs/sslstrip/ClientRequest.py @@ -125,6 +125,10 @@ class ClientRequest(Request): if self.hsts: + #Original code from SSLstrip+ + #Saying that this is unreadible is an understatement + #KILL IT WITH FIRE!! + real = self.urlMonitor.real patchDict = self.urlMonitor.patchDict diff --git a/libs/sslstrip/ServerConnection.py b/libs/sslstrip/ServerConnection.py index b2669aa..0540511 100644 --- a/libs/sslstrip/ServerConnection.py +++ b/libs/sslstrip/ServerConnection.py @@ -185,6 +185,10 @@ class ServerConnection(HTTPClient): def replaceSecureLinks(self, data): if self.hsts: + #Original code from SSLstrip+ + #Saying that this is unreadible is an understatement + #KILL IT WITH FIRE!! + sustitucion = {} patchDict = self.urlMonitor.patchDict if len(patchDict)>0: diff --git a/libs/sslstrip/URLMonitor.py b/libs/sslstrip/URLMonitor.py index 794be83..b327a85 100644 --- a/libs/sslstrip/URLMonitor.py +++ b/libs/sslstrip/URLMonitor.py @@ -53,6 +53,13 @@ class URLMonitor: return (client,url) in self.strippedURLs def writeClientLog(self, client, headers, message): + ''' + This isn't used for now.. the point was to log every clients + data to a seperate file + + Don't see how useful it could be though + ''' + if not os.path.exists("./logs"): os.makedirs("./logs") diff --git a/mitmf.py b/mitmf.py index 060bc9b..08a93d4 100755 --- a/mitmf.py +++ b/mitmf.py @@ -5,6 +5,7 @@ from twisted.internet import reactor from libs.sslstrip.CookieCleaner import CookieCleaner from libs.sergioproxy.ProxyPlugins import ProxyPlugins +from libs.banners import get import logging @@ -25,11 +26,14 @@ try: except: print "[-] user_agents library missing! User-Agent parsing will be disabled!" -mitmf_version = "0.9" +mitmf_version = "0.9.5" sslstrip_version = "0.9" sergio_version = "0.2.1" -parser = argparse.ArgumentParser(description="MITMf v%s - Framework for MITM attacks" % mitmf_version, epilog="Use wisely, young Padawan.",fromfile_prefix_chars='@') +banner = get() +print banner + +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") mgroup.add_argument("--log-level", type=str,choices=['debug', 'info'], default="info", help="Specify a log level [default: info]") @@ -137,8 +141,11 @@ for p in plugins: if getattr(args, p.optname): p.initialize(args) load.append(p) - except NotImplementedError: - print "Plugin %s lacked initialize function." % p.name + + if vars(args)[p.optname] is True: + print "|_ %s v%s" % (p.name, p.version) + except Exception, e: + print "[-] Error loading plugin: " + str(e) #Plugins are ready to go, start MITMf if args.disproxy: diff --git a/plugins/Spoof.py b/plugins/Spoof.py index 2707b62..7c135e7 100644 --- a/plugins/Spoof.py +++ b/plugins/Spoof.py @@ -20,7 +20,7 @@ import random class Spoof(Plugin): name = "Spoof" optname = "spoof" - desc = 'Redirect/Modify traffic using ICMP, ARP or DHCP' + desc = "Redirect/Modify traffic using ICMP, ARP or DHCP" version = "0.4" has_opts = True req_root = True diff --git a/requirements.txt b/requirements.txt index 8616a47..4319c70 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,6 +6,7 @@ dnspython user-agents configobj pyyaml +NetfilterQueue >= 0.6 ua-parser Pillow pefile