網(wǎng)站建設(shè)的公司哪家是上市公司百度搜索推廣產(chǎn)品
在上一篇文章中已經(jīng)講了如何去定位x-s生成的位置,本篇文章就直接開始擼代碼吧
如果沒看過的話可以看:小紅薯最新x-s算法分析12-06(x-s 56)(上)-CSDN博客
1、獲取加密塊代碼
首先來到參數(shù)生成的位置,點擊 F9 進入加密的位置
可以看見加密的代碼就是在這一塊,直接全扣就可以了
扣下來一共有兩千多行,把調(diào)用的位置放在最下面嘗試執(zhí)行一下
c = "/api/sns/web/v1/user_posted?用自己的"
i = undefined
res = window._webmsxyw(c, i)
console.log(res)
2、使用補環(huán)境框架
使用補環(huán)境框架,把代理掛上在代碼的最上方運行
function setProxy(proxyObjs) {for (let i = 0; i < proxyObjs.length; i++) {const handler = `{get: function(target, property, receiver) {if (property!="Math" && property!="isNaN"){if (target[property] && typeof target[property] !="string" && Object.keys(target[property]).length>3){}else{console.log("方法:", "get ", "對象:", "${proxyObjs[i]}", " 屬性:", property, " 屬性類型:", typeof property, ", 屬性值:", target[property]);}}return target[property];},set: function(target, property, value, receiver) {console.log("方法:", "set ", "對象:", "${proxyObjs[i]}", " 屬性:", property, " 屬性類型:", typeof property, ", 屬性值:", value, ", 屬性值類型:", typeof target[property]);return Reflect.set(...arguments);}}`;eval(`try {${proxyObjs[i]};${proxyObjs[i]} = new Proxy(${proxyObjs[i]}, ${handler});} catch (e) {${proxyObjs[i]} = {};${proxyObjs[i]} = new Proxy(${proxyObjs[i]}, ${handler});}`);}
}window = {}
document = {}
navigator = {}
screen = {}
localStorage = {}
location = {}
history = {}setProxy(['window', 'document', ' navigator', 'screen', 'localStorage', 'location', 'history'])
3、處理undefined (reading 'RegExp')
代碼執(zhí)行后發(fā)現(xiàn)報錯 undefined (reading 'RegExp'),同時window也是undefined,
?
補充:
window = global;
delete global; // 刪除 global,防止在后續(xù)代碼中再次使用 global
delete Buffer; // 瀏覽器中無 Buffer 防止環(huán)境污染
4、補充 createElement、documentElement
這個時候報錯,看代理發(fā)現(xiàn)是缺了 document 下的 createElement
老樣子繼續(xù)補 documentElement
document = {createElement: function createElement() {},documentElement: function documentElement() {},
}
5、處理 undefined (reading 'getContext')
報錯?TypeError: Cannot read properties of undefined (reading 'getContext')
根據(jù)日志可看見最后一個調(diào)用的是?createElement,傳參并打印一下看看做了什么
補上canvas,看看里面發(fā)生了什么
發(fā)現(xiàn)在 canvas 里面缺了一個 getContext,老樣子直接補
再次執(zhí)行發(fā)現(xiàn)已經(jīng)沒有報錯了,接下來繼續(xù)照著這個思路補就可以了
6、環(huán)境展示
根據(jù)前面的思路缺什么就去瀏覽器補什么,最終補出來長這樣的:
7、生成結(jié)果展示
8、python運行結(jié)果展示
9、總結(jié):
基本上按照這個思路慢慢補都是可以補全的,當(dāng)然如果需要源碼的話也可以私聊,如果有需要定制的話歡迎私信(白嫖怪勿擾,看著給就行)