新聞中心
分析網(wǎng)址:'aHR0cHM6Ly9tbXMucGluZHVvZHVvLmNvbS9nb29kcy9nb29kc19saXN0'

創(chuàng)新互聯(lián)自2013年起,公司以做網(wǎng)站、網(wǎng)站制作、系統(tǒng)開發(fā)、網(wǎng)絡推廣、文化傳媒、企業(yè)宣傳、平面廣告設計等為主要業(yè)務,適用行業(yè)近百種。服務企業(yè)客戶1000+,涉及國內(nèi)多個省份客戶。擁有多年網(wǎng)站建設開發(fā)經(jīng)驗。為企業(yè)提供專業(yè)的網(wǎng)站建設、創(chuàng)意設計、宣傳推廣等服務。 通過專業(yè)的設計、獨特的風格,為不同客戶提供各種風格的特色服務。
1.介紹-為什么要逆向anti-content參數(shù)
用代碼訪問后臺數(shù)據(jù)不帶anti參數(shù)的話會提示“訪問頻繁”,所以需要逆向出這個參數(shù)!
2.開始逆向js
2.1 找參數(shù)所在位置-先在控制臺全局搜索參數(shù)名字
搜索出來10個結(jié)果 不算多,每個都點進去 在差不多的關鍵詞位置打上斷點先。
因為它Ajax請求每個頁面都要anti參數(shù) 所以我們下斷點之后隨便點個按鈕都能用 已經(jīng)斷下來了,這個aa1d開頭的js文件(你們的不一定叫這名),可以把其他斷點取消了,現(xiàn)在來著重分析這個。
2.2 跟棧-找加密的方法
return Promise.resolve(u(t.rawFetch, d).catch((function() {}
直接f8放過去 再重新點一次 會到達上面那個斷點
f11單步調(diào)試進來 會跟到這里
getCrawlerInfo: function(t) {
return Promise.resolve(G((function() {
var e = I.a.getInstance(t);
return Promise.resolve(e.getServerTime()).then(F)
}
), (function() {
return ""
}
)))
}
對于異步不太懂的 我這里強行演示一波 (百度小抄一下改改)
//1. Promise.resolve("111")
Promise.resolve("111")
//Promise {: '111'}
// [[Prototype]]: Promise
// [[PromiseState]]: "fulfilled" 這是完成的狀態(tài)
// [[PromiseResult]]: "111" 這是結(jié)果
//2.Promise.resolve("").then(函數(shù)())
Promise.resolve("我是參數(shù)?").then(function(a){console.log("111",a);return "123"})
//111 我是參數(shù)?
//Promise {: '123'}
// [[Prototype]]: Promise
// [[PromiseState]]: "fulfilled"
// [[PromiseResult]]: "123"
所以e是時間戳,f是主要函數(shù) 下斷點到這 f8直接過來 再單步兩次到F
要的是里面的這串代碼 :new一個對象 對象傳入一個包含serverTime的對象這里我也不太理解 最后messagePack肯定就是方法了。不管他直接復制在控制臺跑一下出結(jié)果了。
new (n("eDaA"))({
serverTime: t
}).messagePack()
2.3 代碼分析
n("eDaA") 我第一眼看這不就是個webpack嗎 當時覺得還是以前的玩法 找到n方法的加載器 再復制eDaA這個模塊就可以跑了。沒想到跟進去發(fā)現(xiàn) eDaA里面又是一個加載器和模塊 第一次見到這樣的 沒玩過,研究了半天
eDaA導出fbeZ fbeZ又導出里面的整個webpack
所以最后我們只要fbeZ里面的webpack 跳過第一層直接取它, 因為它是第二層的 加載器不適用,需要找個通用的加載器
下面的加載器可以輸出"111"就行
window=global;
!(function (e) {
var i = {}
, o = {
index: 0
}
function c(t) {
if (i[t])
return i[t].exports;
var n = i[t] = {
i: t,
l: !1,
exports: {}
};
// console.log(t)
return e[t].call(n.exports, n, n.exports, c),
n.l = !0,
n.exports
}
window.hliang1 = c
}
)([
function(e,t,n){
console.log("111")
}
])
window.hliang1(0)
復制過來后 把前面列表的[和屁股后面的}]刪除掉一個 因為會復制多
因為用notepad++代碼格式化的問題,有一個模塊會提示代碼有問題
去網(wǎng)站重新粘貼一下這串代碼到vscode(pycharm)
這樣就完成了,用window.hliang1 就可以調(diào)用模塊了
下面開始復制qe對象
它new 的qe對象就在模塊里面啊,我不知道怎么直接new 所以新建了一個函數(shù) 然后對它改寫
全部復制下來
function hliang_qe(){
//復制進這里來
}
(function (e, t) {}).call(this,a,b) 這種就是 把a,b傳參到e,t
所以改寫 匿名刪除去掉,.call去掉,傳參的e,t直接設置成
var e=window.hliang1(3) 還有其他地方n() 這里加載器名字改一下
t原本的作用是導出(t.exports)那我這里不要t了 直接導出改成return
如下圖
復制到瀏覽器執(zhí)行,成功出結(jié)果。但是這個代碼在node.js還需要補環(huán)境和改環(huán)境。
3.環(huán)境檢測
在瀏覽器能跑 在node.js跑不了 需要補環(huán)境。
這都啥報錯啊,看不懂。 先上環(huán)境吧。
算了懶得寫了。
直接告訴你們要補啥吧。
cookie和localStorage.Item傳入自己的就行了 過期的也沒事
window = global
document={
addEventListener:function addEventListener(a,b){
// console.log("addevent",a,b)
return undefined
},
referrer:'',
getElementById:function getElementById(a){
console.log("getbyid",a)
return ""
},
cookie:''//這里傳一個自己的cookie 過期了的也沒事
}
var Plugins={0:{}}
navigator={
webdriver:false,
plugins: Plugins,
languages:["zh-CN","zh"],
hasOwnProperty:function hasOwnProperty(a){
// console.log(a,"hasOwnProperty");
if (a=="webdriver"){
return false
}
},
userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.81 Safari/537.36"
}
screen={availWidth:1920,availHeight:1040}
history={
back:function back(){console.log("back",arguments)}
}
location={
href:"https://mms.pinduoduo.com/goods/goods_list",
port:""
}
chrome={}
localStorage={
getItem:function getItem(a){
// console.log("item",arguments)
if (a=="_nano_fp"){
return "" //這里也傳一個自己的
}
}
}
window["chrome"]=chrome
window["location"]=location
window["navigator"]=navigator
window["history"]=history
window["document"]=document
window["screen"]=screen
window["localStorage"]=localStorage
Object.defineProperty && Object.defineProperty(window, "outerHeight", {
value: 1040,
writable: false
});
Object.defineProperty && Object.defineProperty(window, "outerWidth", {
value: 1920,
writable: false
});
function DeviceOrientationEvent(){
console.log("DeviceOrientationEvent",arguments)
}
window["DeviceOrientationEvent"]=DeviceOrientationEvent
function DeviceMotionEvent(){
console.log("DeviceMotionEvent",arguments)
}
window["DeviceMotionEvent"]=DeviceMotionEvent
//delete window.Buffer //e("0x3c", "anZ%")
document.getElementById.toString=function(){
return 'function getElementById() { [native code] }'
}
可以了。環(huán)境+上面的代碼就能跑了
{"success":true,"errorCode":1000000,"errorMsg":null,"result":{"sessionId":"e70ae011c9c64f8fbf0e70fada362385","total":0,"goods_list":[]}}
演示地址:
??http://z.hl98.cn/index.php?share/file&user=102&sid=CiAXx7ry??
小伙伴們,快快用實踐一下吧!
當前標題:拼刀刀店鋪后臺的參數(shù)Anti-content逆向分析
文章起源:http://m.jiaoqi3.com/article/copogog.html


咨詢
建站咨詢
