Skip to main content

mitm with scripts

create file with code for example i create python file test.py

import json

def response(flow):
	url = flow.request.pretty_url

	if "https://tonix.expresspool.xyz/api/sync/?login=1" in url:

		data = json.loads(flow.response.text)

		data["user"]["coinBalance"] = 999999
		data["user"]["tonBalance"] = 999999.4478414234
		data["user"]["isAdmin"] = True
		data["user"]["isMod"] = True

		flow.response.text = json.dumps(data)

and after use in your mitm:

mitmproxy -s test.py