腾讯滑块vData_VMP分析

腾讯滑块vData_VMP分析

成品解决方案联系v:cjh-18888

在这里插入图片描述原文http://www.zhuoyue360.com/jsnx/53.html

1. 环境搭建

不太好拿实际的网站来做实战,所以使用Wampserver64 + html来搭建测试站, 需要本地html文件的可以联系QQ 2625112940. 验证码识别,图像识别,安卓逆向相关的朋友也可以联系我.

image-20211022141712776

2. 分析

vData使用了JS-VMP的技术哈.至于JSVMP是啥?请参考下面这篇文章

给"某音"的js虚拟机写一个编译器 https://bbs.pediy.com/thread-261414.htm

1. 定位

vData包在cap_union_new_verify这儿,我们使用查看调用堆栈的方式去找位置.

看到send.打断点.看看数据是啥

image-20211022142517801

然后把a.data拿出来,发现并没有vData相关的东西?

image-20211022142534649
image-20211022142618824

what? 一般情况下不应该都是在send之前就组完包了吗? 怎么都到了send还没有加上vData呢?

2. 补环境

此时读者可以继续跟下去,你就会进到vm-slide.e201876f.enc.js文件.可以说它几乎是没法跟踪的,更别提算法还原了. so,这里使用补环境的方式来弄.

image-20211022142947936

​ 关注点getElementById,

[V8]get,[object XMLHttpRequest],open,function w(){var A=p.slice(0);A[0]=[this],A[1]=[arguments],A[2]=[w];for(var C=0;C<Q.length&&C<arguments.length;C++)0<Q[C]&&(A[Q[C]]=[arguments[C]]);return __TENCENT_CHAOS_VM(K,m,U,A,E,F,Y,c)}
[V8]get,[object XMLHttpRequest],send,function w(){var A=p.slice(0);A[0]=[this],A[1]=[arguments],A[2]=[w];for(var C=0;C<Q.length&&C<arguments.length;C++)0<Q[C]&&(A[Q[C]]=[arguments[C]]);return __TENCENT_CHAOS_VM(K,m,U,A,E,F,Y,c)}
[V8]get,[object Window],document,[object HTMLDocument]
[V8]get,[object HTMLDocument],getElementById,function getElementById() { [native code] }
[V8]get,[object Window],top,[object Window]
[V8]get,[object Window],document,[object HTMLDocument]
[V8]get,[object HTMLDocument],getElementsByTagName,function getElementsByTagName() { [native code] }
[V8]get,[object Window],navigator,[object Navigator]
[V8]get,[object Navigator],userAgent,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Version/8.0(Rs) Chrome/94.0.4606.71 Safari/537.36
[V8]get,[object HTMLScriptElement],src,https://rsv8.com/resouce/vDate.js
[V8]get,[object HTMLScriptElement],src,https://rsv8.com/resouce/vDate.js
[V8]get,[object HTMLScriptElement],src,https://t.captcha.qq.com/vm-slide.e201876f.enc.js
[V8]get,[object HTMLScriptElement],src,https://t.captcha.qq.com/vm-slide.e201876f.enc.js
[V8]get,[object XMLHttpRequest],autoHttp,

由于这里没有全局hook出来,这里手动给他注下代码.

document.getElementById = new Proxy(document.getElementById, {

  apply: (target,ctx,args)=>{
    let value = Reflect.apply(target,ctx,args);
    console.log('apply', args, value);
    return value;
  }
});

日志如下:

[V8]get,[object XMLHttpRequest],open,function w(){var A=p.slice(0);A[0]=[this],A[1]=[arguments],A[2]=[w];for(var C=0;C<Q.length&&C<arguments.length;C++)0<Q[C]&&(A[Q[C]]=[arguments[C]]);return __TENCENT_CHAOS_VM(K,m,U,A,E,F,Y,c)}
[V8]get,[object XMLHttpRequest],send,function w(){var A=p.slice(0);A[0]=[this],A[1]=[arguments],A[2]=[w];for(var C=0;C<Q.length&&C<arguments.length;C++)0<Q[C]&&(A[Q[C]]=[arguments[C]]);return __TENCENT_CHAOS_VM(K,m,U,A,E,F,Y,c)}
[V8]get,[object Window],document,[object HTMLDocument]
[V8]get,[object HTMLDocument],getElementById,function () { [native code] }
[V8]apply|slideBg|null
[V8]get,[object Window],top,[object Window]
[V8]get,[object Window],document,[object HTMLDocument]
[V8]get,[object HTMLDocument],getElementsByTagName,function getElementsByTagName() { [native code] }
[V8]get,[object Window],navigator,[object Navigator]
[V8]get,[object Navigator],userAgent,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Version/8.0(Rs) Chrome/94.0.4606.71 Safari/537.36
[V8]get,[object HTMLScriptElement],src,https://rsv8.com/resouce/vDate.js
[V8]get,[object HTMLScriptElement],src,https://rsv8.com/resouce/vDate.js
[V8]get,[object HTMLScriptElement],src,https://t.captcha.qq.com/vm-slide.e201876f.enc.js
[V8]get,[object HTMLScriptElement],src,https://t.captcha.qq.com/vm-slide.e201876f.enc.js
[V8]get,[object XMLHttpRequest],autoHttp,

发现,getElementById是找浏览器中有没有slideBg.我们去浏览器找找看.

image-20211022143357483

发现是存在的哈,存在我们就创建一个id为slideBgimg

    let img = document.createElement('img');
    img.id = "slideBg";
    document.body.appendChild(img) 

日志

[V8]get,[object XMLHttpRequest],open,function w(){var A=p.slice(0);A[0]=[this],A[1]=[arguments],A[2]=[w];for(var C=0;C<Q.length&&C<arguments.length;C++)0<Q[C]&&(A[Q[C]]=[arguments[C]]);return __TENCENT_CHAOS_VM(K,m,U,A,E,F,Y,c)}
[V8]get,[object XMLHttpRequest],send,function w(){var A=p.slice(0);A[0]=[this],A[1]=[arguments],A[2]=[w];for(var C=0;C<Q.length&&C<arguments.length;C++)0<Q[C]&&(A[Q[C]]=[arguments[C]]);return __TENCENT_CHAOS_VM(K,m,U,A,E,F,Y,c)}
[V8]get,[object Window],document,[object HTMLDocument]
[V8]get,[object HTMLDocument],getElementById,function () { [native code] }
[V8]get,[object HTMLImageElement],toString,function toString() { [native code] }
[V8]apply|slideBg|[object HTMLImageElement]
[V8]get,[object HTMLImageElement],src,
[V8]get,[object Window],top,[object Window]
[V8]get,[object Window],document,[object HTMLDocument]
[V8]get,[object HTMLDocument],getElementsByTagName,function getElementsByTagName() { [native code] }
[V8]get,[object Window],navigator,[object Navigator]
[V8]get,[object Navigator],userAgent,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Version/8.0(Rs) Chrome/94.0.4606.71 Safari/537.36
[V8]get,[object HTMLScriptElement],src,https://rsv8.com/resouce/vDate.js
[V8]get,[object HTMLScriptElement],src,https://rsv8.com/resouce/vDate.js
[V8]get,[object HTMLScriptElement],src,https://t.captcha.qq.com/vm-slide.e201876f.enc.js
[V8]get,[object HTMLScriptElement],src,https://t.captcha.qq.com/vm-slide.e201876f.enc.js
[V8]get,[object XMLHttpRequest],autoHttp,

再调试,发现要获取src,通过hook的方式再次断下.

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vlwqjqj6-1634887028842)(G:\blog_img\image-20211022143712475.png)]

看看src是个啥.其实就是图片验证码的img

image-20211022143752665

    let img = document.createElement('img');
    img.id = "slideBg";
    img.src = "https://t.captcha.qq.com/hycdn?index=1&image=937314008038564608?aid=1600000223&sess=s0ipTulqaOqk9Zr9mkbKPy0JQ29X-B9J9_CMprHOmxRFOlIzbuGMp7sup2cPoBRotaiEYfNR5iTjpbWMd4BRySwr7JoOayjVE9Ko5ILxEO7KfpCjRyCq2GtNhjgYjo_YZnHo05Wt4wXLmMIxLJDdDXHgO3qXuUFXYu1lUCpnN-vCgQrMkY1WnZXKpFS7-zAUrVb9qg-ffnKHJwbJBvd0GuQH_RWw-qqwBKi2skfWEH2C0aRofqx8fLQW69BYTi3fBBlL3z3yUO60TcrdfdSzakZmS2eZ_WJDRj&sid=6857193806836801537&img_index=1&subsid=3"
    document.body.appendChild(img) 

调试看日志, 这回到了top

[V8]get,[object XMLHttpRequest],open,function w(){var A=p.slice(0);A[0]=[this],A[1]=[arguments],A[2]=[w];for(var C=0;C<Q.length&&C<arguments.length;C++)0<Q[C]&&(A[Q[C]]=[arguments[C]]);return __TENCENT_CHAOS_VM(K,m,U,A,E,F,Y,c)}
[V8]get,[object XMLHttpRequest],send,function w(){var A=p.slice(0);A[0]=[this],A[1]=[arguments],A[2]=[w];for(var C=0;C<Q.length&&C<arguments.length;C++)0<Q[C]&&(A[Q[C]]=[arguments[C]]);return __TENCENT_CHAOS_VM(K,m,U,A,E,F,Y,c)}
[V8]get,[object Window],document,[object HTMLDocument]
[V8]get,[object HTMLDocument],getElementById,function () { [native code] }
[V8]get,[object HTMLImageElement],toString,function toString() { [native code] }
[V8]apply|slideBg|[object HTMLImageElement]
[V8]get,[object HTMLImageElement],src,https://t.captcha.qq.com/hycdn?index=1&image=937314008038564608?aid=1600000223&sess=s0ipTulqaOqk9Zr9mkbKPy0JQ29X-B9J9_CMprHOmxRFOlIzbuGMp7sup2cPoBRotaiEYfNR5iTjpbWMd4BRySwr7JoOayjVE9Ko5ILxEO7KfpCjRyCq2GtNhjgYjo_YZnHo05Wt4wXLmMIxLJDdDXHgO3qXuUFXYu1lUCpnN-vCgQrMkY1WnZXKpFS7-zAUrVb9qg-ffnKHJwbJBvd0GuQH_RWw-qqwBKi2skfWEH2C0aRofqx8fLQW69BYTi3fBBlL3z3yUO60TcrdfdSzakZmS2eZ_WJDRj&sid=6857193806836801537&img_index=1&subsid=3
[V8]get,[object Window],top,[object Window]
[V8]get,[object Window],document,[object HTMLDocument]
[V8]get,[object HTMLDocument],getElementsByTagName,function getElementsByTagName() { [native code] }
[V8]get,[object Window],navigator,[object Navigator]
[V8]get,[object Navigator],userAgent,Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Version/8.0(Rs) Chrome/94.0.4606.71 Safari/537.36
[V8]get,[object HTMLScriptElement],src,https://rsv8.com/resouce/vDate.js
[V8]get,[object HTMLScriptElement],src,https://rsv8.com/resouce/vDate.js
[V8]get,[object HTMLScriptElement],src,https://t.captcha.qq.com/vm-slide.e201876f.enc.js
[V8]get,[object HTMLScriptElement],src,https://t.captcha.qq.com/vm-slide.e201876f.enc.js
[V8]get,[object XMLHttpRequest],autoHttp,

对top打断点.

image-20211022144041334

image-20211022144020941

浏览器下:

image-20211022144142532

我们的环境:

image-20211022144206647

所以我们需要修改top.补充环境方式:

    Object.defineProperty(window,'top',{
        get:function(){
            return {};
        }
    });

接着看日志中的getElementsByTagName. 继续hook, 关系的是script, 在hook代码中加个debugger, 进去看看

document.getElementsByTagName = new Proxy(document.getElementsByTagName, {

  apply: (target,ctx,args)=>{
    let value = Reflect.apply(target,ctx,args);
    console.log('apply', args, value);
    debugger;
    return value;
  }
});
[V8]apply|script|[object HTMLScriptElement],[object HTMLScriptElement]

看到这里其实就是在获取我们的script标签

我们看看真正的浏览器上有多少个script.

image-20211022145107973

11个,我们把它获取出来

image-20211022145348068

    let scripts = ["","","","","","","","https://t.captcha.qq.com/tdc.js?app_data=6857198026746343424&t=28740867?t=1634883410","https://captcha.gtimg.com/1/tcaptcha-slide.fd5f5cd0.js",""];
    for (let i = scripts; i < scripts.length; i++){
        let script = document.createElement('script')
        script.src = scripts[i];
        document.body.appendChild(script);
    }

然后再拦截一下xhr请求的数据.vData出现了.

aid=1600000223&protocol=https&accver=1&showtype=popup&ua=TW96aWxsYS81LjAgKExpbnV4OyBBbmRyb2lkIDguMDsgUGl4ZWwgMiBCdWlsZC9PUEQzLjE3MDgxNi4wMTIpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS85NC4wLjQ2MDYuODEgTW9iaWxlIFNhZmFyaS81MzcuMzY%253D&noheader=0&fb=1&aged=0&enableAged=0&enableDarkMode=0&grayscale=1&clientype=1&sess=s0-IJwliNz11BFO_2VSjLia0__WOz70-tMf05e7hssmPIdQYV9s76NMyXMPvVXoo6pjzA366lIBAs9DIZJ11wVaLFmaB1mU0p4mJN_OXl-AVz98JVhZbxbDRwRTqZaxZcwp-iILOXvDnCtwjYUOkBR8X1oYu4pxdOauLWYmo0i9VeXZSPV82BZJ56mzuXc78li88BqSjEg--RmFVWByd6d_XkuYTghsGVPgCjXAumhn4AJWe26oZ2rEMMfaWhkzF-5tS-rscmOe3jEHjZ3RSM-F3Ae_XGo8lPm&fwidth=0&sid=6857181222991794176&wxLang=&tcScale=1&uid=&cap_cd=&rnd=928880&prehandleLoadTime=13&createIframeStart=1634879403746&subsid=2&cdata=0&ans=151%2C60%3B&vsig=&websig=&subcapclass=&pow_answer=edb0bb5d24fa85d3%23303&pow_calc_time=8&collect=tcge6Vy%2FnGtaEHQWYCBgEpgpQeTo2neVmClB5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MyMKvHr-mw0GK6vfm-hH*IZd0M1uupeWIBRwaATB1kT1763_XNfB_*5Fjq8wNoMPhCpodTOnXwk0twVlWCgdCWapS66lKFvtNo*vcCU4JtKDTydM7aTU9XYY&vData=Ru9GrK6OtZ1zKF5uKe*L_ST3nJVwoJ2FmPWzxtwlbcX1K38DEj1Xx3AzX_7m9mB60X18DQsclqREAVBNGL52iGuphlhmT6EyAmdechAXZIcY

3. 完结.

对于JSVMP的加密,个人是不建议对其算法进行还原的, 吃力不讨好的工作. 补环境才是上好的选择~

在C语言中使用DISPATCH_PROPERTYPUT宏写入Excel表格数据,通常需要借助于Microsoft Office Excel自带的COM组件。以下是一个简单的示例,可以帮助你快速了解如何使用DISPATCH_PROPERTYPUT宏将数据写入Excel表格中: ```c #include <Windows.h> #include <Ole2.h> #include <OleAuto.h> int main() { // 初始化COM库 CoInitialize(NULL); // 创建Excel应用程序对象 IDispatch* pExcelApp; CoCreateInstance(&CLSID_Application, NULL, CLSCTX_LOCAL_SERVER, &IID_IDispatch, (void**)&pExcelApp); // 打开Excel文件 VARIANT vFilename; VariantInit(&vFilename); vFilename.vt = VT_BSTR; vFilename.bstrVal = SysAllocString(L"C:\\test.xlsx"); IDispatch* pWorkbook; IDispatch* pWorksheet; VARIANT vIndex; VariantInit(&vIndex); vIndex.vt = VT_I4; vIndex.lVal = 1; DISPATCH_PROPERTYPUT(pExcelApp, "Visible", 0, &vTrue); DISPATCH_METHOD(pExcelApp, "Workbooks", &pWorkbook); DISPATCH_METHOD(pWorkbook, "Open", &pWorksheet, 1, &vFilename); DISPATCH_METHOD(pWorksheet, "Activate", NULL); // 写入数据 VARIANT vCell; VariantInit(&vCell); vCell.vt = VT_BSTR; vCell.bstrVal = SysAllocString(L"A1"); VARIANT vData; VariantInit(&vData); vData.vt = VT_BSTR; vData.bstrVal = SysAllocString(L"Hello, world!"); DISPATCH_METHOD(pWorksheet, "Range", &pRange, 1, &vCell); DISPATCH_PROPERTYPUT(pRange, "Value", 0, &vData); // 保存并关闭Excel文件 DISPATCH_METHOD(pWorkbook, "Save", NULL); DISPATCH_METHOD(pWorkbook, "Close", NULL); // 释放资源 pWorksheet->Release(); pWorkbook->Release(); pExcelApp->Release(); SysFreeString(vFilename.bstrVal); SysFreeString(vCell.bstrVal); SysFreeString(vData.bstrVal); CoUninitialize(); return 0; } ``` 上述示例中,我们首先初始化了COM库,然后创建了一个Excel应用程序对象,使用它来打开指定的Excel文件。接着,我们使用DISPATCH_PROPERTYPUT宏将数据写入单元格A1中,最后保存并关闭Excel文件,并释放所有资源。 需要注意的是,在使用DISPATCH_PROPERTYPUT宏时,需要先创建一个VARIANT结构体来存储要写入的数据。例如,如果要将字符串"Hello, world!"写入单元格中,可以这样创建VARIANT结构体: ```c VARIANT vData; VariantInit(&vData); vData.vt = VT_BSTR; vData.bstrVal = SysAllocString(L"Hello, world!"); ``` 上述示例中,我们创建了一个新的VARIANT结构体vData,并将其类型设置为VT_BSTR(即字符串类型),将其值设置为"Hello, world!"。最后,将指向vData的指针传递给DISPATCH_PROPERTYPUT宏即可完成数据的写入。
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值