漏洞详细
phpunit是php中的单元测试工具,其4.8.19 ~ 4.8.27
和5.0.10 ~ 5.6.2
版本的vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php
文件有如下代码:
eval('?>'.file_get_contents('php://input'));
如果该文件被用户直接访问到,将造成远程代码执行漏洞。
漏洞复现
直接将PHP代码作为POST Body发送给http://your-ip:8080/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php
:
![在这里插入图片描述](https://img-blog.csdnimg.cn/img_convert/41ab69a58ff768a96e326adaab405cc5.png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/img_convert/052cb14843f5570373979e56dfd416d2.png)