将一行javascript添加到<head>我所有域的标签中。不确定它是什么或它来自哪里



我在一个托管服务上托管了多个域。所有这些都在标签中添加了一行javascript。它似乎正在将 Math.random 更改为其他内容,但我无法弄清楚它想要完成什么。

我也找不到它来自哪里。我主要拥有WordPress域名,但我的2个网站是静态的,那里的文件已经多年没有被触及了。他们仍然显示这一点。此外,Drupal站点也添加了此功能。

所以,我希望在两件事上得到帮助:1)它在做什么?2)它来自哪里?

我在手机上的安卓浏览器以外的任何浏览器中都能看到它。除了 1 之外,我没有在其他网站上看到它,所以我认为它与我的 PC 或浏览器无关。

这是脚本本身。函数调用参数中的大数字每次都不同。我对匿名函数的了解还不够多,无法真正理清这里发生的事情。

<script type="text/javascript">/* <![CDATA[ */Math.random=function(a,c,d,b){return function(){return 300>d++?(a=(1103515245*a+12345)%b,a/b):c()}}(237429089,Math.random,0,1<<21);(function(){function b(){try{if(top.window.location.href==c&&!0!=b.a){var p=document.createElement('a');p.href=c;var len=p.hostname.length;var sep='';var path=p.pathname;if(p.hostname.charAt(len-1)!='/'){sep=(p.pathname.charAt(0)=='/')?'':'/';}else{if(p.pathname.charAt(0)=='/'){path=p.pathname.slice(1);}}c='http%3A%2F%2F'+p.hostname+sep+path+'%2F';var a=-1!=navigator.userAgent.indexOf('MSIE')?new XDomainRequest:new XMLHttpRequest;a.open('GET','http://1.2.3.4/cserver/clientresptime?cid=CID5460105.AID1492092648.TID387&url='+c+'&resptime='+(new Date-d)+'&starttime='+d.valueOf(),!0);a.send(null);b.a=!0}}catch(e){}}var d=new Date,a=window,c=document.location.href,f='undefined';f!=typeof a.attachEvent?a.attachEvent('onload',b):f!=typeof a.addEventListener&&a.addEventListener('load',b,!1)})();/* ]]> */</script>

更新 - 4月18/17

我已经从其他PC上检查过了,但我仍然得到插入的javascript。另外,我还发现了其他几个标题中包含此代码的网站。它们似乎是WP博客,但并非所有我检查的WP博客都有这个。

在其他论坛上进行了一些提问后,我终于能够找到答案。这是我使用的ISP(加拿大的Xplornet,美国的Hughesnet)插入到网页中,以跟踪其卫星互联网加速的响应时间。它只显示在使用 http 协议而不是 https 的网站中(它们不能注入到这些加密数据包中)。

我不太确定我对此是否满意,因为它会使用更多的带宽来实现他们的目的,并且当我每个月超过限制时,他们很乐意向我收费。尽快找到新ISP的另一个重要原因!

但至少它看起来不是恶意的,在我的主机或我的 PC 上这不是问题,这很好。

感谢大家的帮助!

它似乎不是恶意的。联系您的托管服务提供商,了解他们是否正在插入它和/或尝试找出他们的其他客户是否也有它。

很难说,但它可能是日志记录,缓存或IE检测工具(MSIE代表Microsoft Internet Explorer)。不过,你必须问他们。

未缩小的代码:

Math.random = function(a, c, d, b) {
return function() {
return 300 > d++ ? (a = (1103515245 * a + 12345) % b, a / b) : c()
}
}(237429089, Math.random, 0, 1 << 21);
(function() {
function b() {
try {
if (top.window.location.href == c && !0 != b.a) {
var p = document.createElement('a');
p.href = c;
var len = p.hostname.length;
var sep = '';
var path = p.pathname;
if (p.hostname.charAt(len - 1) != '/') {
sep = (p.pathname.charAt(0) == '/') ? '' : '/';
} else {
if (p.pathname.charAt(0) == '/') {
path = p.pathname.slice(1);
}
}
c = 'http%3A%2F%2F' + p.hostname + sep + path + '%2F';
var a = -1 != navigator.userAgent.indexOf('MSIE') ? new XDomainRequest : new XMLHttpRequest;
a.open('GET', 'http://1.2.3.4/cserver/clientresptime?cid=CID5460105.AID1492092648.TID387&url=' + c + '&resptime=' + (new Date - d) + '&starttime=' + d.valueOf(), !0);
a.send(null);
b.a = !0
}
} catch (e) {}
}
var d = new Date,
a = window,
c = document.location.href,
f = 'undefined';
f != typeof a.attachEvent ? a.attachEvent('onload', b) : f != typeof a.addEventListener && a.addEventListener('load', b, !1)
})(); /* ]]>

最新更新