Skip to content

Instantly share code, notes, and snippets.

@lovemyliwu
Last active July 4, 2020 04:13
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 lovemyliwu/62e1eec874d8653abf1da2d10647ed6c to your computer and use it in GitHub Desktop.
Save lovemyliwu/62e1eec874d8653abf1da2d10647ed6c to your computer and use it in GitHub Desktop.
from mitmproxy import ctx
class Replacer:
def __init__(self):
self.num = 0
def response(self, flow):
self.num = self.num + 1
flow.response.content = flow.response.content.replace('知道'.encode(), '知道个屁'.encode())
ctx.log.info(f"We've replaced {self.num} flows")
addons = [
Replacer()
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment