tp5.0.7 修復getshell漏洞
這里 接手項目用的是 tp5.0.7 突然想到前段事件的tp bug 事件 就試了下 發(fā)現(xiàn)確實有這種情況
參考帖子:
https://blog.csdn.net/Bul1et/article/details/85319468
本地測試的時候 到 &function=call_user_func_array&vars[0]=system&vars[1][]=id 的時候 nginx 出現(xiàn)了一個報錯 沒有成功進行復現(xiàn)
但是 前面的 invokefunction 方法確實是已經進到了 call_user_func_array 函數(shù)也已經執(zhí)行了
官方提供的修復姿勢:
https://blog.thinkphp.cn/869075
PHPTutorial\WWW\tp5.0.7\thinkphp\library\think\App.php
358行左右
module 方法中
<pre style="margin: 0px; padding: 0px; overflow: auto; overflow-wrap: break-word; font-family: "Courier New" !important; font-size: 12px !important;"> if (!preg_match('/^A-Za-z*controller)) { throw new HttpException(404, 'controller not exists:' . $controller);
}</pre>
測試 修復完成 報錯
這里 應該就是修復完成了吧 和 tp5.0.24 提示一致
這里顯示報錯 是因為 debug 沒有關 生產環(huán)境關掉就好了 不會暴露出相應的信息