ThinkPHP框架 - 是由上海顶想公司开发维护的MVC结构的开源PHP框架,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。
该漏洞由于框架对控制器名未能进行足够的检测,攻击者利用该漏洞对目标网站进行远程命令执行攻击。
本来想试试上传一句话木马的,网站有点拉跨一直在转圈,好像写不进去
使用composer安装,并且一直保持最新版本使用的话,使用下面的指令更新到最新版本即可
composer update topthink/framework
5.0版本
在thinkApp类的module方法的获取控制器的代码后面加上
if (!preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}
5.1版本
在thinkroutedispatchUrl类的parseUrl方法,解析控制器后加上
if ($controller && !preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}