攻擊案例
http://你的域名/index.php?s=index/\think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=id
以上的連接可以攻擊TP5的部分網站,出現phpinfo(),所以很多的文件位置就會暴露出來
解決方案
- /thinkphp/library/think/App.php文件中module方法獲取去控制器的代碼下面加入以下代碼:
//防getshell入侵
if (!preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) {
throw new HttpException(404, 'controller not exists:' . $controller);
}