某乎接口zse96解析
- 下面是作者呕心沥血,观看各路大神和某乎js拼接在一起的js,附带浏览器环境,可以直接运行
- 示例
接口多请求几次发现,出来zse96在变化之外,其余的基本不变,那么源码中直接搜索x-zse-96,得出下面2个函数
var tE = eo(te, tp.body, {xUDId: tv,zse93: tT,xAppVersion: tm,authId: tw,xZst81: ty}, td), tS = tE.source, tk = tE.signature;tA = tS,Object.keys(tC).forEach(function(tt) {return th.set(tt, tC[tt])}),tv && th.set("x-ac-udid", tv),th.set(tO, tT),th.set("x-zse-96", t2 + "_" + tk)
var tS = er(), tT = ed(te, tf.body, {zse93: tb,dc0: tS,xZst81: tC}, tA), tO = tT.signature;tE = tT.source,tC && tp.set("x-zst-81", tC),tp.set(tw, tb),tp.set("x-zse-96", t2 + "_" + tO)
数据来源于ed函数中返回的signature,并传递了大约5个参数
te, tf.body, tb, ts, tc
从源中分析可知
te 路由
tf.body 为空这里猜测是请求体 ,所以get请求这里为空
tb应该是固定的
TS 是本html源代码中的一个xUDID值 加上 | 时间戳
tc比较可疑,header中存在,但是tc也是空
在看一下ed函数,将上面这几个用+连接起来
开始调试
signture调用了 (0,tJ(ti).encrypt)(ty()(tp))
这似乎是一个md5值那么就是说,用encrypt函数来加密MD5就行,那么开始直接下载js吧
下面是作者呕心沥血,观看各路大神和某乎js拼接在一起的js,附带浏览器环境,可以直接运行
window=global;
var xx={};
delete global;
delete Buffer;
Math.random=function(){return 0.1}
window.name=''
window.alert=function(){}
navigator={userAgent:'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36',toString:function(){return '[object Navigator]'},webdriver:false
}
document={toString:function(){return '[object HTMLDocument]'},createElement:function(){return canvas},getElementById:function(){},getElementsByClassName:function(){}}
canvas={getContext:function(){ return CanvasRenderingContext2D }
}
CanvasRenderingContext2D ={toString:function(){return 'function CanvasRenderingContext2D() { [native code] }'}
}location={toString:function(){return 'https://www.zhihu.com/'},href:'https://www.zhihu.com/'
}history={toString:function(){return '[object History]'}
}
screen={toString:function(){return '[object Screen]'}
}function getEnvs(proxyObjs) {for (let i = 0; i < proxyObjs.length; i++) {const handler = `{// get: function(target, property, receiver) {// console.log("方法:", "get ", "对象:", "${proxyObjs[i]}", " 属性:", property, " 属性类型:", typeof property, ", 属性值:", target[property], ", 属性值类型:", typeof 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});}`);}
}proxyObjs = ['window', 'document', 'location', 'navigator', 'history', 'screen','canvas','CanvasRenderingContext2D']
getEnvs(proxyObjs);!function() {"use strict";var e, a, c, d, f, t, r, b, o, n, i, s, l, u = {}, m = {};function p(e) {var a = m[e];if (void 0 !== a)return a.exports;var c = m[e] = {id: e,loaded: !1,exports: {}};return u[e].call(c.exports, c, c.exports, p),c.loaded = !0,c.exports}xx = pp.m = u,p.c = m,p.amdD = function() {throw Error("define cannot be used indirect")},p.amdO = {},e = [],p.O = function(a, c, d, f) {if (c) {f = f || 0;for (var t = e.length; t > 0 && e[t - 1][2] > f; t--)e[t] = e[t - 1];e[t] = [c, d, f];return}for (var r = 1 / 0, t = 0; t < e.length; t++) {for (var c = e[t][0], d = e[t][1], f = e[t][2], b = !0, o = 0; o < c.length; o++)r >= f && Object.keys(p.O).every(function(e) {return p.O[e](c[o])}) ? c.splice(o--, 1) : (b = !1,f < r && (r = f));if (b) {e.splice(t--, 1);var n = d();void 0 !== n && (a = n)}}return a},p.n = function(e) {var a = e && e.__esModule ? function() {return e.default}: function() {return e};return p.d(a, {a: a}),a},c = Object.getPrototypeOf ? function(e) {return Object.getPrototypeOf(e)}: function(e) {return e.__proto__},p.t = function(e, d) {if (1 & d && (e = this(e)),8 & d || "object" == typeof e && e && (4 & d && e.__esModule || 16 & d && "function" == typeof e.then))return e;var f = Object.create(null);p.r(f);var t = {};a = a || [null, c({}), c([]), c(c)];for (var r = 2 & d && e; "object" == typeof r && !~a.indexOf(r); r = c(r))Object.getOwnPropertyNames(r).forEach(function(a) {t[a] = function() {return e[a]}});return t.default = function() {return e},p.d(f, t),f},p.d = function(e, a) {for (var c in a)p.o(a, c) && !p.o(e, c) && Object.defineProperty(e, c, {enumerable: !0,get: a[c]})},p.f = {},p.e = function(e) {return Promise.all(Object.keys(p.f).reduce(function(a, c) {return p.f[c](e, a),a}, []))},p.u = function(e) {return "chunks/" + (({101: "main-search-routes",213: "comments-v3",222: "flv.js",317: "shared-a82b31939292150a315895fb7cae7441d516f926",358: "navbar-notifications",430: "GoodsRecommendGoodsCardList",450: "gaokao-pray-kanshan-animation-data",615: "EmptyViewNormalNoWorksDark",620: "lib-2ec050f6",876: "report_modals",887: "lib-0e5ce61e",961: "shared-2ea0ca79748a747dd313ea2d7da73715418c93a8",987: "comment-richtext",1128: "Chart",1167: "shared-707a11ebc868d394defdec5e3c9c3bd627194a5c",1243: "zswsdid",1306: "main-messages-routes",1339: "shared-b6476ad5d46ee24825cb8ed41ab2c0e5874b34d9",1353: "main-roundtable-routes",1416: "EmptyViewCompactNoNetworkDark",1520: "player-vendors",1632: "main-signin-routes",1801: "EmptyViewNormalLoadingError",1951: "VideoUploadCoverEditor",2033: "Labels",2096: "EmptyViewCompactNoBalance",2121: "main-notifications-routes",2156: "EditableV2",2330: "lib-6efc30be",2433: "shared-0b43bf3e67dbb6b623fe8ec6c5d091d1b549b2dc",2492: "main-special-routes",2520: "main-question-routes",2607: "lib-5c8e84aa",2749: "statsc-deflateAsync",2850: "lib-29107295",3026: "FeeConsultCard",3084: "gaokao-pray-cheer-animation-data",3199: "writePinV2RichInput",3232: "EmptyViewNormalNoCollectionDark",3550: "lib-330004dc",3562: "EmptyViewCompactContentErrorDark",3584: "VideoAnswerLabel",3591: "shared-d0bb0dc86392a7e972798467f9dd20ba179b044b",3634: "main-creator-routes",3764: "EmptyViewCompactNoWorks",3775: "react-id-swiper",3786: "navbar-messages",3795: "shared-a3708c7e8c84cce0a3b8da43db0c3cd735be2320",4055: "KnowledgeForm",4117: "lib-0de40faf",4167: "VideoController",4173: "EmptyViewNormalDefault",4202: "EmptyViewNormalNoBalanceDark",4260: "lib-fae4f1f9",4306: "shared-1dc039f938b8c8c82c4a01096928ebdb708d2ad3",4361: "main-topic-routes",4408: "mqtt",4418: "theater-player",4428: "shared-7df56d9846d5f71fc0428c60463f36496d768b20",4691: "collection-Scroller",4708: "EmptyViewCompactNoNetwork",4713: "main-knowledge-plan-routes",4813: "shared-c28a9bf3464dd32af4306520d44ac7bcef62e866",4814: "EmptyViewCompactNoWorksDark",4837: "EmptyViewCompactLoadingError",4862: "shared-11cdd05708e8231a679e46442ff0ae122532f1bc",4995: "shared-33741370830005be76ce2de074412d202d48915c",5039: "shared-715e2b94686611ad1cbbf4b818f02aac0714ea33",5052: "EditorHelpDocMoveableWrapper",5100: "EmptyViewNormalContentErrorDark",5117: "main-email-register-routes",5221: "EmptyViewCompactNoCollection",5290: "main-collections-routes",5316: "main-host-routes",5327: "EmptyViewNormalNoNetwork",5344: "lib-026acc69",5373: "EmptyViewNormalNoNetworkDark",5389: "react-draggable-tags",5423: "lib-223e7b1c",5518: "lib-a4c92b5b",5546: "lib-4b14521a",5560: "richinput",5634: "WriteShieldModalComp",5640: "globalOrgReport",5667: "main-settings-routes",5829: "shared-30b2a91d27f48fa9c977462bb1d69791a88a1110",5857: "main-org-routes",5898: "main-topstory-routes",5954: "shared-c1b26e28f9af848665b4dda36429ffbbc02ba722",6018: "lib-ea88be26",6034: "EmptyViewNormalNoBalance",6131: "creation-manage-action-list",6186: "shared-295135e8c88ceb7996dada75fdffe2d75463933b",6246: "VideoCoverEditorNew",6248: "lib-cf230269",6272: "lib-83b0f42f",6308: "shared-01887f90d4209a665c4490216b4fe93291dfcb16",6414: "main-collection-routes",6478: "main-campaign-routes",6559: "ECharts",6567: "lib-0bf4e2b2",6649: "lib-74f62c79",6668: "main-mcn-routes",6670: "lib-9b20c40c",6754: "lib-75fc9c18",6763: "ScoreLineChart",6765: "contribution-modal",6815: "PcCommentFollowPlugin",6869: "main-explore-routes",6972: "EmptyViewCompactContentError",7050: "lib-38cf5c11",7137: "shared-faeff54b296b1c154036fc9f6ca9c13ea6d336f2",7190: "InlineVideo",7223: "EmptyViewCompactNoCollectionDark",7232: "shared-e5fb4baf7f81913234c8ae38d77981ef34c5b741",7556: "EmptyViewNormalNoWorks",7590: "EmptyViewCompactDefault",7629: "EmptyViewNormalContentError",7749: "lib-f3572862",7774: "shared-fc98d85e67c72da9b93c445f739859b1dd44194e",7848: "EcommerceAdCard",7856: "comment-manage-footer",7926: "EmptyViewCompactDefaultDark",7936: "richinputV2",7970: "biz-co-creation",8084: "EmptyViewNormalNoCollection",8089: "shared-2f02f8a08f7b763946110f65e90e828646e7116d",8128: "main-ai-routes",8214: "main-help-center-routes",8368: "shared-1dffcf43329e08de9bcf385e1895bae6667163e6",8400: "ECommerceAd",8438: "EmptyViewCompactLoadingErrorDark",8484: "shared-ff6488b53b31e2f26005da423c1542f5a34ce2b9",8608: "shared-299e64daabd85e596c68c7164ca822525e0cb130",8671: "shared-344960c9bb3f9e501026d17224a6974d3281f1a3",8689: "shared-cd15ca5c27a51a9fad00d5093a6db111400bed7c",8691: "shared-073eac630e6836c1bbd6d77c60c691ecb2181c24",8816: "EmptyViewCompactNoBalanceDark",8885: "lib-79b5cf47",9202: "main-wiki-routes",9247: "image-editor",9252: "EmptyViewNormalDefaultDark",9361: "Carousel",9378: "EmptyViewNormalLoadingErrorDark",9381: "shared-bf75e5e55bf5fea7a3c8e646095af08c94e53059",9597: "user-hover-card",9768: "main-creator-salt-routes",9956: "main-signup-routes"})[e] || e) + "." + ({101: "4451673656ebceba1b10",213: "e1fed6d817167920c13c",222: "e63aba2416353b28e558",317: "284073078efe94d56a0d",358: "92ab66d0a0a17a554807",413: "817f44466bf02a01eb4b",430: "7fa3756821cc952e8e15",450: "4cd352d1f17a617786e7",588: "1211249f72a4ef62e880",615: "c791e3e3806ecc419fc7",620: "bae6b6ead4ca63bf1980",712: "7a6de9bf170adfc4ca57",876: "38a4610c511d109a07f0",887: "6f403c36b8dea6c9a61c",961: "95f66518893b69b9f2d6",987: "5490a0daf1508a160390",1057: "43cd0f1697dfb611a25f",1128: "a0a6af99f370a45c39cf",1167: "e3c484e37ee00062188e",1243: "993bf3e63383befd3ad6",1306: "248ba7aeb2daf69610c4",1339: "ed56cad7730d5b8e2f0d",1353: "49bae6e0878ab45264d1",1379: "3f4baf3b8bbf727edb3d",1416: "fdf2f9be95a2fa77ae8f",1520: "80461ab2f296110cbc22",1580: "09e02ff7bd6ca17e38d8",1599: "0c909a92fd3ffe3aa34e",1632: "22e35b497e7140843b69",1801: "1f992dc2aa95c229faef",1951: "7ef612eb189bd5ee1dc5",2033: "3f51936b7c6243022af1",2057: "fd907bcae8e7e193dd3e",2096: "ebf74c7ecd3823049135",2121: "678cbb939669c590def9",2156: "9f60cf148cb60a4c8cda"