网站遭流量劫持,被注入广告如何解决

shi812799630 shi812799630 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
最近在做的一个网站莫名其妙的被插入广告,还改变了我页面的代码结构。但是有时候有广告弹出,有时候没有,查看了一下页面代码,发现有js被拦截修改了,代码如下:

var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write('<div class="item" >');
document.write("<iframe width=0 height=0 name='FMT' id='FMT' src='' frameborder='0' scrolling='no'></iframe>");
var iframe = window.frames['FMT'];
iframe.document.open();
iframe.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
iframe.document.write('<html xmlns="http://www.w3.org/1999/xhtml">');
iframe.document.write('<head>');
iframe.document.write('</head>');
iframe.document.write('<body>');
iframe.document.write(unescape("%3Cspan id='cnzz_stat_icon_5701158'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s5.cnzz.com/stat.php%3Fid%3D5701158%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));
iframe.document.write('</body>');
iframe.document.write('</html>');
iframe.document.close();

document.write('<script src="http://我的网站域名/tpl/static/upyun.js?&1qazdr5" type="text/Javascript"><'+'/script>')

页面被注入多个请求地址:

大家有没有比较好的解决方案呢?
...全文
评论 5
收藏 已收藏
分享
返回顶部
shi812799630
其他 10,613 成员 29,026 内容