Updated Home (markdown)

ttttupup 2023-03-29 10:08:19 +08:00
parent a4609a37ab
commit 3d3e41b15d

23
Home.md

@ -45,4 +45,25 @@ sqlite3_close函数特征最明显直接搜索字符串 "unable to close due
和sqlite3.c里api保持一致。
微信使用的是SQLCipher加密sqlite3推而广之也开源采用此方法定位key相关的函数。
再推而广之,开源项目的逆向基本上都可以采用这种套路。
再推而广之,开源项目的逆向基本上都可以采用这种套路。
# 数据库解密
经过简单分析可以确定微信是使用的SQLCipher进行加密。可以简单分析一下SQLCipher的加密过程如下
![image](https://user-images.githubusercontent.com/31303661/228406245-1c536a96-370f-4131-acea-1e6f33b46c67.png)
然后看下crypto.h,解密就是反过程:
![image](https://user-images.githubusercontent.com/31303661/228405488-d9e30857-0e49-4011-93be-c19c6b956c8a.png)
![image](https://user-images.githubusercontent.com/31303661/228404744-db7852c4-6a2e-401b-9619-640de339a66b.png)
![image](https://user-images.githubusercontent.com/31303661/228404801-5aa29891-b820-48ad-98b4-ed7a9c1aadc7.png)
![image](https://user-images.githubusercontent.com/31303661/228404881-0aebe345-94ca-4211-941b-c46e23032617.png)
这些事当然要先看看官方的解密工具 https://github.com/sqlcipher/sqlcipher-tools , 简单测试了一下,只解密了第一页,应该是后面更新了版本的原因,
也编译了sqlcipher不过也没解密成功因为微信用的是3.40的sqlite,版本不一致。这种体力活肯定是先搜一搜有现成的工具没有然后参考了一个博主的python脚本
简单修改一下即可。
![image](https://user-images.githubusercontent.com/31303661/228407515-545e6b6d-9ee9-409c-adfb-ecdde32b0158.png)
测试了一下效果还可以。
![image](https://user-images.githubusercontent.com/31303661/228407983-cc594b44-a9fe-4c52-91a3-29f88a058c42.png)