mirror of
https://github.com/byt3bl33d3r/MITMf.git
synced 2025-07-06 21:12:16 -07:00
Fixed a bug in SSLstrip+ code, when redirecting to certain sites
Created a wrapper class around Msfrpc to limit code re-use when interacting with msf
This commit is contained in:
parent
b9371f7cdc
commit
563a8d37c1
10 changed files with 141 additions and 126 deletions
|
@ -105,7 +105,13 @@ class ServerConnection(HTTPClient):
|
|||
|
||||
def connectionMade(self):
|
||||
mitmf_logger.debug("[ServerConnection] HTTP connection made.")
|
||||
self.clientInfo = hap.simple_detect(self.headers['user-agent'])
|
||||
try:
|
||||
self.clientInfo = hap.simple_detect(self.headers['user-agent'])
|
||||
except KeyError as e:
|
||||
mitmf_logger.debug("[ServerConnection] Client didn't send UA with request")
|
||||
self.clientInfo = None
|
||||
pass
|
||||
|
||||
self.plugins.hook()
|
||||
self.sendRequest()
|
||||
self.sendHeaders()
|
||||
|
@ -214,9 +220,7 @@ class ServerConnection(HTTPClient):
|
|||
nuevaurl=self.urlMonitor.addSecureLink(self.client.getClientIP(), url)
|
||||
mitmf_logger.debug("[ServerConnection][HSTS] Replacing {} => {}".format(url,nuevaurl))
|
||||
sustitucion[url] = nuevaurl
|
||||
#data.replace(url,nuevaurl)
|
||||
|
||||
#data = self.urlMonitor.DataReemplazo(data)
|
||||
if len(sustitucion)>0:
|
||||
dregex = re.compile("({})".format("|".join(map(re.escape, sustitucion.keys()))))
|
||||
data = dregex.sub(lambda x: str(sustitucion[x.string[x.start() :x.end()]]), data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue