frida-flutterproxy icon indicating copy to clipboard operation
frida-flutterproxy copied to clipboard

Feature Improvement Request

Open KenjiroIchise opened this issue 1 year ago • 1 comments

Thank you for the great project! I am using it in my work. Does it support IPv6?

 // Hook the socket function and replace the IP and port with our burp ones.
 Interceptor.attach(Module.findExportByName(null, "socket"), {
            onEnter: function(args) {
                // AF_INET(IPv4) == 2, AF_INET6(IPv6) == 10
                var overwrite = false;
                if (Process.platform === 'linux' && sockaddr != null && ptr(sockaddr).readU16() == 2) {
                    overwrite = true;
                }
                else if (Process.platform === 'darwin' && sockaddr != null && ptr(sockaddr).add(0x1).readU8() == 2) {
                    overwrite = true;
                }

                if (overwrite) {
                    console.log(`[*] Overwrite sockaddr as our burp proxy ip and port --> ${BURP_PROXY_IP}:${BURP_PROXY_PORT}`);
                    ptr(sockaddr).add(0x2).writeU16(byteFlip(BURP_PROXY_PORT));
                    ptr(sockaddr).add(0x4).writeByteArray(convertIpToByteArray(BURP_PROXY_IP));
                }
            },
            onLeave: function(retval) {}
})

KenjiroIchise avatar Oct 09 '24 01:10 KenjiroIchise

I have no experience setting the proxy for apps using IPv6. That's why I use && ptr(sockaddr).readU16() == 2 and ptr(sockaddr).add(0x1).readU8() == 2 in the code. If I remove that and analyze the sockaddr structure for IPv6, then I think this script could support IPv6 as well. Could you suggest a Flutter app that uses IPv6?

hackcatml avatar Oct 09 '24 02:10 hackcatml