【Web前端问题】前端网页js怪异跳转,帮忙看看这是啥问题
我扒了一个网站,
首页静态页面 打开后
过一段时间会引用外部资源
然后,跳转到原网站
我想把他这个东西给删掉
怀疑片段代码一
location.href.search(new RegExp("(baidu|local)\\.com")) === -1 && setTimeout(function() { alert("开始跳转"+location.href.search(new RegExp("(baidu|local)\\.com"))+"/"+6);
location.href = "http://www.baidu.com/"
}, 6e4),
怀疑片段代码二
eval(function(t, e, n, i, o, r) { if (o = function(t) {
return (t < e ? "" : o(parseInt(t / e))) + ((t %= e) > 35 ? String.fromCharCode(t + 29) : t.toString(36))
}
,
!"".replace(/^/, String)) {
for (; n--; )
r[o(n)] = i[n] || o(n);
i = [function(t) {
return r[t]
}
],
o = function() {
return "\\w+"
}
,
n = 1
}
for (; n--; )
i[n] && (t = t.replace(new RegExp("\\b" + o(n) + "\\b","g"), i[n]));
return t
}("i(7.8.l(j k('\\g\\6\\a\\e\\d\\f\\9\\4\\3\\h\\9\\m\\\\\\2\\3\\4\\c'))===-1){s(t(){7.8='\\r\\b\\b\\o\\p\\5\\5\\0\\0\\0\\2\\6\\a\\e\\d\\2\\3\\4\\c\\5'},q*n)}", 30, 30, "x77||x2e|x63|x6f|x2f|x39|location|href|x6c|x31|x74|x6d|x64|x75|x7c|x28|x61|if|new|RegExp|search|x29|1000|x70|x3a|60|x68|setTimeout|function".split("|"), 0, {}))
上面说的“过一段时间会引用外部资源”
文件路径:debugger:///VM9432
文件代码:
if(location.href.search(new RegExp('\x28\x39\x31\x75\x64\x7c\x6c\x6f\x63\x61\x6c\x29\\\x2e\x63\x6f\x6d'))===-1){setTimeout(function(){location.href='\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x39\x31\x75\x64\x2e\x63\x6f\x6d\x2f'},60*1000)}
即使注销了“代码一”,网站过短时间,依旧跳转;
我怀疑“外部资源”的代码是通过“怀疑代码二”的eval()方法生成,
希望大神帮忙瞅瞅!
回答:
你的第二段就是一个被加密的代码 解析之后:
if (location.href.search(new RegExp('(91ud|local)\\.com')) === -1) { setTimeout(function() {
location.href = 'http://www.91ud.com/'
}, 60 * 1000)
}
应该很清楚了吧
回答:
网址:https://tool.lu/js/上面代码是...,解密需要点2次就行了
以上是 【Web前端问题】前端网页js怪异跳转,帮忙看看这是啥问题 的全部内容, 来源链接: utcz.com/a/135364.html