京东h5st逆向 h5st代码之拓展

知识点

node安装模块
crypto-js JavaScript 中的加密库 则更偏向于消息摘要算法、对称加密和简单的哈希函数,支持 AES、DES、SHA-1、HMAC 等诸多算法,适用于对客户端本地存储的数据进行加密、散列或签名处理等场景
axios 一旦安装成功,我们就可以在代码中使用Axios来发送HTTP请求了。首先,我们需要在代码中导入Axios模块
adler-32 校验和 算法
npm install axios 案例

废话不多说直接上代码

const CryptoJS = require("crypto-js");
const axios = require("axios");
const ADLER32 = require("adler-32");class h5st {constructor(cookieStr, userAgent, config, url) {this.cookieStr = cookieStr;this.userAgent = userAgent;if (url) {try {this.url = url;this.origin = new URL(url).origin;} catch(e) {console.log('url传递错误')}}this.map = new Map();this.settings = {debug: !1,preRequest: !1,timeout: 2,};var Q_ = {DYNAMIC_TOKEN: "WQ_dy_tk_s_file",DYNAMIC_ALGORITHM: "WQ_dy_algo_s_file",VK: "WQ_vk1_file",FLAG: "WQ_f_v_file",};this.gb = { UNSIGNABLE_PARAMS: 1, APPID_ABSENT: 2, TOKEN_EMPTY: 3, GENERATE_SIGNATURE_FAILED: 4, UNHANDLED_ERROR: -1 };this._storagetokenKey = Q_.DYNAMIC_TOKEN;this._storageAlgnKey = Q_.DYNAMIC_ALGORITHM;this._storageFormatVersionKey = Q_.FLAG;this._version = "4.2";this._storageFpKey = Q_.VK;this._token = "";this._defaultToken = "";this._isNormal = !1;this._appId = "";this._defaultAlgorithm = {local_key_1: CryptoJS.MD5,local_key_2: CryptoJS.SHA256,local_key_3: CryptoJS.HmacSHA256,};this.algos = {MD5: CryptoJS.MD5,SHA256: CryptoJS.SHA256,SHA512: CryptoJS.SHA512,HmacSHA256: CryptoJS.HmacSHA256,HmacSHA512: CryptoJS.HmacSHA512,HmacMD5: CryptoJS.HmacMD5,};this._formatVersion = 4.2;this._fingerprint = "";config = Object.assign({}, this.settings, config);this.__iniConfig(config);}S_(t) {function w_(t, r) {r = r || 0;for (var n = t.length - r, e = new Array(n); n--; ) e[n] = t[n + r];return e;}if (t) {var n = "[sign] ",o = new Array(arguments.length > 1 ? arguments.length - 1 : 0),i = 1;for (var i = 1; i < arguments.length; i++) {o[i - 1] = arguments[i];}var a = w_(o);console.log([n].concat(a));}}x_(params) {// console.log(JSON.stringify(params));}async __iniConfig(t) {var i = t.appId,a = t.preRequest,u = t.debug,c = t.timeout,f = t.onSign,s = t.onRequestToken,v = t.onRequestTokenRemotely;(!("string" == typeof t.appId) || !t.appId) && console.error("settings.appId must be a non-empty string");this._appId = i || "";if (this._appId) {this._storagetokenKey = "".concat(this._storagetokenKey, "_").concat(this._appId);this._storageAlgnKey = "".concat(this._storageAlgnKey, "_").concat(this._appId);this._storageFormatVersionKey = "".concat(this._storageFormatVersionKey, "_").concat(this._appId);this._storageFpKey = "".concat(this._storageFpKey, "_").concat(this._appId);}this._timeout = Number(c);this._debug = Boolean(u);this._onSign = "function" == typeof f ? f : this.x_;this._onRequestToken = "function" == typeof s ? s : this.x_;this._onRequestTokenRemotely = "function" == typeof v ? v : this.x_;this.S_(this._debug, "create instance with appId=".concat(this._appId));this.S_(this._debug, "create instance with timeout=".concat(this._timeout));if (a) await this.__requestDeps();}__genDefaultKey(t, r, n, e) {function C_(t) {return (t + "===".slice((t.length + 3) % 4)).replace(/-/g, "+").replace(/_/g, "/");}var z = this,D = "",B = "9>5*t5";var L = "".concat(t).concat(r).concat(n).concat(e).concat(B),M = CryptoJS.enc.Utf8.stringify(CryptoJS.enc.Base64.parse(C_(this.__parseToken(t, 16, 28))));var E = M.match(/^[123]([x+][123])+/);if (E) {var k = E[0].split(""),T = this._defaultAlgorithm,P = "";k.forEach(function (r) {var e = ["+", "x"];if (isNaN(r)) e.indexOf(r) >= 0 && (P = r);else {var u = "".concat("local_key_").concat(r);if (T[u])switch (P) {case "+":D = "".concat(D).concat(z.__algorithm(u, L, t));break;case "x":D = z.__algorithm(u, D, t);break;default:D = z.__algorithm(u, L, t);}}});}this.S_(this._debug, "__genDefaultKey input=" + L + ",express=" + M + ",key=" + D);return D;}__algorithm(t, r, n) {var o = this._defaultAlgorithm[t];return t === "local_key_3" ? o(r, n).toString(CryptoJS.enc.Hex) : o(r).toString(CryptoJS.enc.Hex);}__parseToken(t, r, n) {return t ? t.slice(r, n) : "";}__parseAlgorithm(t, r) {if (t && r) {this._token = t || "";this.__genKey = (r && new Function("return ".concat(r))()) || null;var a = this._token && this.__genKey;this._isNormal = a;return a;}return !1;}__genSignParams(t, r, n, e) {return ["".concat(n),"".concat(this._fingerprint),"".concat(this._appId),"".concat(this._isNormal ? this._token : this._defaultToken),"".concat(t),"".concat(this._version),"".concat(r),"".concat(e),].join(";");}__genSign(t, r) {var l = r.map(function (t) {return t.key + ":" + t.value;}).join("&");var h = CryptoJS.SHA256(t + l + t).toString(CryptoJS.enc.Hex);this.S_(this._debug, "__genSign, paramsStr:".concat(l, ", signedStr:").concat(h));return h;}async __requestDeps() {function Xb() {var U = "6d0jhqw3pa";var nt = Vb(U, 4);var rt = Jb();var Q = tw(U, nt);var tt =Qb({ size: rt, num: Q }) +nt +Qb({size: 11 - rt,num: Q,}) +rt;var Z = tt.split("");var X = Z.slice(0, 14);var J = Z.slice(14);var V = [];for (; X.length > 0; ) V.push((35 - parseInt(X.pop(), 36)).toString(36));V = V.concat(J);var Y = V.join("");return Y;}function Vb(t, r) {var b,C = [],A = t.length,S = (function (t, r) {var lt;if (typeof Ld === "undefined" || t[Symbol.iterator] == null) {if (Array.isArray(t) || (lt = Yb(t)) || (r && t && typeof t.length === "number")) {lt && (t = lt);var dt = 0;return {s: function () {},n: function () {if (dt >= t.length) {return {done: !0,};}return {done: !1,value: t[dt++],};},e: function (t) {throw t;},f: function () {},};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var st,vt = !0,ht = !1;return {s: function () {lt = t[Symbol.iterator]();},n: function () {var r = lt.next();return (vt = r.done), r;},e: function (t) {(ht = !0), (st = t);},f: function () {try {!vt && lt.return != null && lt.return();} finally {if (ht) throw st;}},};})(t);try {for (S.s(); !(b = S.n()).done; ) {var z = b.value;if (Math.random() * A < r && (C.push(z), --r == 0)) break;A--;}} catch (t) {S.e(t);} finally {S.f();}for (var D = "", B = 0; B < C.length; B++) {var j = (Math.random() * (C.length - B)) | 0;(D += C[j]), (C[j] = C[C.length - B - 1]);}return D;}function Yb(t, r) {if (!t) return;if (typeof t === "string") return Ub(t, r);var D = t.slice(8, -1);D === "Object" && t.constructor && (D = t.constructor.name);if (D === "Map" || D === "Set") return Array.from(t);if ("Arguments" === D || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/["test"](D)) return Ub(t, r);}function Ub(t, r) {(r == null || r > t.length) && (r = t.length);for (var h = 0, l = new Array(r); h < r; h++) l[h] = t[h];return l;}function Jb() {return (Math.random() * 10) | 0;}function tw(t, r) {for (var d = 0; d < r.length; d++) {var x = t.indexOf(r[d]);x !== -1 && (t = t.replace(r[d], ""));}return t;}function Qb(t) {var _ = t.size,g = t.num;for (var y = ""; _--; ) y += g[(Math.random() * g.length) | 0];return y;}var storageFormatVersion = this.getSync(this._storageFormatVersionKey);this.S_(this._debug, "__requestDeps, storageFormatVersion:" + storageFormatVersion + ", _formatVersion:" + this._formatVersion);if (!storageFormatVersion || storageFormatVersion !== this._formatVersion) {this.removeSync(this._storageFpKey);this.removeSync(this._storagetokenKey);this.removeSync(this._storageAlgnKey);this.setSync(this._storageFormatVersionKey, this._formatVersion, { expire: 365 * (3600 * 24) });}this._fingerprint = this.getSync(this._storageFpKey);if (this._fingerprint) {this.S_(this._debug, "__requestDeps use cache fp, fp:" + this._fingerprint);} else {this._fingerprint = Xb();this.setSync(this._storageFpKey, this._fingerprint, { expire: 3600 * 24 * 365 });this.S_(this._debug, "__requestDeps use new fp, fp:" + this._fingerprint);}var token = CryptoJS.enc.Utf8.stringify(CryptoJS.enc.Base64.parse(this.getSync(this._storagetokenKey) || ""));var algorithm = CryptoJS.enc.Utf8.stringify(CryptoJS.enc.Base64.parse(this.getSync(this._storageAlgnKey) || ""));if (this.__parseAlgorithm(token, algorithm)) {var response = {code: 0,message: "use normalToken",};this._onRequestToken(response);this.S_(this._debug, "__requestDeps, use cache token, token:" + this._token);return;}var response = {code: 1,message: "use defaultToken",};this._onRequestToken(response);this.S_(this._debug, "__requestDeps, start __requestAlgorithm, fp:" + this._fingerprint);try {await this.__requestAlgorithm();} catch (error) {this.S_(this._debug, "__requestDeps request token failed, error: " + error);}this.S_(this._debug, "__requestDeps, end __requestAlgorithm, fp:".concat(this._fingerprint));}async __requestAlgorithm() {var Dt = this.Cw(0);Dt.ai = this._appId;Dt.fp = this._fingerprint;var Bt = JSON.stringify(Dt, null, 2);this.S_(this._debug, "__requestAlgorithm envCollect=".concat(Bt));var jt = CryptoJS.AES.encrypt(Bt, CryptoJS.enc.Utf8.parse("wm0!@w-s#ll1flo("), {iv: CryptoJS.enc.Utf8.parse("0102030405060708"),});var fr = {fingerprint: this._fingerprint,appId: this._appId,version: this._version,timeout: this._timeout,env: jt.ciphertext.toString(),debug: this._debug,};var result = await this.im(fr, this._onRequestTokenRemotely);var h = result.algo,l = result.token,p = result.fp;var v = this.__parseAlgorithm(l, h);if (!v) return;var d = this.getSync(this._storageFpKey, 1);if (!p || (d && p === d)) {var w = this.__parseToken(l, 13, 15);var A = parseInt(w, 16);var C = 60 * A * 60;this.setSync(this._storagetokenKey, CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(l)), { expire: C });this.setSync(this._storageAlgnKey, CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(h)), { expire: C });this.S_(this._debug, "__requestAlgorithm request success!, token:".concat(l));} else {this.S_(this._debug, "__requestAlgorithm request success!,  but not save token:".concat(l, ", storageFp:").concat(d, ", fp:").concat(p));}return;}async im(t, r) {try {var { data, status } = await axios({url: "https://cactus.jd.com/request_algo",method: "post",data: {version: t.version,fp: t.fingerprint,appId: t.appId,timestamp: Date.now(),platform: "web",expandParams: t.env,fv: "h5_npm_v4.2.0",},headers: {"Content-Type": "application/json;charset=utf-8",Origin: "https://cactus.jd.com",Host: "cactus.jd.com",accept: "*/*","User-Agent": this.userAgent,},});var a = {code: status,message: "",};r && r(a);if (status == 200 && data && data.data && data.data.result) {var f = data.data.result,s = f.algo,v = f.tk,h = f.fp;if (s && v) {var l = {algo: s,token: v,fp: h,};return l;} else {console.log("data.result format error.");}} else {console.log("request params error.");}} catch (e) {var b = e.code,w = e.message;r &&r({code: b,message: w,});console.log("request error, ".concat(b, ", ").concat(w));}return {};}__checkParams(t) {function jm(t) {return "[object Object]" === Object.prototype.toString.call(t);}function Lm(t) {return !!jm(t) && !Object.keys(t).length;}function b_(t) {var _m = ["h5st", "_stk", "_ste"];for (var r = Object.keys(t), n = 0; n < r.length; n++) {var e = r[n];if (_m.indexOf(e) >= 0) {return !0;}}return !1;}var b = null;if (!this._appId) {b = {code: this.gb.APPID_ABSENT,message: "appId is required",};}if (!jm(t)) {b = {code: this.gb.UNSIGNABLE_PARAMS,message: "params is not a plain object",};}if (Lm(t)) {b = {code: this.gb.UNSIGNABLE_PARAMS,message: "params is empty",};}if (b_(t)) {b = {code: this.gb.UNSIGNABLE_PARAMS,message: "params contains reserved param name.",};}if (b) return this._onSign(b), null;var g = Object.keys(t).sort().map(function (r) {return {key: r,value: t[r],};}).filter(function (t) {let type = typeof t.value;return ("number" == type && !isNaN(t.value)) || "string" == type || "boolean" == type;});if (g.length === 0) {var _ = {code: this.gb.UNSIGNABLE_PARAMS,message: 'params is empty after excluding "unsafe" params',};this._onSign(_);return null;}return g;}__makeSign(t, r) {function xb() {var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : Date.now(),e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "yyyy-MM-dd",n = new Date(t),r = e,o = {"M+": n.getMonth() + 1,"d+": n.getDate(),"D+": n.getDate(),"h+": n.getHours(),"H+": n.getHours(),"m+": n.getMinutes(),"s+": n.getSeconds(),"w+": n.getDay(),"q+": Math.floor((n.getMonth() + 3) / 3),"S+": n.getMilliseconds(),};return (/(y+)/i.test(r) && (r = r.replace(RegExp.$1, "".concat(n.getFullYear()).substr(4 - RegExp.$1.length))),Object.keys(o).forEach(function (t) {if (new RegExp("(".concat(t, ")")).test(r)) {var e = "S+" === t ? "000" : "00";r = r.replace(RegExp.$1, 1 == RegExp.$1.length ? o[t] : "".concat(e).concat(o[t]).substr("".concat(o[t]).length));}}),r);}function uw(t) {var ht = {magic: "tk",version: "02",platform: "w",expires: "41",producer: "l",expr: gw(),cipher: fw(t),};ht.adler32 = cw(ht.magic + ht.version + ht.platform + ht.expires + ht.producer + ht.expr + ht.cipher);return ht.magic + ht.version + ht.platform + ht.adler32 + ht.expires + ht.producer + ht.expr + ht.cipher;}function gw() {var G = {size: 32,dictType: "max",customDict: null,};var N = d_(G);var R = ["1", "2", "3"];var Y = ["+", "x"];var F = 2 + Math.floor(Math.random() * 4);var K = "";for (var W = 0; W < F; W++) (K += R[Math.floor(3 * Math.random())]), W < F - 1 && (K += Y[Math.floor(2 * Math.random())]);K.length < 9 && (K += N.substr(0, 9 - K.length));var H = CryptoJS.enc.Utf8.parse(K);var q = CryptoJS.enc.Base64.stringify(H);return A_(q);}function d_() {var t,r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},n = r.size,e = void 0 === n ? 10 : n,o = r.dictType,i = void 0 === o ? "number" : o,a = r.customDict,u = "";if (a && "string" == typeof a) t = a;elseswitch (i) {case "alphabet":t = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";break;case "max":t = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";break;case "number":default:t = "0123456789";}for (; e--; ) u += t[(Math.random() * t.length) | 0];return u;}function A_(t) {return t.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");}function fw(t) {d_({size: 32,dictType: "max",customDict: null,});var J = "";var Z = Date.now();var V = "z7";var $ = "qem7+)g%Dhw5";var Q = sw(t, Z, V, $);J += lw(Q);J += lw(V);J += lw($);J += xw(Z);J += lw(t);var X = CryptoJS.enc.Hex.parse(J);var tt = CryptoJS.AES.encrypt(X, CryptoJS.enc.Utf8.parse("x6e@RoHi$Fgy7!5k"), { iv: CryptoJS.enc.Utf8.parse("0102030405060708") });return A_(CryptoJS.enc.Base64.stringify(tt.ciphertext));}function sw(t, r, n, e) {var nt = new Uint8Array(16);nt.forEach(function (r, n, e) {e[n] = t.charCodeAt(n);});var et = pw(r),ot = new Uint8Array(2);ot.forEach(function (t, r, e) {e[r] = n.charCodeAt(r);});var at = new Uint8Array(12);at.forEach(function (t, r, n) {n[r] = e.charCodeAt(r);});var ut = new Uint8Array(38);ut.set(ot), ut.set(at, 2), ut.set(et, 14), ut.set(nt, 22);var ct = adler32.buf(ut);var st = "00000000" + (ct = ct >>> 0).toString(16);return st["substr"](st.length - 8);}function pw(t) {var C = (function () {var n = new ArrayBuffer(2);return new DataView(n).setInt16(0, 256, !0), new Int16Array(n)[0] === 256;})(),A = Math.floor(t / Math.pow(2, 32)),S = t % Math.pow(2, 32),z = new ArrayBuffer(8),D = new DataView(z);return C ? (D.setUint32(0, S, C), D.setUint32(4, A, C)) : (D.setUint32(0, A, C), D.setUint32(4, S, C)), new Uint8Array(z);}function xw(t) {return vw(pw(t));}function lw(t) {var h = new Uint8Array(t.length);h.forEach(function (r, n, e) {e[n] = t.charCodeAt(n);});return vw(h);}function vw(t) {return t.map(function (t) {return "00" + (t & 255).toString(16).slice(-2);}).join("");}function cw(t) {var h = ADLER32.str(t);h >>>= 0;var y = "00000000" + h.toString(16);return y["substr"](y.length - 8);}var f = "";var b = Date.now();var s = xb(b, "yyyyMMddhhmmssSSS");var v = s + "74";if (this._isNormal) {f = this.__genKey(this._token, this._fingerprint, v, this._appId, this.algos).toString() || "";} else {this._defaultToken = uw(this._fingerprint);f = this.__genDefaultKey(this._defaultToken, this._fingerprint, v, this._appId);}var h = {};if (f) {var l = this.__genSign(f, t);var p = t.map(function (t) {return t.key;}).join(",");var d = this.__genSignParams(l, b, s, r);var x = {key: f,signStr: l,_stk: p,_ste: 1,h5st: d,};this.S_(this._debug, "__makeSign, result:" + JSON.stringify(x, null, 2));var h = {_stk: p,_ste: 1,h5st: d,};var g = {code: 0,message: "success",};this._onSign(g);return h;}if (this._token || this._defaultToken) {var _ = {code: this.gb.GENERATE_SIGNATURE_FAILED,message: "generate key failed",};this._onSign(_);} else {var m = {code: this.gb.TOKEN_EMPTY,message: "token is empty",};this._onSign(m);}}__collect() {var T = this.Cw(1);T.fp = this._fingerprint;var P = JSON.stringify(T, null, 2);this.S_(this._debug, "__collect envCollect=".concat(P));var I = CryptoJS.AES.encrypt(P, CryptoJS.enc.Utf8.parse("DNiHi703B0&17hh1"), {iv: CryptoJS.enc.Utf8.parse("0102030405060708"),});return I.ciphertext.toString();}async sign(t) {try {var e = Date.now();var o = this.__checkParams(t);if (o == null) {return t;}await this.__requestDeps();var collectedData = this.__collect();var a = this.__makeSign(o, collectedData);this.S_(this._debug, "sign elapsed time!".concat(Date.now() - e, "ms"));return Object.assign({}, t, a);} catch (e) {var J = {code: this.gb.UNHANDLED_ERROR,message: "unknown error",};this._onSign(J);return t;}}getSync(e) {return this.map.get(e);}removeSync(e) {this.map.delete(e);}setSync(k, v) {this.map.set(k, v);}Cw(o) {var temp = this;function mw(t) {if (temp.cookieStr) {var r = new RegExp("(^| )" + t + "(?:=([^;]*))?(;|$)"),n = temp.cookieStr.match(r);if (!n || !n[2]) return "";var e = n[2];try {return /(%[0-9A-F]{2}){2,}/.test(e) ? decodeURIComponent(e) : unescape(e);} catch (t) {return unescape(e);}}}function d_() {var t,r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {},n = r.size,e = void 0 === n ? 10 : n,o = r.dictType,i = void 0 === o ? "number" : o,a = r.customDict,u = "";if (a && "string" == typeof a) t = a;elseswitch (i) {case "alphabet":t = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";break;case "max":t = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";break;case "number":default:t = "0123456789";}for (; e--; ) u += t[(Math.random() * t.length) | 0];return u;}var ft = ["pp", "sua", "random", "referer", "v", "extend"];var ct = {};var st = function (key, func) {try {if ((o === 1 && ft.includes(key)) || o === 0) {ct[key] = func();}} catch (e) {console.log(e);}};st("wc", function (t) {//   return /Chrome/.test(window.navigator.userAgent) && !window.chrome ? 1 : 0;return 0;});st("wd", function (t) {//   return navigator.webdriver ? 1 : 0;return 0;});st("l", function (t) {//   return navigator.language;return "zh-CN";});st("ls", function (t) {//   return navigator.languages.join(",");return "zh-CN,zh";});st("ml", function (t) {//   return navigator.mimeTypes.length;return 0;});st("pl", function (t) {//   return navigator.plugins.length;return 0;});st("av", function (t) {//   return navigator.appVersion;let av = temp.userAgent.match(/(?<=\/)[0-9]\.0[^'"\n]+/g);return av.length > 0 ? av[0] : "";});st("ua", function (t) {//   return window.navigator.userAgent;return temp.userAgent;});st("sua", function (t) {var regex = new RegExp("Mozilla/5.0 \\((.*?)\\)");//   var matches = window.navigator.userAgent.match(regex);var matches = temp.userAgent.match(regex);return matches && matches[1] ? matches[1] : "";});st("pp", function (t) {var u = {};var i = mw("pwdt_id");var c = mw("pin");var a = mw("pt_pin");i && (u.p1 = i);c && (u.p2 = c);a && (u.p3 = a);return u;});st("extend", function () {// var e = navigator.permissions.query({//     name: "notifications"// })// var Y = 0;// ("cdc_adoQpoasnfa76pfcZLmcfl_Array" in window || "cdc_adoQpoasnfa76pfcZLmcfl_Promise" in window || "cdc_adoQpoasnfa76pfcZLmcfl_Symbol" in window) && (Y |= 1);// ("$chrome_asyncScriptInfo" in window.document || "$cdc_asdjflasutopfhvcZLmcfl_" in window.document) && (Y |= 2);// var n = {//     pm: Notification.permission === "denied" && e.state === "prompt" ? 1 : 0,//     wd: window.navigator.webdriver ? 1 : 0,//     l: !navigator.languages || navigator.languages.length === 0 ? 1 : 0,//     ls: navigator.plugins.length,//     bu1: rm,//     wk: Y// }// return n;return { bu1: "0.1.9", l: 0, ls: 0, wd: 0, wk: 0 };});st("pp1", function (t) {var c = mw("pwdt_id");var u = mw("pin");var a = mw("pt_pin");if (!c && !u && !a) {var i = temp.cookieStr;if (i) return i;}return "";});st("pm", function () {//   var result = navigator.permissions.query({ name: "notifications" });//   return { ps: result.state, np: Notification.permission };return {ps: "prompt",np: "default",};});st("w", function (t) {//   return window.screen.width;return 1536;});st("h", function (t) {//   return window.screen.height;return 864;});st("ow", function (t) {//   return window.outerWidth;return 1536;});st("oh", function (t) {//   return window.outerHeight;return 864;});st("url", function (t) {//   return location.href;return temp.url;});st("og", function (t) {//   return location.origin;return temp.origin;});st("pf", function (t) {//   return window.platform;return undefined;});st("pr", function (t) {//   return window.devicePixelRatio;return 1.25;});st("re", function (t) {//   return document.referrer;return "";});st("random", function (t) {return d_({ size: 10, dictType: "max", customDict: null });});st("referer", function (t) {//   var i = new RegExp("[^?]*"),//     u = document.referrer.match(i);//   if (!u || !u[0]) return "";//   return u[0];return "";});st("v", function (t) {return "h5_npm_v4.2.0";});return ct;}
}async function main() {var cookieStr = "",userAgent ="";var h5stObj = new h5st(cookieStr, userAgent, {debug: false,preRequest: false,timeout: 2,appId: "ea491", onSign: function onSign(e) {e.code;},onRequestTokenRemotely: function onRequestTokenRemotely(e) {e.code, e.message;},onRequestToken: function onRequestToken(e) {e.code, e.message;},});var a = await h5stObj.sign({functionId: "whx_getShopHomeFloorInfo",appid: "shop_m_jd_com",clientVersion: "12.0.0",client: "wh5",body: CryptoJS.SHA256(JSON.stringify({ shopId: "1000002481", source: "m-shop" })).toString(),});console.log(a);//// var params = `functionId=whx_getShopHomeFloorInfo&body=${encodeURIComponent(JSON.stringify({ shopId: "1000002481", source: "m-shop" }))}&appid=shop_m_jd_com&client=wh5&clientVersion=12.0.0&h5st=${//   a.h5st || ""// }`;var params = `pc-item-soa&functionId=pc_detailpage_wareBusiness&client=pc&clientVersion=1.0.0&t=1698813236207&body=${encodeURIComponent(JSON.stringify({"skuId":100064564679,"cat":"1319,11842,14936","area":"12_904_907_50559","shopId":"1000008122","venderId":1000008122,"paramJson":"{'platform2':1,'specialAttrStr':'p0ppppppppp2ppppppppppppppp','skuMarkStr':'00'}","num":1,"bbTraffic":""}))}&h5st=${a.h5st || ""}`;console.log( params);cookie = 'shshshfpa=4b770525-82d6-9dc2-191f-49213e2808af-1693276292; shshshfpx=4b770525-82d6-9dc2-191f-49213e2808af-1693276292; pinId=LxgJESmodokf_AhbrnKClw; pin=jinshiyuan1123; unick=jinshiyuan1123; _tp=qTmSS0pjZ%2BpSltacjzri4w%3D%3D; _pst=jinshiyuan1123; __jdv=76161171|direct|-|none|-|1697592319693; mba_muid=16934744924511616091388; user-key=11a484e2-f35f-4a4f-9827-c95f59dd47eb; __jdu=16983895067841432816868; TrackID=1HFZlWtgARPlbI1mTVFpwZ3u_SB09-1Q_bI6WyUS8IpkISJ6MmmNv6LbsWxET-X7MWNjLiNaACNKV-1Vht0fWcs89QNcw4qXk4Rqhs0xYx08; thor=EEFDDDF33A2E1B1574F38D3AEF89005246E4DF7F7341012C233F05A1CE1050707F2B2C7784309754BA0DF8532A4DF03135775FD5699D900B1443BD2FB2076E4CE284DDE4DF56071F679BE3AC90F368F539C29EBBA1F6CAEB5149648AA360E7948AB67D04395B9891D618EC1E696E8BC2635F84B0B83609EB90421520EB98293C7DF602769976770087AF3D1CBA2510AB; flash=2_7fZdpf_i3XDxiQCGotfuowSRGt_716ZFdTPZqfOjcmExH9AiqitrXU-JV6KP5hIbOio7x8_X8iS7NHJGVpeQRnyZjGY7IVA643W1OyW4DRq*; areaId=12; ipLoc-djd=12-904-907-50559; joyya=1698717531.1698727780.24.0oyeyhv; 3AB9D23F7A4B3C9B=7XKWKVW52FZTKEZTBRHLN5KSUEOMU4POIZAQBRA6ZODCWLPXFZ3VTUJEEWD6VNMV5C6RX3F4J4JIIGCLO65JD33MS4; 3AB9D23F7A4B3CSS=jdd037XKWKVW52FZTKEZTBRHLN5KSUEOMU4POIZAQBRA6ZODCWLPXFZ3VTUJEEWD6VNMV5C6RX3F4J4JIIGCLO65JD33MS4AAAAMLRDXCJ6YAAAAAD7HKTBXNJK6MCMX; __jda=122270672.16983895067841432816868.1698389507.1698735389.1698809391.6; __jdc=122270672; shshshfpb=AAjAp7oiLEncFJYLWncIZH0khPigIrxaTJ2KSSQAAAAA'const { data, status } = await axios({method: "get",url: `https:/api.m.jd.com/?appid=${params}`,headers: {"origin": "https://item.jd.com","cookie":cookie,"x-referer-page":"https://item.jd.com/100064564679.html","User-Agent": userAgent,},});console.log(data);console.log(status);
}main();

node h5st.js
效果图
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/176941.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

prometheus服务发现

Consul简介 ◼ 一款基于golang开发的开源工具&#xff0c;主要面向分布式&#xff0c;服务化的系统提供服务注册、服务发现和配置管理 的功能 ◼ 提供服务注册/发现、健康检查、Key/Value存储、多数据中心和分布式一致性保证等功能 部署 curl -LO https://releases.hashicorp…

Xcode中如何操作Git

&#x1f468;&#x1f3fb;‍&#x1f4bb; 热爱摄影的程序员 &#x1f468;&#x1f3fb;‍&#x1f3a8; 喜欢编码的设计师 &#x1f9d5;&#x1f3fb; 擅长设计的剪辑师 &#x1f9d1;&#x1f3fb;‍&#x1f3eb; 一位高冷无情的编码爱好者 大家好&#xff0c;我是 DevO…

kubernetes-service微服务

目录 一、service微服务 二、Ipvs模式 三、ClusterIP 1.ClusterIP 2.headless 四、NodePort 1.NodePort 2.默认端口 五、LoadBalancer 1.LoadBalancer 2.metallb 六、ExternalName 一、service微服务 Kubernetes Service微服务是一种基于Kubernetes的微服务架构&…

二氧化铈纳米棒 Cerium Oxide Nanorods 氧化铈纳米棒

二氧化铈纳米棒 &#xff08;西&#xff09;产品名称&#xff1a;二氧化铈纳米棒 &#xff08;安&#xff09;英文名称&#xff1a;Cerium Oxide Nanorods &#xff08;瑞&#xff09;成分&#xff1a;氧化铈纳米棒、乙醇 &#xff08;禧&#xff09;浓度&#xff1a;0.1mg…

仿东郊到家按摩小程序app开发搭建

最新版的仿东郊到家按摩小程序&#xff0c;支持上门服务系统&#xff0c;全开源&#xff0c;并且支持公众号、小程序和app。前端使用uniapp&#xff0c;后端使用php&#xff0c;价格合理。用户端功能模块包括技师选择、预约服务、优惠券、订单等&#xff0c;还有意见功能和城市…

Spring Security 6.1.x 系列(4)—— 基于过滤器链的源码分析

一、自动配置 在 Spring Security 6.1.x 系列&#xff08;1&#xff09;—— 初识Spring Security 中我们只引入spring-boot-starter-security 依赖&#xff0c;就可以实现登录认证&#xff0c;这些都得益于Spring Boot 的自动配置。 在spring-boot-autoconfigure模块中集成了…

LSF 守护程序和进程、集群通信路径和安全模型

LSF 细观 了解在 LSF 主机上运行的各种守护进程&#xff0c;LSF 集群通信路径&#xff0c;以及 LSF 如何容许集群中的主机故障。 1、LSF 守护程序和进程 集群中的每个主机上都运行多个 LSF 进程。 正在运行的进程的类型和数量&#xff0c;取决于主机是主节点还是计算节点。 主…

吴恩达《机器学习》2-2->2-4:代价函数

一、代价函数的概念 代价函数是在监督学习中用于评估模型的性能和帮助选择最佳模型参数的重要工具。它表示了模型的预测输出与实际目标值之间的差距&#xff0c;即建模误差。代价函数的目标是找到使建模误差最小化的模型参数。 二、代价函数的理解 训练集数据&#xff1a;假设我…

【ELFK】之Filebeat

一、Filebeat介绍 1、Filebeat是什么&#xff1f; Filebeat适用于转发和集中数据的轻量级传送工具&#xff0c;Filebeat监视了指定的日志文件或位置&#xff0c;收集日志事件&#xff0c;并将他们转发到Elasticsearch或Logstash进行索引。 **Filebeat的工作方式&#xff1a;*…

【ETL工具】Datax-ETL-SqlServerToHDFS

&#x1f984; 个人主页——&#x1f390;个人主页 &#x1f390;✨&#x1f341; &#x1fa81;&#x1f341;&#x1fa81;&#x1f341;&#x1fa81;&#x1f341;&#x1fa81;&#x1f341; 感谢点赞和关注 &#xff0c;每天进步一点点&#xff01;加油&#xff01;&…

iPhone连不上Wi-Fi?看完这篇文章你就知道了!

大家在使用苹果手机的过程中有没有遇到过这样的情况&#xff1a;手机突然连接不上Wi-Fi&#xff0c;或者连接了也根本使用不了。遇到上述情况请不要着急&#xff0c;iphone连不上wifi是由很多种原因导致的。那么&#xff0c;iPhone连接不上Wi-Fi时该怎么办呢&#xff1f; 我们…

css写个三角形

点击三角形&#xff0c;展开或者收起内容 <template><div><div class"zhankai" click"btn()">展开 <span :class"{sanjiao:true,rotate:flag}"></span></div><!-- 展示或者收起 --><el-collapse-…

基于YOLOv8模型暗夜下人脸目标检测系统(PyTorch+Pyside6+YOLOv8模型)

摘要&#xff1a;基于YOLOv8模型暗夜下人脸目标检测系统可用于日常生活中检测与定位黑夜下人脸目标&#xff0c;利用深度学习算法可实现图片、视频、摄像头等方式的目标检测&#xff0c;另外本系统还支持图片、视频等格式的结果可视化与结果导出。本系统采用YOLOv8目标检测算法…

大数据之路-日志采集

数据采集作为大数据体系中的第一环节&#xff0c;对如何全面、高性能、规范完成海量数据的采集&#xff0c;并将其传输到大数据平台。 1.浏览器的页面日志采集 1.1 页面浏览日志采集流程 页面浏览日志是最基础的互联网日志&#xff0c;其中页面浏览量&#xff08;PageView&am…

redis6.0源码分析:跳表skiplist

文章目录 前言什么是跳表跳表&#xff08;redis实现&#xff09;的空间复杂度相关定义 跳表&#xff08;redis实现&#xff09;相关操作创建跳表插入节点查找节点删除节点 前言 太长不看版 跳跃表是有序集合zset的底层实现之一&#xff0c; 除此之外它在 Redis 中没有其他应用。…

深度学习入门(二)之神经网络

文章目录 从感知机到神经网络神经网络的例子复习感知机激活函数 激活函数sigmoid函数阶跃函数的实现阶跃函数的图形sigmoid函数的图形sigmoid函数与阶跃函数比较非线性函数ReLU函数 多维数组的运算多维数组矩阵乘法神经网络的内积 三层神经网络的实现符号确认各层间信号传递的实…

10kb的WordPress外链页面安全跳转插件

老白博客我参照csdn和腾讯云的外链跳转页面&#xff0c;写了一个WordPress外链安全跳转插件&#xff1a;给网站所有第三方链接添加nofollow标签和重定向功能&#xff0c;提高网站安全性。插件包括两个样式&#xff0c;由于涉及到的css不太一样&#xff0c;所以分别写了两个版本…

高效处理异常值的算法:One-class SVM模型的自动化方案

一、引言 数据清洗和异常值处理在数据分析和机器学习任务中扮演着关键的角色。清洗数据可以提高数据质量&#xff0c;消除噪声和错误&#xff0c;从而确保后续分析和建模的准确性和可靠性。而异常值则可能对数据分析结果产生严重影响&#xff0c;导致误导性的结论和决策。因此&…

纪念基于JavaScript 实现的后台桌面 UI 设计

目录 前言 C/S 到 B/S ASP Builder 的诞生 关于 Craneoffice.net 开发环境配置 后台界面的 UI 区域要素 桌面系统的想法和设计 搜索引擎 导航面板 快捷访问 二级导航 小组件及其它 设置桌面壁纸 小时钟 附件小程序 计算器界面设计 日历与任务 系统设置 天气小…

【HeidiSql_01】python在heidisql当中创建新表的注意事项

python在heidisql当中创建新表的注意事项 假设你已经在python当中弄好了所有的结果&#xff0c;并且保存在df_all这个dataframe当中&#xff0c;然后要将其导入数据库当中并创建一张新的表进行保存。 # 构建数据库连接,将merged_df写回数据库 from sqlalchemy import create_e…