a標簽url加密分析

滲透逆向 · 27 天前 · 15 人浏览
a標簽url加密分析

如下所示,a標簽的url地址打開后返回403,而手動頁面點擊后則是另一個url,代表這個a標簽的url内容是經過點擊后加密,
2024-12-21T09:41:16.png
2024-12-21T09:43:31.png
我們找到事件監聽,click那裏,斷點
2024-12-21T09:44:12.png
剩下交給gpt吧
2024-12-21T10:01:24.png
2024-12-21T10:01:45.png
代碼如下:

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))
本站立足于美利堅合衆國,請讀者自覺遵守當地法律!如有違規,本站不承擔任何法律責任! This site is based in the United States of America, readers are requested to abide by local laws! If there are any violations, this site does not bear any legal responsibility! Theme Jasmine by Kent Liao