// 先执行端口映射
// adb forward tcp:27042 tcp:27042
// frida -U -f xxx -l .\ssl_bp.js --no-pause
// frida -U -f com.zhiliaoapp.musically -l .\ssl_bp.js --no-pause
// 抖音正版
// frida -H 127.0.0.1 -f com.ss.android.ugc.aweme -l .\ssl_bp.js --no-pause
// frida -U -f com.ss.android.ugc.aweme -l .\ssl_bp.js --no-pause
// 抖音极速版
// com.ss.android.ugc.aweme.lite
// frida -U -f com.ss.android.ugc.aweme.lite -l .\ssl_bp.js --no-pause
// 番茄小说
// com.dragon.read
// frida -U -f com.dragon.read -l .\ssl_bp.js --no-pause
function bypass() {
Process.enumerateModules({
onMatch: function (module) {
//console.log('Module name: ' + module.name + " - Base Address: " + module.base.toString());
if (module.name == "libsscronet.so") {
// console.log("libsscronet.so matched");
// var base = Module.findBaseAddress("libsscronet.so");
// var method1 = base.add(0x163E90).add(0x1);
// Interceptor.attach(method1,{
// onEnter:function(args){
// },
// onLeave:function(retval){
// console.log("抓包校验保护已绕过:",retval)
// if(retval == 0x1){
// retval.replace(0x0)
// }
// }
// });
var android_dlopen_ext = Module.findExportByName(null, "android_dlopen_ext");
if (android_dlopen_ext != null) {
Interceptor.attach(android_dlopen_ext, {
onEnter: function (args) {
var soName = args[0].readCString();
if (soName.indexOf("libsscronet.so") != -1) {
this.loaded = true;
}
},
onLeave: function (retval) {
if (this.loaded) {
hook_set_custom_verify();
}
}
});
}
}
},
onComplete: function () { }
});
/*var base = Module.findBaseAddress("libsscronet.so");
var method1 = base.add(0x163E90).add(0x1);
Interceptor.attach(method1,{
onEnter:function(args){
},
onLeave:function(retval){
console.log("抓包校验保护已绕过:",retval)
if(retval == 0x1){
retval.replace(0x0)
}
}
});*/
}
function main() {
// 8.0以下所有的so加载都通过dlopen
var android_dlopen_ext = Module.findExportByName(null, "android_dlopen_ext");
//var android_dlopen_ext = Module.findExportByName(null, "dlopen");
if (android_dlopen_ext != null) {
Interceptor.attach(android_dlopen_ext, {
onEnter: function (args) {
var soName = args[0].readCString();
if (soName.indexOf("libsscronet.so") != -1) {
this.loaded = true;
}
},
onLeave: function (retval) {
if (this.loaded) {
// hook_xlog();
hook_set_custom_verify();
}
}
});
}
}
function hook_set_custom_verify() {
var set_custom_verify = Module.findExportByName("libttboringssl.so", "SSL_CTX_set_custom_verify");
console.log("set_custom_verify", set_custom_verify);
Interceptor.attach(set_custom_verify, {
onEnter: function (args) {
console.log(args[2]);
var callback = args[2];
console.log("callback:", callback);
hook_callback(callback);
}, onLeave(retval) {
}
});
}
function hook_callback(callback) {
Interceptor.attach(callback, {
onLeave(retval) {
console.log("verify callback return:", retval);
retval.replace(0); // 0 就是成功
}
});
}
function hook_xlog(){
Java.perform(function () {
var ba = Java.use('com.ss.android.common.applog.AppLog');
ba.getLogEncryptSwitch.implementation = function () {
return false;
}
})
}
//setImmediate(function(){
// setTimeout(main, 5000);
//});
setImmediate(main, 5000);
// setImmediate(bypass);
10:46:28 › adb shell
OnePlus6:/ $ su
OnePlus6:/ # cd data/local/tmp/
OnePlus6:/data/local/tmp # ls
frd-16.0.8 frida-server-14.2.18-android-arm64 re.frida.server
OnePlus6:/data/local/tmp # ./fr
frd-16.0.8 frida-server-14.2.18-android-arm64
OnePlus6:/data/local/tmp # ./frida-server-14.2.18-android-arm64
adb shell dumpsys window | grep mCurrentFocus
frida -U -f com.zhiliaoapp.musically -l ssl_bp.js
frida -U -f com.zhiliaoapp.musically -l ssl_bp.js --no-pause