Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2024-51567 PoC — CyberPanel 安全漏洞

Source
Associated Vulnerability
Title: CyberPanel 安全漏洞 (CVE-2024-51567)
Description:upgrademysqlstatus in databases/views.py in CyberPanel (aka Cyber Panel) before 5b08cd6 allows remote attackers to bypass authentication and execute arbitrary commands via /dataBases/upgrademysqlstatus by bypassing secMiddleware (which is only for a POST request) and using shell metacharacters in the statusfile property, as exploited in the wild in October 2024 by PSAUX. Versions through 2.3.6 and (unpatched) 2.3.7 are affected.
Description
CVE-2024-51567 is a Python PoC exploit targeting an RCE vulnerability in CyberPanel v2.3.6’s upgrademysqlstatus endpoint, bypassing CSRF protections.
Readme
# cve-2024-51567-poc
### 简化描述

#### 漏洞概述

- **编号**: [CVE-2024-51567](https://nvd.nist.gov/vuln/detail/CVE-2024-51567)  
- **类型**: 命令注入 / CSRF 绕过  
- **影响范围**: CyberPanel 2.3.6 和 2.3.7 版本(未修复)  
- **描述**:  
  在 CyberPanel 的 `upgrademysqlstatus` 接口中,通过绕过 `secMiddleware` 对 POST 请求的保护,攻击者可以利用 `statusfile` 参数注入命令并远程执行。  

#### 特点

- 自动获取目标服务器的 CSRF Token  
- 绕过 CSRF 保护并发送恶意请求  
- 支持单目标或多目标批量攻击  
- 提供交互式命令执行功能  
- 如缺少 CSRF Token 会返回错误提示  

#### 运行需求

- Python 3  
- `httpx` 模块  

#### 安装和使用

1. **克隆项目并安装依赖**  
   ```bash
   git clone https://github.com/XiaomingX/cve-2024-51567-poc.git
   cd cve-2024-51567-poc
   pip install httpx
   ```

2. **单目标运行**  
   ```bash
   python CVE-2024-51567.py <目标URL>
   ```
   示例:  
   ```bash
   python CVE-2024-51567.py http://example.com
   ```

3. **多目标批量运行**  
   在文件中列出所有目标,每行一个 URL,然后运行:  
   ```bash
   python CVE-2024-51567.py <目标文件>
   ```
   示例:  
   ```bash
   python CVE-2024-51567.py targets.txt
   ```

#### 示例输出

运行脚本后,进入交互模式,可连续输入命令直到退出(输入 `exit` 或 `quit`)。  

---

#### 常见问题

- **"CSRF token 未找到"**:  
  - 确认目标服务器是否正确返回了 CSRF Token。  
  - 如路径不同,可调整 `get_CSRF_token` 函数。

#### 参考链接

- [漏洞详情 - NVD](https://nvd.nist.gov/vuln/detail/CVE-2024-51567)  
- [详细分析 - Ionix](https://www.ionix.io/blog/remote-code-execution-vulnerability-in-cyberpanel/)  
- [技术评估 - Dreyand](https://dreyand.rs/code/review/2024/10/27/what-are-my-options-cyberpanel-v236-pre-auth-rce)  
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →