目标网站:
aHR0cHM6Ly9xLjEwanFrYS5jb20uY24v
一、抓包分析
携带了cookie,每次请求的cookie都不一样,且不携带cookie不能成功返回数据

hook Cookie代码
javascript
_cookie = document.cookie
Object.defineProperty(document, 'cookie', {
get(){
console.log('正在获取cookie,', _cookie)
return _cookie
},
set(value){
debugger;
console.log('正在设置cookie,', value)
if (value.indexOf("v") != -1) {
debugger ;
}
_cookie = value
}
})
新建代码,拷贝hook代码并保存运行
成功hook到cookie

向上跟栈,发现是update方法进行更新的

进入方法内部

方法所用到的S在前面就已经定义了,而且是个自执行方法

直接拷贝整个js文件到本地

定义全局变量GG,用于导出O方法

缺失环境

补环境代理
javascript
function environment(obj) {
return new Proxy(obj, {
set(target, p, value, receiver){
console.log('set:', p)
return Reflect.set(...arguments)
},
get(target, p, receiver){
console.log("get:", p);
return target[p];
}
})
}
environment(window)
补上这些环境

生成的cookie

本地调用

文章仅提供技术交流学习,不可对目标服务器造成伤害