Skip to content

Instantly share code, notes, and snippets.

@lovemyliwu
Last active July 4, 2020 04:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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