- Made user_agent lib optional for Kali

This commit is contained in:
byt3bl33d3r 2015-01-22 14:40:39 +01:00
parent 5100458e70
commit b46b4dce97
3 changed files with 11 additions and 6 deletions

@ -1 +1 @@
Subproject commit 303d059c4c2a1ecc19824bd755129152b6ad7fc1
Subproject commit a52a7c00d3af834ac78e224abec84543f584cbf5

View file

@ -19,7 +19,11 @@
import logging, re, string, random, zlib, gzip, StringIO, sys
import plugins
from user_agents import parse
try:
from user_agents import parse
except:
pass
from twisted.web.http import HTTPClient
from URLMonitor import URLMonitor
from libs.sergioproxy.ProxyPlugins import ProxyPlugins
@ -74,8 +78,8 @@ class ServerConnection(HTTPClient):
def sendRequest(self):
if self.command == 'GET':
user_agent = parse(self.headers['user-agent'])
try:
user_agent = parse(self.headers['user-agent'])
self.clientInfo = "%s [type:%s-%s os:%s] " % (self.client.getClientIP(), user_agent.browser.family, user_agent.browser.version[0], user_agent.os.family)
except:
self.clientInfo = "%s " % self.client.getClientIP()

View file

@ -6,13 +6,14 @@ from twisted.internet import reactor
from libs.sslstrip.CookieCleaner import CookieCleaner
from libs.sergioproxy.ProxyPlugins import ProxyPlugins
import sys, logging, traceback, string, os
import sys
import logging
import argparse
try:
import user_agents
except:
sys.exit("[-] user_agents library not installed!")
pass
try:
from configobj import ConfigObj
@ -94,7 +95,7 @@ if __name__ == "__main__":
logging.basicConfig(level=log_level, format="%(asctime)s %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
logFormatter = logging.Formatter("%(asctime)s %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
rootLogger = logging.getLogger()
fileHandler = logging.FileHandler("./logs/mitmf.log")
fileHandler.setFormatter(logFormatter)
rootLogger.addHandler(fileHandler)