Skip to content

Instantly share code, notes, and snippets.

@Lua12138
Created January 26, 2024 03:41
Show Gist options
  • Save Lua12138/dc7577ee86fc8786e22212db35c58f5b to your computer and use it in GitHub Desktop.
Save Lua12138/dc7577ee86fc8786e22212db35c58f5b to your computer and use it in GitHub Desktop.
Disable flutter SSL validation by Frida in Android
// cli: frida --runtime v8 -l flutter_disable_ssl_validation.js -f com.my.target.package -H 192.168.0.123:6666
function hook_ssl_verify_result(address) {
console.log('try to hook address:' + address)
Interceptor.attach(address, {
onEnter: function (args) {
console.log("Disabling SSL validation")
}, onLeave: function (retval) {
console.log("Retval: " + retval);
retval.replace(0x1);
}
});
}
function hookFlutter() {
/*
* Q: How to find the address?
* A:
* Step 1, Drag the `libflutter.so` to IDA(or any other analysis tool you like)
* Step 2, Find the string `ssl_client`, then look for the function that references this string.
* Step 3, The name of this function should be like this `loc_xxxxxxx`.
* Step 4, `xxxxx` is the address we need to find. And put the `0x` prefix to the code
*/
var address = Module.findBaseAddress('libflutter.so').add(0x55a4ec)
hook_ssl_verify_result(address)
}
setTimeout(hookFlutter,1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment