一、分析IDA の "丢失"的导出Jni静态函数
案例:某小说APP
参数:sign
作者:Lunction
时间:2021年5月10日
0x1 抓包
POST /api/v1/login/index HTTP/1.1
net-env: 1
channel: qm-huawei65_lf
is-white: 0
platform: android
app-version: 51115
reg:
AUTHORIZATION:
qm-params: cLGZ4CG-uloLp3U1paHWHT9wgI9wgI9wthfLpqfQAIo5gaUzpzpztqpzpzp5Nh-Y4zHY43HjHSRUmqF5A5HwgI9wgI9wgaMMAI4wth4E4T-QgI9wgaMwgI9wNI9MpTHL4qf5taG-pCp14lfQmqF5A5HLgIHngIfwAhHnNI4eghozgh-Y4TR5pT0wphOMgyFrghFwAIG2pqHMNe0lpTuTgI0MgefUgI0YNeFEAIFlgLHjHzUx4LHWHT0wA-4nA-4LATKUA-pyATKlH5w5OE2etCp2O5HWHTK7g3rwH5w5u_GUOEk2paU1paHWH-kUg0kFFERsR-kMqoZE3zkluooTufuFchpYulQekMQamC2zmlxYN0UqgMdMRfuIqCRzk0RY3o1H3eFMc5JDOR-rcqJxRUsROCOluCpaR0JWtlN_BMGmRCO5taG1BqR1HTZ5gefrgIglgIKwgh0wNh4MH5w5BqJ-pqw5A5GshUNFHyJ7H_kxmqU2B5HjHSuj45U1BqR1HTZ5gefrgIglgIKwgh0wNh4MH5w5uln5tCR1paHWHTgUAI9eNT9rgI0ngIflNaHjHzNjmqR7uaU1paHWHzflpIgwNI9lgzR5ghfUNqH5taG5Ozo7paHWH-o7p_GDmqF5taGD4q2-HTZ5HSM=
sign: 786226e3e984253bcf6d14a0cc4f3475
QM-it: 1620580746
QM-ii: 1969128767
no-permiss: 0
User-Agent: webviewversion/51115
Content-Type: application/x-www-form-urlencoded
Content-Length: 124
Connection: Keep-Alive
Accept-Encoding: gzip
cancell_check=1&encrypt_phone=ghgrgI9ngeKwgI9=&gender=2&open_push=1&type=1&verify=1111&sign=5288f921bd48c316222ec51305b3f628
0x2 定位分析 搜索"sign"
0x3 方法跟进 找出关键点
0x4 sign方法定位
0x5 查找加载so库名称 查看a()引用
0x6 查看init方法引用 定位so库文件
0x8 莫慌! 推荐两种解决办法
1、Findcrypt3 插件识别常见的加密算法(准确度仅供参考)
2、推荐龙哥的强大的FRIDA识别Hash脚本插件 地址:https://github.com/Pr0214/findhash
3、IDA按 G 跳转到_ZN22MessageDigestAlgorithm4initEPKhj
4、最终的结果都是指向这里
0x9 最终挂上最爱的FRIDA
function Hook_So() {
var base_address = Module.findBaseAddress("libcommon-encryption.so");
var offest = Module.findExportByName("libcommon-encryption.so", "_ZN22MessageDigestAlgorithm4initEPKhj")
console.log(base_address + "offest : " + offest);
if (base_address) {
Interceptor.attach(offest, {
onEnter: function(args) {
console.log("args:\n", Memory.readCString(args[1]));
console.log("MD5:\n " + md5(Memory.readCString(args[1])))
// 省略MD5加密算法 为了直接搜索加密结果,偷懒加MD5.
},
onLeave: function(retval) {
}
})
}
}
setImmediate(Hook_So)
10 教程就到此结束。
|