关于thinkPHP 5.0-5.1部分版本index.php被修改为首页HTML代码问题

关于thinkPHP 5.0-5.1部分版本index.php被修改为首页HTML代码问题,首先这个是thinkPHP的一个bug;

如果网站系统已经被入侵,那么要做以下操作:

1. 在thinkPHP核心类库  hinkphplibrary hinkApp.php::module() 添加如下代码:

if (!preg_match('/^[A-Za-z](w|.)*$/', $controller)) {
            throw new HttpException(404, 'controller not exists:' . $controller);
        }

2.因为已经入侵植入的木马文件,所以要找到所有的木马文件并删除:

可以根据云服务器厂商的安全审查来删除。例如阿里云的安全中心:

原文地址:https://www.cnblogs.com/tgzmos/p/12164913.html