Giter Site home page Giter Site logo

wechatuserdb's Introduction

WeChatUserDB (停止维护!!!)

GetWeChat DBPassword&&UserInfo(PC数据库密码以及相关微信用户信息)

mac 要安装 brew install sqlcipher 否则无法使用pysqlcipher3库
windows安装pysqlcipher3要自行编译,而且要下载VS所以选择直接调用exe

原理

通过pymem进行内存数据查找,获取基址+偏移量与特征,从而达到微信版本每次更新不需要重新查找地址

image

用例

Usage:
    程序参数:  -d <解密的数据库类型>  -k <密钥> -g <获取登录状态微信的私钥> -s <获取登录过机器的用户信息> -c <压缩数据库文件> -i <指定要压缩的文件夹id> -o <压缩文件输出路径> -p <解密windows加密的图片文件>


Options:
  -h, --help            show this help message and exit
  -d DECODE_SQL_TYPE, --decode_sql_type=DECODE_SQL_TYPE
                        输入想解密的数据库类型windows or mac
  -k KEY, --key=KEY     仅windows需要此参数,输入您获取的以base64编码的key
  -g, --get_key         仅windows可用,获取以base64编码的key
  -s, --search_user_info
                        获取运行脚本机器上存留的wx登录信息
  -c COMPRESS, --compress=COMPRESS
                        压缩相关wx数据,可选择 img down db all四种类型
  -i WXID, --wxid=WXID  与压缩参数配合使用
  -o OUT, --out=OUT     与压缩参数配合使用,默认输出为info.zip存储于脚本运行目录
  -p, --ps_img          解密windows加密的图片文件*.dat

解密windows数据库

python main.py -d windows -k CgszBB+uQfiLA1n3HUqU0vgCFvWKMU5Ltdd9LOfvZlI=

image-20220713215916713

解密mac数据库

python main.py -d mac
请输入断点调试获取到的key 并使用ctrl+D结束输入
0x6000003624e0: 0x54 0x60 0x97 0x05 0xb5 0x09 0x43 0x9f
0x6000003624e8: 0x94 0xe8 0x38 0x09 0xdc 0x5e 0x79 0x53
0x6000003624f0: 0x4f 0xdc 0xa1 0x66 0x8e 0x96 0x4a 0x98
0x6000003624f8: 0x9a 0x72 0xa6 0x17 0xe0 0x17 0x7c 0x56

image-20220713220751900

获取登陆机器信息

python main.py -s

image-20220713220718486

压缩WX数据

 python3 main.py -c db -i wxid_*********522 -o "C:\Users\文件路径\Desktop\info.zip"

image-20220713220637286

测试用例

测试数据库以放入相应文件夹,下面为作者测试时使用的key
苹果获取key的教程大家可以自行去网上搜索,因苹果权限管控太严无法自动获取key
mac(以下列形式直接粘贴即可):
0x6000003624e0: 0x54 0x60 0x97 0x05 0xb5 0x09 0x43 0x9f
0x6000003624e8: 0x94 0xe8 0x38 0x09 0xdc 0x5e 0x79 0x53
0x6000003624f0: 0x4f 0xdc 0xa1 0x66 0x8e 0x96 0x4a 0x98
0x6000003624f8: 0x9a 0x72 0xa6 0x17 0xe0 0x17 0x7c 0x56

微信(base64加密):
CgszBB+uQfiLA1n3HUqU0vgCFvWKMU5Ltdd9LOfvZlI=

版本

v0.0.1

目前经测试全版本通杀 (在一些极早版本偏移量不同导致错误,可将微信更新至最新版本)

v1.0.0

新增功能:

  1. 添加sqlite解密模块(支持mac数据库,windows数据库)
  2. 添加压缩WX数据文件功能(支持单类型压缩,img,db,down支持双系统)
  3. 添加win WX图片数据解密功能(将.dat解密为jpg, png, gif)
  4. 添加获取登录过机器的用户信息功能(支持双系统)

后续

预计添加sqlite解密模块 已添加! https://www.52pojie.cn/thread-1084703-1-1.html PC微信逆向分析の绕过加密访问SQLite数据库

预计添加WX app解密功能 (短时间内不会更新 作者要准备秋招/(ㄒoㄒ)/~~ 可以自行fork添加功能,求star)

wechatuserdb's People

Contributors

x1hy9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

wechatuserdb's Issues

3.9.6.33 fail: OverflowError: int too big to convert

$ python3 main.py -g
Traceback (most recent call last):
File "R:\WeChatUserDB-main@x1hy9-2022\main.py", line 38, in
get_info.get_key()
File "R:\WeChatUserDB-main@x1hy9-2022\get_info.py", line 135, in get_key
getuserinfo(p)
File "R:\WeChatUserDB-main@x1hy9-2022\get_info.py", line 72, in getuserinfo
bytes_path1 = (i).to_bytes(4, byteorder="little", signed=True)
OverflowError: int too big to convert

3.2.1.154失败

2022-06-07 11:32:27,147 - pymem - DEBUG - Process 5688 is being debugged
Traceback (most recent call last):
File "main.py", line 139, in
getuserinfo(p)
File "main.py", line 60, in getuserinfo
base_address=pattern_scan_all(p.process_handle, bytes_path, return_multiple=True)
File "main.py", line 38, in pattern_scan_all
return_multiple=return_multiple
TypeError: scan_pattern_page() got an unexpected keyword argument 'return_multiple'

最新版的wechat 3.7.6.44 貌似会出错,数据库解密失败

+++++++CMD++++++++++++++++++++++++++++++++++++ (base) C:\Users\Administrator\Downloads\Compressed\WeChatUserDB-main\WeChatUserDB-main>python main.py -d windows -k ****= 数据库ChatMSG.db解密失败!!! ++++++++++++++++++++++++++++++++++++++++++++++
debug了下发现中间的调用exe的过程会出错,
调用exe报错如下:
Error: near line 1: file is encrypted or is not a database
这是最新版的wechat换成splchipher4数据库了吗?
还是基址或偏移量出了什么偏差呢?
抱歉打扰我对逆向寻址这个过程不太了解

坐等添加sqlite解密

半自动或者手动都没事,最重要方法要对,现在sqlcipher解密不了db文件了

3.9.2.23失败

PS D:\Templete python main.py -g
Traceback (most recent call last):
File "D:\Templete\main.py", line 38, in
get_info.get_key()
File "D:\Templete\get_info.py", line 135, in get_key
getuserinfo(p)
File "D:\Templete\get_info.py", line 75, in getuserinfo
if cc[0] > wechat_addr:
~~^^^
IndexError: list index out of range
PS D:\Templete>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.