mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-07-10 07:13:49 -07:00
- Made user_agent lib optional for Kali
This commit is contained in:
parent
5100458e70
commit
b46b4dce97
3 changed files with 11 additions and 6 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 303d059c4c2a1ecc19824bd755129152b6ad7fc1
|
Subproject commit a52a7c00d3af834ac78e224abec84543f584cbf5
|
|
@ -19,7 +19,11 @@
|
||||||
import logging, re, string, random, zlib, gzip, StringIO, sys
|
import logging, re, string, random, zlib, gzip, StringIO, sys
|
||||||
import plugins
|
import plugins
|
||||||
|
|
||||||
from user_agents import parse
|
try:
|
||||||
|
from user_agents import parse
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
from twisted.web.http import HTTPClient
|
from twisted.web.http import HTTPClient
|
||||||
from URLMonitor import URLMonitor
|
from URLMonitor import URLMonitor
|
||||||
from libs.sergioproxy.ProxyPlugins import ProxyPlugins
|
from libs.sergioproxy.ProxyPlugins import ProxyPlugins
|
||||||
|
@ -74,8 +78,8 @@ class ServerConnection(HTTPClient):
|
||||||
|
|
||||||
def sendRequest(self):
|
def sendRequest(self):
|
||||||
if self.command == 'GET':
|
if self.command == 'GET':
|
||||||
user_agent = parse(self.headers['user-agent'])
|
|
||||||
try:
|
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)
|
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:
|
except:
|
||||||
self.clientInfo = "%s " % self.client.getClientIP()
|
self.clientInfo = "%s " % self.client.getClientIP()
|
||||||
|
|
7
mitmf.py
7
mitmf.py
|
@ -6,13 +6,14 @@ from twisted.internet import reactor
|
||||||
from libs.sslstrip.CookieCleaner import CookieCleaner
|
from libs.sslstrip.CookieCleaner import CookieCleaner
|
||||||
from libs.sergioproxy.ProxyPlugins import ProxyPlugins
|
from libs.sergioproxy.ProxyPlugins import ProxyPlugins
|
||||||
|
|
||||||
import sys, logging, traceback, string, os
|
import sys
|
||||||
|
import logging
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import user_agents
|
import user_agents
|
||||||
except:
|
except:
|
||||||
sys.exit("[-] user_agents library not installed!")
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from configobj import ConfigObj
|
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")
|
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")
|
logFormatter = logging.Formatter("%(asctime)s %(message)s", datefmt="%Y-%m-%d %H:%M:%S")
|
||||||
rootLogger = logging.getLogger()
|
rootLogger = logging.getLogger()
|
||||||
|
|
||||||
fileHandler = logging.FileHandler("./logs/mitmf.log")
|
fileHandler = logging.FileHandler("./logs/mitmf.log")
|
||||||
fileHandler.setFormatter(logFormatter)
|
fileHandler.setFormatter(logFormatter)
|
||||||
rootLogger.addHandler(fileHandler)
|
rootLogger.addHandler(fileHandler)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue