mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-07-07 13:32:18 -07:00
initial commit
This commit is contained in:
parent
fbf31c220a
commit
6fa335183c
37 changed files with 2698 additions and 0 deletions
24
plugins/CacheKill.py
Normal file
24
plugins/CacheKill.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
from plugins.plugin import Plugin
|
||||
|
||||
class CacheKill(Plugin):
|
||||
name = "CacheKill Plugin"
|
||||
optname = "cachekill"
|
||||
desc = "Kills page caching by modifying headers"
|
||||
implements = ["handleHeader","connectionMade"]
|
||||
has_opts = True
|
||||
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):
|
||||
'''Handles all response headers'''
|
||||
request.client.headers['Expires'] = "0"
|
||||
request.client.headers['Cache-Control'] = "no-cache"
|
||||
|
||||
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] = ""
|
Loading…
Add table
Add a link
Reference in a new issue