Skip to content

Instantly share code, notes, and snippets.

@frigginglorious
Last active March 14, 2023 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frigginglorious/9d92339aa433405afd3f457c4ae0fe1b to your computer and use it in GitHub Desktop.
Save frigginglorious/9d92339aa433405afd3f457c4ae0fe1b to your computer and use it in GitHub Desktop.
AndroidReqHackMitmProxy
AndroidReqHackMitmProxy
Note: without a rooted phone, YMMV
Steps -
brew install mitmproxy
set wifi proxy
(install certs)
npm install -g apk-mitm
brew install scrcpy
mitmproxy -s jpgReplacer.py
from mitmproxy import http
import logging
def response(flow):
pic = flow.request.pretty_url[-4:]
if pic == ".jpg":
logging.info(flow.request.pretty_url)
img = open("me.jpg", "rb").read()
flow.response.content = img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment