mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-08-14 02:37:06 -07:00
initial commit
This commit is contained in:
parent
fbf31c220a
commit
6fa335183c
37 changed files with 2698 additions and 0 deletions
47
sslstrip/DummyResponseTamperer.py
Normal file
47
sslstrip/DummyResponseTamperer.py
Normal file
|
@ -0,0 +1,47 @@
|
|||
# Copyright (c) 2004-2009 Moxie Marlinspike, Krzysztof Kotowicz
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
# USA
|
||||
#
|
||||
|
||||
import logging
|
||||
from sslstrip.URLMonitor import URLMonitor
|
||||
|
||||
class DummyResponseTamperer:
|
||||
|
||||
'''
|
||||
DummyResponseTamperer is an exemplary class for server response tampering.
|
||||
'''
|
||||
|
||||
def __init__(self, config):
|
||||
self.config = config
|
||||
self.urlMonitor = URLMonitor.getInstance()
|
||||
logging.log(logging.DEBUG, "Tampering enabled.")
|
||||
|
||||
def isEnabled(self):
|
||||
return self.config["enabled"]
|
||||
|
||||
def tamper(self, url, data, headers, req_headers, ip):
|
||||
if not self.isEnabled():
|
||||
return data
|
||||
|
||||
# headers manipulation - see http://twistedmatrix.com/documents/10.1.0/api/twisted.web.http_headers.Headers.html
|
||||
# setting headers
|
||||
#headers.setRawHeaders("X-aaa", ["aaa"])
|
||||
# getting headers
|
||||
#headers.getRawHeaders("Content-Type")
|
||||
|
||||
return data
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue