mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-07-06 21:12:16 -07:00
code cleanup on all plugins, disabled annoying "Starting new HTTP Connection" log message, added BeefAutorun plugin and beefapi lib
This commit is contained in:
parent
e7cc6316f1
commit
73e7ca2f3d
17 changed files with 409 additions and 240 deletions
|
@ -1,24 +1,25 @@
|
|||
from plugins.plugin import Plugin
|
||||
|
||||
|
||||
class CacheKill(Plugin):
|
||||
name = "CacheKill Plugin"
|
||||
optname = "cachekill"
|
||||
desc = "Kills page caching by modifying headers"
|
||||
implements = ["handleHeader","connectionMade"]
|
||||
implements = ["handleHeader", "connectionMade"]
|
||||
has_opts = True
|
||||
bad_headers = ['if-none-match','if-modified-since']
|
||||
|
||||
def add_options(self,options):
|
||||
bad_headers = ['if-none-match', 'if-modified-since']
|
||||
|
||||
def add_options(self, options):
|
||||
options.add_argument("--preserve-cookies", action="store_true", help="Preserve cookies (will allow caching in some situations).")
|
||||
|
||||
def handleHeader(self,request,key,value):
|
||||
|
||||
def handleHeader(self, request, key, value):
|
||||
'''Handles all response headers'''
|
||||
request.client.headers['Expires'] = "0"
|
||||
request.client.headers['Cache-Control'] = "no-cache"
|
||||
|
||||
def connectionMade(self,request):
|
||||
|
||||
def connectionMade(self, request):
|
||||
'''Handles outgoing request'''
|
||||
request.headers['Pragma'] = 'no-cache'
|
||||
for h in self.bad_headers:
|
||||
if h in request.headers:
|
||||
request.headers[h] = ""
|
||||
request.headers[h] = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue