1. 定位加密位置
1.1 通过关键词搜索 Anti-Content,在第二个js 文件出找到位置, 此时的 e 就是Anti-Content 值
1.2 往上看e 值是回调函数传进来的值, Promise.resove().then() 这个是异步函数,.then()方法接收异步执行后的结果,分析 Promise.resove() 里面的方法 l, 进入L函数内部
1.3 进入L 函数内部后, 发现里面也是异步函数,继续跟进B 函数
1.4 在B 函数找到加密位置,控制台执行可以返回加密值
2. 扣代码
2.1 看到 n(284) 猜到这个n 是加载器,是webpack 打包的代码, 进入n函数找到加载器位置
找到加载器位置如下,发现这个js 文件是个执行函数,把整个js复制下来
2.2 回到2.1 步骤,加载器n调用了284 这个模块,先进入284 模块
进入284 模块发现又调用了285 模块, 控制台输入 n.m[285],继续进入285 模块
找到了 285 模块代码,把整个模块复制下来
2.3 需要补的模块是285,85,下面整个webpack 代码
3. 补浏览器环境
3.1 上述代码运行后会报错, 检测了浏览器环境,下面给出需要补的代码
window = global;
window.Buffer = undefined
navigator = {}
navigator.webdriver=false
navigator.userAgent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
navigator.languages=['zh-CN', 'zh']
screen= {availWidth:1920, availHeight:1040}
outerHeight = 1040
outerWidth = 1920
document = {}
document.cookie = '_nano_fp=XpEbXqX8nqCjl0T8n9_UZhUcS7q2vbfze7B6ltDE; webp=true; api_uid=CkMrQmT1i1iHYwBW9qrcAg=='
document.referrer = 'https://pifa.pinduoduo.com/'
history = {scrollRestoration:"auto", back:function (arg){console.log("back:", arg)}}
location = {
"ancestorOrigins": {},
"href": "https://pifa.pinduoduo.com/",
"origin": "https://pifa.pinduoduo.com",
"protocol": "https:",
"host": "pifa.pinduoduo.com",
"hostname": "pifa.pinduoduo.com",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
}
chrome = {}
window.HTMLElement = function HTMLElement(){debugger}
getElementById = function getElementById(args){
};
document.getElementById = getElementById
addEventListener = function addEventListener(type, listener, options){
};
document.addEventListener = addEventListener
3.2 运行结果
3.3 携带加密值去请求接口成功