免责声明
仅为技术交流
入口
微信小程序打点
![图片[1],[云攻防]微信小程序强开F12->反编译-js逆向到-Usersig泄露到腾讯云rest任意接口调用,网络安全爱好者中心-神域博客网](https://img.godyu.com/2025/11/20251127104732759.png?imageView2/0/format/webp/q/75)
强开F12调试
![图片[2],[云攻防]微信小程序强开F12->反编译-js逆向到-Usersig泄露到腾讯云rest任意接口调用,网络安全爱好者中心-神域博客网](https://img.godyu.com/2025/11/20251127104855389.png?imageView2/0/format/webp/q/75)
找到一个接口组成是腾讯云/userSig的标识
拼接参数发现缺少userID
![图片[3],[云攻防]微信小程序强开F12->反编译-js逆向到-Usersig泄露到腾讯云rest任意接口调用,网络安全爱好者中心-神域博客网](https://img.godyu.com/2025/11/20251127104752587.png?imageView2/0/format/webp/q/75)
![图片[4],[云攻防]微信小程序强开F12->反编译-js逆向到-Usersig泄露到腾讯云rest任意接口调用,网络安全爱好者中心-神域博客网](https://img.godyu.com/2025/11/20251127105230139.png?imageView2/0/format/webp/q/75)
拼接后发现进行了AES魔改加密
反编译小程序详细分析加密方式
![图片[5],[云攻防]微信小程序强开F12->反编译-js逆向到-Usersig泄露到腾讯云rest任意接口调用,网络安全爱好者中心-神域博客网](https://img.godyu.com/2025/11/20251127111351720.png?imageView2/0/format/webp/q/75)
编写脚本解密
import hashlib, base64, json, argparse
from Crypto.Cipher import AES
def derive_key(app_id='wx3bXXXXXXXXXXXXXX'):
sha = hashlib.sha256(app_id.encode('utf-8')).hexdigest()
key_str = sha[4:8] + sha[16:20] + sha[32:36] + sha[48:52]
return key_str.encode('utf-8')
def decrypt(encrypt_data, app_id='wXXXXXXXXXXXXXXXXXXXXx'):
iv, ct = encrypt_data.split(':', 1)
key = derive_key(app_id)
cipher = AES.new(key, AES.MODE_CBC, iv.encode('utf-8'))
plaintext = cipher.decrypt(base64.b64decode(ct))
pad_len = plaintext[-1]
plaintext = plaintext[:-pad_len]
return json.loads(plaintext.decode('utf-8'))
def main():
p = argparse.ArgumentParser()
p.add_argument('--encryptData', required=True)
p.add_argument('--appId', default='wxXXXXXXXXXXXXXXXXXXXXXXXXXX')
args = p.parse_args()
obj = decrypt(args.encryptData, args.appId)
print(json.dumps(obj, ensure_ascii=False))
if __name__ == '__main__':
main()
![图片[6],[云攻防]微信小程序强开F12->反编译-js逆向到-Usersig泄露到腾讯云rest任意接口调用,网络安全爱好者中心-神域博客网](https://img.godyu.com/2025/11/20251127105331233.png?imageView2/0/format/webp/q/75)
运行解密的脚本
我们得出了userID userSig sdkAPPID以及 expire
![图片[7],[云攻防]微信小程序强开F12->反编译-js逆向到-Usersig泄露到腾讯云rest任意接口调用,网络安全爱好者中心-神域博客网](https://img.godyu.com/2025/11/20251127105626348.png?imageView2/0/format/webp/q/75)
根据腾讯云官方文档,
只要有sdkappid,identifier,usersig,即可调用restAPI,导致执行所有的接口服务
Identifier即为userid
即可调用以下所有接口
![图片[8],[云攻防]微信小程序强开F12->反编译-js逆向到-Usersig泄露到腾讯云rest任意接口调用,网络安全爱好者中心-神域博客网](https://img.godyu.com/2025/11/20251127110532914.png?imageView2/0/format/webp/q/75)
THE END
![[云攻防]微信小程序强开F12->反编译-js逆向到-Usersig泄露到腾讯云rest任意接口调用,网络安全爱好者中心-神域博客网](https://img.godyu.com/2025/11/20251127110532914.png)

![[LitCTF]cha0s-Writeup,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/06/20240602034759133.png)
![[5.20]从抖音信息收集到微信小程序sessionkey泄露伪造登录渗透某edu站,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/05/20240520143248539.jpg)


![[5.16]从微信小程序越权渗透某edu站的实例,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/05/20240522095651301.png)





暂无评论内容