-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
新版本 QQNT (Android) 中函数位置改变 #29
Comments
正好说说这次改版之后我一些新的分析。 我勾住 解出来内容为: {"2": "6t***IGP", "3": "1.0.0.1", "4": "HMAC_SHA1"} (这里有个奇怪的点是 我怀疑数据库的密钥很可能是从这一部分派生出来的。 经过我的观察,在相当长的时间内这个数据库的头部没有发生变化,第一个加密块的内容也没有发生变化,是否可以认为数据库的密钥是一个固定值而非之前设想的每次登录下发?(由于我没有记录之前的密钥,没有验证过密钥是否发生变化) 不过由于C++ class乱飞,我到现在也没分析出来怎么从这一串字符产生密钥。可以按照关键词 这次分出 |
我现在也在试着hook计算密钥那一部分,就是IDA debugger跑不起来比较麻烦,正在上gdb;理论上直接对着那堆指针硬件断点就能干掉( |
|
关于这个,只要tx还在用SQLCipher的话,模拟 |
有进展了 function readStdString (str) {
const isTiny = (str.readU8() & 1) === 0;
if (isTiny) {
return str.add(1).readUtf8String();
}
return str.add(2 * Process.pointerSize).readPointer().readUtf8String();
}
var result_addr;
const ggg = {
onEnter: function(args) {
console.log('CCCryptorCreate called from:\\n' +
Thread.backtrace(this.context)
.map(DebugSymbol.fromAddress).join('\\n') + '\\n');
//console.log(args[0], args[1], args[2]);
//result_addr = args[1]
// console.log("¦- *zDb: " + args[0].readCString());
},
onLeave: function(ret) {console.log(ret, readStdString(ret))}
}
// Interceptor.attach(Module.findBaseAddress('libkernel.so').add(0x1b394e0), ggg);
//Interceptor.attach(Module.findExportByName('libbasic_share.so', '_ZN4xpng8SHA1HashEPKhm'), ggg);
//Interceptor.attach(Module.findExportByName('libbasic_share.so', 'SHA256_Update'), ggg);
// Interceptor.attach(Module.findExportByName('libbasic_share.so', '_ZN4xpng9MD5UpdateEPA88_cPKhm'), ggg);
// Interceptor.attach(Module.findExportByName('libbasic_share.so', '_ZN4xpng8MD5FinalEPNS_9MD5DigestEPA88_c'), ggg);
Interceptor.attach(Module.findExportByName('libbasic_share.so', '_ZN4xpng17MD5DigestToBase16ERKNS_9MD5DigestE'), ggg);
//Interceptor.attach(Module.findExportByName('libxplatform.so', '_ZN2xp3md55CRC32EjPKhi'), ggg); 每次点击登录都会调用这个没被注释的函数,使用md5生成密钥 |
成了! const upd = {
onEnter: function(args) {
console.log('update param ->', args[1].readCString(args[2].toInt32()));
}
}
const ggg = {
onLeave: function(ret) {console.log('MD5:', readStdString(ret))}
}
Interceptor.attach(Module.findExportByName('libbasic_share.so', '_ZN4xpng9MD5UpdateEPA88_cPKhm'), upd);
Interceptor.attach(Module.findExportByName('libbasic_share.so', '_ZN4xpng17MD5DigestToBase16ERKNS_9MD5DigestE'), ggg); SQLCipher key 在每次启动应用或点击登录时生成 那 @yllhwa 你有时间更新一下吗 鉴于我还要享受一下所剩无几的暑假( 能跑起来的完整 hook 脚本: android_qq_hook_md5_20240715.py.zip |
牛哇,终于把这算法给搞出来了。 |
考虑到root用户本来就可以通过hook key函数获得密钥,也许我们应该将面向无root用户介绍这种方法? 例如小米用户通过备份可以获得内部文件,甚至于可以使用 |
安卓QQ不是无法使用原版的 无法使用原版解密的话,我们就可以直接在 |
其实是可以的,我本地都直接拿社区版SQLCipher解密的,参数按教程调对就行
这个我也知道,跑个unicorn一类的 (话说什么时候改的密钥生成算法,我记得之前的密钥是有特殊符号的) |
你凭你感觉写吧,我个人认为都写在同个文件里,稍作区分就行了 |
既然现在已经知悉安卓端这一最大使用群体的密钥生成方式,我认为我们进一步的工作还有:
其中我可以继续之前的工作,对解密出的数据库字段进行解析,从而进一步实现可视化。 当然,我之前做过其他平台聊天记录的可视化,还有一个需要考虑的问题是,我们有两种实现的方式:
我是倾向于第二种实现,即统一为自定义的格式,这个方法有几种优点:
我之前的思路是对导出的数据库字段进行详细的设计,以达到通用的目的,但发现很难照顾到所有平台。 也许最佳的解决方案仍然是为不同的平台定义不同的自定义消息存储模型,再交给前端进行分别解析。 |
PCQQ / 其他平台 NTQQ?这个一般来说只要等的够久PR就会自己长出来(雾
这个可以有,不过找来 各种系统的具体备份操作 还是比较麻烦的吧。
这个东西其实主要是费时间,而且容易烂尾(
关于解析、可视化的话不确定你有没有看过这个 Shmily |
确实,希望也能自己长出来(
嗯,这个库我是了解的,不过不太符合我的一些需求。也许我会重写一个吧。现在QQ的用户日益减少,大家对nt qq似乎并不太热情😂 |
This comment was marked as resolved.
This comment was marked as resolved.
感谢两位大佬,我在V9.0.65.17370成功复现。不过 教程 - NTQQ (Android).md |
以及QQ版本是最新版吗? |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
要!路径里那个hash是不一样的,对于key计算可以认为没有用 |
进去了,感谢各位的支持 文档需要更新,有误。 以及本人尝试成功参数是 版本最新,但是从qqnt8.5测试版更新上去的。 留给后人当参考了 |
丢进
libbasic_share
里了,同时把函数的符号加了回来需要适配一下(具体来说要在
libkernel
中找不到函数时尝试在libbasic_share
中找,并且优先使用findExportByName
来利用符号信息)The text was updated successfully, but these errors were encountered: