Skip to content

Commit

Permalink
fix smtp starttls inject
Browse files Browse the repository at this point in the history
  • Loading branch information
tintinweb committed Feb 13, 2016
1 parent 8e03217 commit 9ba887f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions striptls/striptls.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,17 +423,22 @@ def mangle_client_data(session, data, rewrite):
return data

class InjectCommand:
''' Append command to STARTTLS\r\n.
''' 1) Append command to STARTTLS\r\n.
2) untrusted intercept to check if we get an invalid command response from server
'''
@staticmethod
def mangle_server_data(session, data, rewrite):
return data
@staticmethod
def mangle_client_data(session, data, rewrite):
if "STARTTLS" in data:
#data += "WTF\r\n"
data += "INJECTED_INVALID_COMMAND\r\n"
#logging.debug("%s [client] => [server][mangled] %s"%(session,repr(data)))
Vectors.SMTP.UntrustedIntercept.mangle_client_data(session, data, rewrite)
try:
Vectors.SMTP.UntrustedIntercept.mangle_client_data(session, data, rewrite)
except ssl.SSLEOFError, se:
logging.info("%s - Server failed to negotiate SSL with Exception: %s"%(session, repr(se)))
session.close()
elif "mail from" in data.lower():
rewrite.set_result(session, True)
return data
Expand Down

0 comments on commit 9ba887f

Please sign in to comment.