企业微信使用protobuf nano对数据进行封装,使用Frida进行批量hook,可以打印出所有的序列化消息。
LocationMessage
Hook “com.tencent.wework.foundation.model.pb.WwRichmessage$LocationMessage”函数
消息内容1
2
3
4
5address: "\345\214\227\344\272\254\345\270\202\345\214\227\344\272\254\345\270\202\346\265\267\346\267\200\345\214\272\345\275\251\345\222\214\345\235\212\350\267\257\345\214\227\345\233\233\347\216\257\350\245\277\350\267\25766\345\217\267"
latitude: 39.984293
longitude: 116.307449
title: "\345\214\227\345\233\233\347\216\257\350\245\277\350\267\25766\345\217\267"
zoom: 15.0
FileMessage
Hook “com.tencent.wework.foundation.model.pb.WwRichmessage$FileMessage”函数
filename曾经存在路径穿越漏洞,通过hook String.getBytes()修改filename为”../../../hack.zip”1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33aes_key: ""
decrypt_ret: -1
encrypt_key: ""
encrypt_size: 0
extra: ""
file_id: ""
file_name: "open_screen_bg_img_1557.png"
flags: 0
height: 0
is_hd: false
iscomplex: false
md5: ""
mid_img_size: 0
mid_thumbnail_file_id: ""
mid_thumbnail_path: "/storage/emulated/0/Tencent/WeixinWork/uploadTempMidbimage/00ceba176d6be5ef68f045defd4280c0.midimage"
random_key: ""
receiver_deviceid: ""
sender_deviceid: ""
session_id: ""
size: 116907
thumb_img_size: 0
thumbnail_file_id: ""
thumbnail_path: "/storage/emulated/0/Tencent/WeixinWork/uploadTempThumbimage/00ceba176d6be5ef68f045defd4280c0.thumbimage"
url: "/storage/emulated/0/wandoujia/downloader/openscreen/open_screen_bg_img_1557.png"
voice_time: 0
wechat_auth_key: ""
wechat_cdn_ld_aeskey: ""
wechat_cdn_ld_height: 193
wechat_cdn_ld_md5: ""
wechat_cdn_ld_size: 0
wechat_cdn_ld_url: ""
wechat_cdn_ld_width: 290
width: 0
EmotionMessage
1 | aes_key: "" |
RichMessage
- 普通文本
1 | messages < |
- emoji表情
1 | messages < |
VideoMessage
1 | aes_key: "6f899d3e4c364a2baa70cfce00617a03" |
其他消息
1 | WwRichmessage.pOSTSHAREDMESSAGE = Extension.createMessageTyped(11, PostSharedMessage.class, 810); |
Frida hook代码
1 | Java.perform(function () { |