fixed logging in responder and some plugins

This commit is contained in:
byt3bl33d3r 2015-04-12 19:00:50 +02:00
commit 5b0a15ea56
10 changed files with 36 additions and 14 deletions

View file

@ -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):

View file

@ -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):

View file

@ -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: