如下所示,a標簽的url地址打開后返回403,而手動頁面點擊后則是另一個url,代表這個a標簽的url内容是經過點擊后加密,
我們找到事件監聽,click那裏,斷點
剩下交給gpt吧
代碼如下:
const CryptoJS = require('crypto-js');
function encryptUrl(hh, s) {
if (!hh || hh === '#') {
return null;
}
const aa = hh.split('/');
const aaa = aa.length;
const bbb = aa[aaa - 1].split('.');
const ccc = bbb[0];
const cccc = bbb[1];
const r = /^\+?[1-9][0-9]*$/;
if (r.test(ccc) && cccc && cccc.indexOf('jhtml') !== -1) {
const srcs = CryptoJS.enc.Utf8.parse(ccc);
const k = CryptoJS.enc.Utf8.parse(s);
const en = CryptoJS.AES.encrypt(srcs, k, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
});
let ddd = en.toString();
ddd = ddd.replace(/\//g, "^");
ddd = ddd.substring(0, ddd.length - 2);
const bbbb = `${ddd}.${bbb[1]}`;
aa[aaa - 1] = bbbb;
let uuu = '';
for (let i = 0; i < aaa; i++) {
uuu += `${aa[i]}/`;
}
uuu = uuu.substring(0, uuu.length - 1);
return uuu;
}
return hh;
}
module.exports = encryptUrl;
hh = 'http://ggzy.zwfwb.tj.gov.cn/jyxxxqgg/1272234.jhtml'
s = "qnbyzzwmdgghmcnm"
console.log(encryptUrl(hh,s))