windows下通杀wx小程序云函数实战

admin 2024年1月14日21:20:05评论31 views字数 1581阅读5分16秒阅读模式
试过的都知道, 用了云函数的小程序抓包是拿不到结果的找了个使用云开发做的小程序 《某问卷系统》

一. 解包

  • 工具有不少
  • 我这里用的是 unveilr 最新版
unveiler wx -sf "D:WeChat FilesAppletwx5cxxxxxxxx13347f77"

二. 确定是云开发

  • 打开查看app.js 确实是云开发的

windows下通杀wx小程序云函数实战

  • 这种的想抓数据,只能用 rpc 了

三. 修改并重新打包

  • 需要改代码重新打包了
  • 我们用 unveilr 重新解包一份不解析出wxml的
unveiler wx --no-parse -f "D:WeChat FilesAppletwx5cxxxxxxxx13347f77__APP__.wxapkg"

windows下通杀wx小程序云函数实战

  • 先找到入口,一般在 app-service.js 这个文件里,搜索 "app.js"

windows下通杀wx小程序云函数实战

  • 先开启 debug 模式
  • 将以下代码注入到onLaunch回调中

windows下通杀wx小程序云函数实战

  • 使用 unveilr 进行重打包,这里我还需要频繁改动,所以加上w参数
unveiler wx -wp "D:WeChat FilesAppletwx5cxxxxxxxx13347f77__APP__"
  • 然后重新打开小程序

windows下通杀wx小程序云函数实战

  • 会发现加载失败,这时候就要用frida了
  • 这里贴一个我自己用的frida脚本
const arr2str = (bytes) => String.fromCharCode(...new Uint8Array(bytes))const targetPtr = Module.getBaseAddress('WeChatAppEx.exe').add('0x2C1CBB8')Interceptor.attach(targetPtr, {  onEnter(args) {    void args    const length = 0x20    const rdx = this.context.rdx    const rbp = this.context.rbp    const p1 = rdx.readPointer()    const p2 = rbp.readPointer()    // 将原始 MD5 的数据覆盖到当前 MD5    const oriMd5 = p1.readByteArray(length)    const curMd5 = p2.readByteArray(length)    const m1 = arr2str(curMd5)    const m2 = arr2str(oriMd5)    if (!m2 || m1 === m2) return    p2.writeByteArray(oriMd5)    console.log(`[+] Replaced: ${m1} -> ${m2}`)  },})

这个脚本仅用于RadiumWMPF为6945的运行环境

windows下通杀wx小程序云函数实战

  • 开启firda然后重新打包就可以直接生效了,并且弹出了vConsole

windows下通杀wx小程序云函数实战

  • 接下载将所有云函数的请求都打印到控制台,或者写一个websocket服务发出去就行了,请求的话也可以使用websocket控制
  • 搜了以下 wx.cloud.callFunction 发现有一大片
  • 这时候可以注入一点代码到入口处
const oldCloud = wx.cloud;const oriCF = oldCloud.callFunctionoldCloud.callFunction = function (config) {    const _success = config.success    config.success = function (res){      console.log('callFunction===>',res);      _success(res);    }    oriCF(config)}

然后重新打开就可以看到代码已经生效
利用重打包功能,剩下的事情就简单了,直接接个websocket出去就能实现rpc了

windows下通杀wx小程序云函数实战

作者:小沫子,原文https://www.52pojie.cn/thread-1832406-1-1.html

 

 

原文始发于微信公众号(乌雲安全):windows下通杀wx小程序云函数实战

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2024年1月14日21:20:05
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   windows下通杀wx小程序云函数实战https://cn-sec.com/archives/2386015.html

发表评论

匿名网友 填写信息