Created
April 14, 2026 17:41
-
-
Save vikychoi/890b30a071c5986d1490aeb642e31a49 to your computer and use it in GitHub Desktop.
Does the same thing as https://github.com/hackcatml/frida-flutterproxy
This file contains hidden or 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
| var PROXY_IP = "127.0.0.1"; | |
| var PROXY_PORT = 8080; | |
| var proxyBytes = PROXY_IP.split(".").map(Number); | |
| var proxyPortHi = (PROXY_PORT >> 8) & 0xff; | |
| var proxyPortLo = PROXY_PORT & 0xff; | |
| var connect = Module.getExportByName("libc.so", "connect"); | |
| Interceptor.attach(connect, { | |
| onEnter: function (args) { | |
| this.fd = args[0].toInt32(); | |
| this.addr = args[1]; | |
| var family = this.addr.readU16(); | |
| if (family !== 2) return; // AF_INET only | |
| var port = (this.addr.add(2).readU8() << 8) | this.addr.add(3).readU8(); | |
| var ip = this.addr.add(4).readU8() + "." + | |
| this.addr.add(5).readU8() + "." + | |
| this.addr.add(6).readU8() + "." + | |
| this.addr.add(7).readU8(); | |
| if (ip === PROXY_IP && port === PROXY_PORT) return; | |
| if (ip === "127.0.0.1") return; | |
| // if (port !== 80 && port !== 443 && port !== 8083 && port !== 8443) return; | |
| send("[proxy] " + ip + ":" + port + " -> " + PROXY_IP + ":" + PROXY_PORT); | |
| this.addr.add(2).writeU8(proxyPortHi); | |
| this.addr.add(3).writeU8(proxyPortLo); | |
| this.addr.add(4).writeU8(proxyBytes[0]); | |
| this.addr.add(5).writeU8(proxyBytes[1]); | |
| this.addr.add(6).writeU8(proxyBytes[2]); | |
| this.addr.add(7).writeU8(proxyBytes[3]); | |
| } | |
| }); | |
| send("[*] connect() hook active -> " + PROXY_IP + ":" + PROXY_PORT); | |
| send("[*] Configure Burp/mitmproxy in invisible/transparent proxy mode"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment