diff --git a/config/mitmf.conf b/config/mitmf.conf index 685e8d9..9339e9e 100644 --- a/config/mitmf.conf +++ b/config/mitmf.conf @@ -99,7 +99,6 @@ IMAP = On HTTP = On HTTPS = On - DNS = On LDAP = On #Set a custom challenge diff --git a/core/sslstrip/ClientRequest.py b/core/sslstrip/ClientRequest.py index b31d55d..017118c 100644 --- a/core/sslstrip/ClientRequest.py +++ b/core/sslstrip/ClientRequest.py @@ -113,7 +113,7 @@ class ClientRequest(Request): if os.path.exists(scriptPath): return scriptPath - logging.warning("Error: Could not find lock.ico") + mitmf_logger.warning("Error: Could not find lock.ico") return "lock.ico" def handleHostResolvedSuccess(self, address): diff --git a/core/sslstrip/ServerConnection.py b/core/sslstrip/ServerConnection.py index 43ec557..72e3205 100644 --- a/core/sslstrip/ServerConnection.py +++ b/core/sslstrip/ServerConnection.py @@ -92,7 +92,7 @@ class ServerConnection(HTTPClient): elif 'keylog' in self.uri: self.plugins.hook() else: - logging.warning("%s %s Data (%s):\n%s" % (self.client.getClientIP(), self.getPostPrefix(), self.headers['host'], self.postData)) + mitmf_logger.warning("%s %s Data (%s):\n%s" % (self.client.getClientIP(), self.getPostPrefix(), self.headers['host'], self.postData)) self.transport.write(self.postData) def connectionMade(self): diff --git a/core/utils.py b/core/utils.py index 435bafa..233f959 100644 --- a/core/utils.py +++ b/core/utils.py @@ -21,6 +21,17 @@ import os import random +import linecache +import sys + +def PrintException(): + exc_type, exc_obj, tb = sys.exc_info() + f = tb.tb_frame + lineno = tb.tb_lineno + filename = f.f_code.co_filename + linecache.checkcache(filename) + line = linecache.getline(filename, lineno, f.f_globals) + return '({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj) class SystemConfig: diff --git a/libs/responder b/libs/responder index 24c6e84..41b3b7b 160000 --- a/libs/responder +++ b/libs/responder @@ -1 +1 @@ -Subproject commit 24c6e8434b08a97e9b8033cd1f2bc9be30a75982 +Subproject commit 41b3b7b2fd72edeb5adf29ecf5fff5053844c182 diff --git a/mitmf.py b/mitmf.py index d1698b6..42e8391 100755 --- a/mitmf.py +++ b/mitmf.py @@ -28,6 +28,7 @@ from twisted.internet import reactor from core.sslstrip.CookieCleaner import CookieCleaner from core.sergioproxy.ProxyPlugins import ProxyPlugins from core.utils import Banners +from core.utils import PrintException from configobj import ConfigObj logging.getLogger("scapy.runtime").setLevel(logging.ERROR) #Gets rid of IPV6 Error when importing scapy @@ -166,8 +167,8 @@ for p in plugins: for line in p.tree_output: print "| |_ %s" % line - except Exception, e: - print "[-] Error loading plugin %s: %s" % (p.name, str(e)) + except Exception: + print "[-] Error loading plugin %s: %s" % (p.name, PrintException()) #Plugins are ready to go, start MITMf if args.disproxy: diff --git a/plugins/FilePwn.py b/plugins/FilePwn.py index e437d84..2d10897 100644 --- a/plugins/FilePwn.py +++ b/plugins/FilePwn.py @@ -292,7 +292,7 @@ class FilePwn(Plugin): except Exception as e: print 'Exception', str(e) - logging.warning("EXCEPTION IN binaryGrinder %s", str(e)) + mitmf_logger.warning("EXCEPTION IN binaryGrinder %s", str(e)) return None def tar_files(self, aTarFileBytes, formatt): diff --git a/plugins/JsKeylogger.py b/plugins/JsKeylogger.py index 25139f1..8acfe96 100644 --- a/plugins/JsKeylogger.py +++ b/plugins/JsKeylogger.py @@ -22,6 +22,8 @@ from plugins.plugin import Plugin from plugins.Inject import Inject import logging +mitmf_logger = logging.getLogger('mitmf') + class jskeylogger(Inject, Plugin): name = "Javascript Keylogger" optname = "jskeylogger" @@ -57,14 +59,14 @@ class jskeylogger(Inject, Plugin): try: nice += n.decode('hex') except: - logging.warning("%s ERROR decoding char: %s" % (request.client.getClientIP(), n)) + mitmf_logger.warning("%s ERROR decoding char: %s" % (request.client.getClientIP(), n)) #try: # input_field = input_field.decode('hex') #except: - # logging.warning("%s ERROR decoding input field name: %s" % (request.client.getClientIP(), input_field)) + # mitmf_logger.warning("%s ERROR decoding input field name: %s" % (request.client.getClientIP(), input_field)) - logging.warning("%s [%s] Field: %s Keys: %s" % (request.client.getClientIP(), request.headers['host'], input_field, nice)) + mitmf_logger.warning("%s [%s] Field: %s Keys: %s" % (request.client.getClientIP(), request.headers['host'], input_field, nice)) def msf_keylogger(self): #Stolen from the Metasploit module http_javascript_keylogger diff --git a/plugins/Responder.py b/plugins/Responder.py index bada0ef..235cbdf 100644 --- a/plugins/Responder.py +++ b/plugins/Responder.py @@ -23,7 +23,7 @@ import os import threading from plugins.plugin import Plugin -from libs.responder.Responder import start_responder +from libs.responder.Responder import ResponderMITMf from core.sslstrip.DnsCache import DnsCache from twisted.internet import reactor @@ -48,7 +48,16 @@ class Responder(Plugin): if options.Analyse: self.tree_output.append("Responder is in analyze mode. No NBT-NS, LLMNR, MDNS requests will be poisoned") - start_responder(options, config) + resp = ResponderMITMf() + resp.setCoreVars(options, config) + + result = resp.AnalyzeICMPRedirect() + if result: + for line in result: + self.tree_output.append(line) + + resp.printDebugInfo() + resp.start() def plugin_reactor(self, strippingFactory): reactor.listenTCP(3141, strippingFactory) diff --git a/plugins/Sniffer.py b/plugins/Sniffer.py index d481be1..ca0ba51 100644 --- a/plugins/Sniffer.py +++ b/plugins/Sniffer.py @@ -106,7 +106,7 @@ class Sniffer(Plugin): mitmf_logger.info(request.clientInfo + "is querying %s for: %s" % (request.headers['host'], query)) except Exception, e: error = str(e) - logging.warning(request.clientInfo + "Error parsing search query %s" % error) + mitmf_logger.warning(request.clientInfo + "Error parsing search query %s" % error) def captureURLCreds(self, request): ''' @@ -131,7 +131,7 @@ class Sniffer(Plugin): password = search.group() if (username and password): - logging.warning(request.clientInfo + "Possible Credentials (Method: %s, Host: %s):\n%s" % (request.command, request.headers['host'], url)) + mitmf_logger.warning(request.clientInfo + "Possible Credentials (Method: %s, Host: %s):\n%s" % (request.command, request.headers['host'], url)) class NetCreds: