Exploit and safe-verify toolkit for CVE-2026-106173, an unauthenticated FortiSIEM phQueryMaster gRPC file-write-to-root-RCE, with exposure scanning and reporting.

ETHICAL USE ONLY β AUTHORIZED SECURITY TESTING
This repository provides tools for authorized security professionals, blue teams, and penetration testers only.
Unauthorized access to computer systems is illegal under CFAA (US), Computer Misuse Act (UK), TCK 243/244 (Turkey), and similar laws worldwide.
CVEβ2026β106173 is a critical unauthenticated arbitrary file write vulnerability in Fortinet FortiSIEM 7.5.0 that can be escalated to remote code execution as root via a file-system path traversal and NUL byte injection in the phQueryMaster gRPC service.
phQueryMaster gRPC service binds to [::]:27918 and is configured with GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE. No client certificate is required.SendQueryResult RPC handler concatenates the attacker-controlled query-id metadata value directly into a file path (/query/result/<query-id>), allowing ../../ traversal out of the intended directory.\x00) can be embedded in query-id. The filesystem call truncates at the NUL, giving full control over the final file name (the server-appended result-...-.dat suffix is silently dropped).file_content protobuf field is written to the attacker-chosen path. Existing file ownership and permissions are preserved./opt/charting/redishb.sh is executed as root by a cron job every 60 seconds. Writing an attacker-controlled shell script to that path (or to /etc/cron.d/fsm-crontab, or phLicenseTool) results in root-level code execution./opt/charting/redishb.sh and /opt/phoenix/bin/phLicenseTool for modification-time anomalies.| Tool | Purpose | Intended User |
|---|---|---|
exploit.py | Full toolkit with multi-primitive RCE, readback (web/callback/none), reverse shell, interactive shell, upload/download with hash verification, credential collection, multi-mechanism persistence, surgical log cleanup, mass scanning, SOCKS5 proxy chaining, Tor, and jitter. | Red teams / authorized pentesters |
safeverify.py | Non-intrusive exposure checker. Verifies whether TCP/27918 is reachable without a client certificate, performs an HTTP/2 fingerprint, collects version headers, and generates structured reports. Does not perform any file write, path traversal, or NUL byte injection. | Blue teams / security auditors |
| Feature | exploit.py | safeverify.py |
|---|---|---|
| Exposure detection (gRPC probe) | [+] | [+] |
| HTTP/2 fingerprint (SETTINGS/DATA/HEADERS/RST/GOAWAY) | [+] | [+] |
| Version header collection | [+] | [+] |
| Path traversal + NUL byte file write | [+] | [-] |
Multi-primitive RCE (redishb / cron / license / ssh) | [+] | [-] |
| Readback: web / callback / none | [+] | [-] |
| Reverse shell (validated connection) | [+] | [-] |
| Interactive shell (upload/download, SHA-256) | [+] | [-] |
| Credential collection | [+] | [-] |
| Multi-mechanism persistence (systemd + cron + SSH) | [+] | [-] |
| Surgical log cleanup | [+] | [-] |
| SOCKS5 proxy / proxy chain | [+] | [+] |
| Tor support | [+] | [+] |
| Jitter (OPSEC) | [+] | [+] |
| CIDR expansion | [+] | [+] |
| Mass scanning (async, rate-limited) | [+] | [+] |
| JSON / JSONL / CSV output | [+] | [+] |
| Dry-run preview | [+] | [+] |
| Non-intrusive (safe) mode | [-] | [+] |
| Scenario | Recommended Tool |
|---|---|
| Blue Team β verifying if FortiSIEM exposes TCP/27918 | safeverify.py |
| Security Audit β non-intrusive exposure assessment | safeverify.py |
| Red Team β authorized penetration testing with full exploitation | exploit.py |
| Bug Bounty β responsible disclosure testing | safeverify.py |
| Mass Scanning β checking multiple FortiSIEM instances | exploit.py (or safeverify.py for detection only) |
| Incident Response β checking if systems are compromised | safeverify.py + manual review of redishb.sh mtime |
git clone https://github.com/tc4dy/CVE-2026-106173-PoC-Exploit
cd CVE-2026-106173-PoC-Exploit
pip install -r requirements.txt
Note:
requirements.txtis intentionally empty btw, norequests, noh2, noimpacket. Both tools use only the Python standard library (asyncio,ssl,socket,struct,json,csv,ipaddress). if you still want isolation, use a virtualenv as shown above.
exploit.py Parameters| Parameter | Description |
|---|---|
-t, --target | Target IP, hostname, or CIDR (e.g. 10.0.0.5, 10.0.0.0/24) |
-l, --list | File containing targets (one per line) for mass scanning |
-p, --port | gRPC port (default: 27918) |
--plaintext | Use plaintext HTTP/2 (prior knowledge, no TLS) |
--timeout | Connection/read timeout in seconds (default: 8.0) |
-c, --cmd | Execute a single command and print the output |
--shell | Interactive shell with upload / download |
--revshell | Open a reverse shell (requires --lhost / --lport) |
--scan | Detection + version header collection only |
--primitive | auto / redishb / cron / license / ssh |
--readback | web / callback / none |
--lhost | Listener IP for reverse shell / callback |
--lport | Listener port (default: 4444) |
--proxy | Single SOCKS5 proxy (e.g. socks5://127.0.0.1:1080) |
--proxy-file | File with SOCKS5 proxies (rotated per request) |
--tor | Route through Tor (socks5://127.0.0.1:9050) |
--jitter | MIN-MAX seconds between requests (default: 0-3) |
--creds | Collect credentials from config files and phLicenseTool |
--persist | Multi-mechanism persistence (systemd + cron + SSH) |
--cleanup | Surgical log cleanup (pattern-based) |
--rate-limit | Requests per second (default: 10.0) |
--retries | Retries per write attempt (default: 2) |
-o, --output | Save results to .json, .jsonl, or .csv |
-v, --verbose | Verbose output (repeat for more detail) |
-q, --quiet | Suppress non-error output |
--dry-run | Build the request and preview it without sending |
--no-color | Disable ANSI colors |
safeverify.py Parameters