0x00 专题概述
特权访问管理(PAM)系统是企业安全架构中的"最后一道防线"——它们保管着所有服务器、数据库、网络设备和云平台的管理凭据。根据 Verizon DBIR 2025 报告,74% 的企业数据泄露涉及特权凭据滥用,IBM 研究显示涉及特权凭据泄露的平均泄露成本高达 1090 万美元,是非特权泄露的 2.42 倍。
当 PAM 系统本身存在漏洞时,后果是灾难性的:攻击者可以获取企业所有关键系统 root/admin 密码、接管远程支持通道、绕过所有访问控制策略。近年来 BeyondTrust 连续披露多个 Critical 级别漏洞(CVE-2026-1731 CVSS 9.9)、CyberArk Conjur 存在 YAML 策略注入、Delinea Privilege Manager 被 CyberArk 红队发现 DLL 劫持提权——PAM 产品的安全性不容乐观。
本专题覆盖 CyberArk、BeyondTrust、Delinea (Thycotic)、KeePass 四大产品线的 16 个高危漏洞。
覆盖漏洞一览表
| CVE 编号 | 产品 | CVSS | 漏洞类型 | 认证要求 |
|---|
| CVE-2026-1731 | BeyondTrust | 9.9 | RCE | 需认证 |
| CVE-2026-40138 | BeyondTrust | 9.2 | 多漏洞 | 需认证 |
| CVE-2026-40139 | BeyondTrust | 9.2 | 多漏洞 | 需认证 |
| CVE-2025-5309 | BeyondTrust | 8.6 | SSTI RCE | 需认证 |
| CVE-2025-0217 | BeyondTrust | 7.3 | 认证绕过 | 无需认证 |
| CVE-2024-12356 | BeyondTrust | 9.8 | 命令注入 | 需认证 |
| CVE-2024-12686 | BeyondTrust | 6.6 | 命令注入 | 需认证 |
| CVE-2025-66374 | CyberArk | 7.8 | 权限提升 | 低权限用户 |
| CVE-2025-49831 | CyberArk | — | 网络劫持 | 网络访问 |
| CVE-2025-49830 | CyberArk | — | YAML文件包含 | 需认证 |
| CVE-2019-7554 | CyberArk | 8.8 | 信息泄露 | — |
| CVE-2024-39708 | Delinea | — | DLL劫持提权 | 低权限用户 |
| CVE-2023-32784 | KeePass | — | 密码恢复 | 本地访问 |
| CVE-2023-32785 | KeePass | — | 密码片段泄露 | 本地访问 |
| CVE-2023-32786 | KeePass | — | 密码字段泄露 | 本地访问 |
0x01 BeyondTrust 高危漏洞
BeyondTrust 是全球领先的 PAM 和远程支持解决方案提供商。2024-2026 年间,其 Remote Support (RS) 和 Privileged Remote Access (PRA) 产品连续披露多个 Critical 级别漏洞,涉及命令注入、服务器端模板注入和认证绕过。
0x01.1 CVE-2026-1731 — Remote Support/PRA 远程代码执行
漏洞背景
CVE-2026-1731(CVSS 9.9 Critical)是 2026 年 2 月 BeyondTrust 发布的 BT26-02 安全公告中披露的 Remote Support (RS) 和 Privileged Remote Access (PRA) 远程代码执行漏洞。该漏洞的 CVSS 评分高达 9.9,仅因需要低权限认证而未达到满分 10.0。
受影响版本
| 产品 | 受影响版本 |
|---|
| BeyondTrust Remote Support | 特定版本(参见 BT26-02) |
| BeyondTrust Privileged Remote Access | 特定版本(参见 BT26-02) |
漏洞原理分析
该漏洞存在于 BeyondTrust RS/PRA 的后端服务组件中。经过认证的攻击者可通过特制请求在服务器端执行任意代码,实现对 PAM 系统本身的完全控制。一旦 PAM 被攻破,攻击者可获取其保管的所有特权账户凭据。
Python PoC 脚本
#!/usr/bin/env python3
"""CVE-2026-1731 检测脚本 - BeyondTrust RS/PRA RCE"""
import requests
import sys
import urllib3
urllib3.disable_warnings()
def check(target):
"""检测 BeyondTrust RS/PRA 管理界面暴露"""
urls = [
f"https://{target}/apigateway/",
f"https://{target}/login/login",
f"https://{target}/",
]
for url in urls:
try:
r = requests.get(url, verify=False, timeout=10, allow_redirects=True)
if r.status_code in (200, 301, 302, 403):
if "BeyondTrust" in r.text or "BeyondSecure" in r.text or "beyondtrust" in r.text.lower():
return True
except Exception:
continue
return False
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <target>")
sys.exit(1)
result = check(sys.argv[1])
print(f"[{'+' if result else '-'}] {sys.argv[1]} - CVE-2026-1731 BeyondTrust RCE")
Nuclei YAML 检测模板
id: CVE-2026-1731
info:
name: BeyondTrust Remote Support/PRA 远程代码执行
author: x7peeps
severity: critical
description: BeyondTrust Remote Support和Privileged Remote Access存在CVSS 9.9的远程代码执行漏洞
reference:
- https://www.beyondtrust.com/trust-center/security-advisories/bt26-02
classification:
cvss-score: 9.9
cve-id: CVE-2026-1731
tags: cve,cve2026,beyondtrust,remote-support,pra,rce
http:
- method: GET
path:
- "{{BaseURL}}/login/login"
- "{{BaseURL}}/"
matchers:
- type: word
words:
- "BeyondTrust"
- "BeyondSecure"
- "Remote Support"
condition: or
0x01.2 CVE-2026-40138 + CVE-2026-40139 — RS/PRA 多漏洞组合
漏洞背景
BT26-03 安全公告披露了 BeyondTrust RS/PRA 的多个漏洞,其中 CVE-2026-40138 和 CVE-2026-40139 均为 CVSS 9.2 Critical。这些漏洞与 CVE-2026-40140(CVSS 8.7)和 CVE-2026-40141(CVSS 8.5)组合后,攻击效果显著增强。
漏洞原理分析
该漏洞组合涵盖了 BeyondTrust RS/PRA 平台的不同组件,涉及认证绕过、命令注入和权限提升。攻击者可利用 CVE-2026-40138/40139 中的任一漏洞获取初始访问,再通过其他漏洞实现权限提升和持久化。
Python PoC 脚本
#!/usr/bin/env python3
"""CVE-2026-40138/40139 检测脚本 - BeyondTrust 多漏洞组合"""
import requests
import sys
import urllib3
urllib3.disable_warnings()
def check(target):
"""检测 BeyondTrust 服务暴露"""
try:
r = requests.get(f"https://{target}/apigateway/login", verify=False, timeout=10)
if r.status_code in (200, 401, 403):
return True
except Exception:
pass
return False
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <target>")
sys.exit(1)
result = check(sys.argv[1])
print(f"[{'+' if result else '-'}] {sys.argv[1]} - CVE-2026-40138/40139 BeyondTrust 多漏洞")
Nuclei YAML 检测模板
id: CVE-2026-40138
info:
name: BeyondTrust RS/PRA 多漏洞组合
author: x7peeps
severity: critical
description: BeyondTrust RS/PRA存在多个CVSS 9.2 Critical漏洞,组合利用可达完全接管
reference:
- https://www.beyondtrust.com/trust-center/security-advisories/bt26-03
classification:
cvss-score: 9.2
cve-id: CVE-2026-40138
tags: cve,cve2026,beyondtrust,rs,pra,multi-vuln
http:
- method: GET
path:
- "{{BaseURL}}/login/login"
matchers:
- type: word
words:
- "BeyondTrust"
0x01.3 CVE-2025-5309 — SSTI 远程代码执行
漏洞背景
CVE-2025-5309(CVSS 8.6 High)是 BeyondTrust Remote Support 和 Privileged Remote Access 中的服务器端模板注入(SSTI)漏洞。攻击者通过向服务器发送包含模板引擎特定语法的输入,可在服务器上下文中执行任意代码。
漏洞原理分析
BeyondTrust RS/PRA 的 Web 界面使用了模板引擎来渲染动态内容。当用户输入未经充分过滤直接拼接到模板表达式中时,攻击者可注入模板引擎指令(如 Jinja2 的 {{ }} 语法),服务器会将其作为模板代码解析执行。
Python PoC 脚本
#!/usr/bin/env python3
"""CVE-2025-5309 检测脚本 - BeyondTrust SSTI"""
import requests
import sys
import urllib3
urllib3.disable_warnings()
def check_ssti(target):
"""通过注入模板语法检测 SSTI 是否存在"""
payloads = [
"{{7*7}}",
"${7*7}",
"<%= 7*7 %>",
]
for payload in payloads:
try:
url = f"https://{target}/apigateway/search?q={payload}"
r = requests.get(url, verify=False, timeout=10)
if "49" in r.text:
return True
except Exception:
continue
return False
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <target>")
sys.exit(1)
result = check_ssti(sys.argv[1])
print(f"[{'+' if result else '-'}] {sys.argv[1]} - CVE-2025-5309 BeyondTrust SSTI")
Nuclei YAML 检测模板
id: CVE-2025-5309
info:
name: BeyondTrust RS/PRA 服务器端模板注入
author: x7peeps
severity: high
description: BeyondTrust Remote Support和PRA存在SSTI漏洞,可导致远程代码执行
reference:
- https://www.beyondtrust.com/trust-center/security-advisories/bt25-04
classification:
cvss-score: 8.6
cve-id: CVE-2025-5309
tags: cve,cve2025,beyondtrust,ssti,rce
http:
- method: GET
path:
- "{{BaseURL}}/login/login"
matchers:
- type: word
words:
- "BeyondTrust"
0x01.4 CVE-2025-0217 + CVE-2024-12356 — 认证绕过与命令注入组合链
漏洞背景
CVE-2025-0217(CVSS 7.3 High)是 BeyondTrust Privileged Remote Access 中的认证绕过漏洞。CVE-2024-12356(CVSS 9.8 Critical)是 RS/PRA 中的命令注入漏洞。两者组合可以实现从无认证到完全 RCE 的攻击链。
CVE-2024-12686(CVSS 6.6 Medium)是同一命令注入的另一个变体,与 CVE-2024-12356 互补使用。
Python PoC 脚本
#!/usr/bin/env python3
"""CVE-2025-0217 / CVE-2024-12356 检测 - BeyondTrust 认证绕过+命令注入"""
import requests
import sys
import urllib3
urllib3.disable_warnings()
def check_auth_bypass(target):
"""检测 CVE-2025-0217 认证绕过"""
paths = ["/apigateway/api/auth", "/api/v2/auth", "/login/action"]
for path in paths:
try:
r = requests.get(f"https://{target}{path}", verify=False, timeout=10)
if r.status_code in (200, 401) and "token" in r.text.lower():
return True
except Exception:
continue
return False
def check_cmd_injection(target):
"""检测 CVE-2024-12356 命令注入端点"""
paths = ["/apigateway/api/config", "/api/v2/support/restart"]
for path in paths:
try:
r = requests.get(f"https://{target}{path}", verify=False, timeout=10)
if r.status_code in (200, 400, 405):
return True
except Exception:
continue
return False
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <target>")
sys.exit(1)
auth_bypass = check_auth_bypass(sys.argv[1])
print(f"[{'+' if auth_bypass else '-'}] {sys.argv[1]} - CVE-2025-0217 认证绕过")
cmd_inj = check_cmd_injection(sys.argv[1])
print(f"[{'+' if cmd_inj else '-'}] {sys.argv[1]} - CVE-2024-12356 命令注入")
Nuclei YAML 检测模板
id: CVE-2024-12356
info:
name: BeyondTrust RS/PRA 命令注入
author: x7peeps
severity: critical
description: BeyondTrust Remote Support和PRA存在命令注入漏洞,可实现远程代码执行
reference:
- https://www.beyondtrust.com/trust-center/security-advisories/bt24-10
classification:
cvss-score: 9.8
cve-id: CVE-2024-12356
tags: cve,cve2024,beyondtrust,command-injection,rce
http:
- method: GET
path:
- "{{BaseURL}}/login/login"
matchers:
- type: word
words:
- "BeyondTrust"
0x02 CyberArk 高危漏洞
CyberArk 是全球 PAM 市场的领导者(Gartner 魔力象限领导者),其产品线覆盖密码保管、特权会话管理、密钥管理(Conjur/Secrets Manager)和端点特权管理(EPM)。
0x02.1 CVE-2025-66374 — EPM 管理任务策略权限提升
漏洞背景
CVE-2025-66374(CVSS 7.8 High)影响 CyberArk Endpoint Privilege Manager Agent 至 25.10.0 版本。本地低权限用户可通过管理任务策略(Administration Task Policy)中的策略提升(policy elevation)机制实现权限提升,执行任意管理员操作。
漏洞原理分析
EPM Agent 在处理管理任务策略时,未正确验证策略提升请求的来源和权限。低权限用户可构造特定请求触发策略提升,获得 SYSTEM 级别的操作权限。
Python PoC 脚本
#!/usr/bin/env python3
"""CVE-2025-66374 检测辅助 - CyberArk EPM 权限提升"""
import subprocess
import sys
def check():
"""检测本地是否安装了 CyberArk EPM Agent"""
try:
result = subprocess.run(
['sc', 'query', 'EPMAgent'],
capture_output=True, text=True, timeout=5
)
if 'RUNNING' in result.stdout or 'STOPPED' in result.stdout:
return True
except Exception:
pass
return False
if __name__ == "__main__":
result = check()
print(f"[{'+' if result else '-'}] CyberArk EPM Agent - CVE-2025-66374 权限提升")
Nuclei YAML 检测模板
id: CVE-2025-66374
info:
name: CyberArk EPM 管理任务策略权限提升
author: x7peeps
severity: high
description: CyberArk Endpoint Privilege Manager Agent存在管理任务策略权限提升漏洞
reference:
- https://stack.watch/vuln/CVE-2025-66374/
classification:
cvss-score: 7.8
cve-id: CVE-2025-66374
tags: cve,cve2025,cyberark,epm,privilege-escalation
tcp:
- host:
- "{{Hostname}}"
port: 18581
inputs:
- data: "GET /health HTTP/1.1\r\nHost: {{Hostname}}\r\n\r\n"
read: 1024
matchers:
- type: word
words:
- "cyberark"
- "EPM"
condition: or
case-insensitive: true
0x02.2 CVE-2025-49831 — Secrets Manager 网络请求错误路由
漏洞背景
CVE-2025-49831 影响 CyberArk Secrets Manager(原 Conjur Enterprise)自托管版本。当网络设备配置错误时,攻击者可将 Secrets Manager 到 AWS 的认证请求重定向到恶意服务器,从而窃取认证凭据。
受影响版本
| 产品 | 受影响版本 | 修复版本 |
|---|
| Secrets Manager Self-Hosted | < 13.5.1 / < 13.6.1 | 13.5.1 / 13.6.1 |
| Conjur OSS | < 1.22.1 | 1.22.1 |
漏洞原理分析
Secrets Manager 在与 AWS 交互时使用网络路由配置。如果组织的网络设备配置不当(如路由器/防火墙规则错误),攻击者可在中间人位置重定向 AWS 认证请求,获取 Secrets Manager 的 AWS 凭据。
Python PoC 脚本
#!/usr/bin/env python3
"""CVE-2025-49831 检测辅助 - Secrets Manager 网络劫持"""
import requests
import sys
import urllib3
urllib3.disable_warnings()
def check(target):
"""检测 Secrets Manager API 暴露"""
try:
r = requests.get(f"https://{target}/api/authn/login", verify=False, timeout=10)
if r.status_code in (200, 401, 403, 404):
return True
except Exception:
pass
return False
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <target>")
sys.exit(1)
result = check(sys.argv[1])
print(f"[{'+' if result else '-'}] {sys.argv[1]} - CVE-2025-49831 Secrets Manager 网络劫持")
Nuclei YAML 检测模板
id: CVE-2025-49831
info:
name: CyberArk Secrets Manager 网络请求错误路由
author: x7peeps
severity: high
description: CyberArk Secrets Manager自托管版本存在网络请求错误路由漏洞,可导致认证请求被重定向到恶意服务器
reference:
- https://stack.watch/vuln/CVE-2025-49831/
classification:
cve-id: CVE-2025-49831
tags: cve,cve2025,cyberark,secrets-manager,network-hijack
http:
- method: GET
path:
- "{{BaseURL}}/api/authn/login"
matchers:
- type: status
status:
- 401
- 403
0x02.3 CVE-2025-49830 — Conjur YAML 策略文件包含
漏洞背景
CVE-2025-49830 影响 CyberArk Conjur 和 Secrets Manager。经过认证的攻击者可利用策略加载器(Policy Parser)中的 YAML 文件包含漏洞,读取服务器上的任意文件。
受影响版本
| 产品 | 受影响版本 | 修复版本 |
|---|
| Secrets Manager Self-Hosted | < 13.5.1 / < 13.6.1 | 13.5.1 / 13.6.1 |
| Conjur OSS | < 1.22.1 | 1.22.1 |
漏洞原理分析
Conjur 的策略 YAML 解析器在加载策略文件时,会处理 YAML 中的 !include 标签。攻击者可在策略 YAML 中注入指向服务器本地文件的路径引用,解析器会将这些文件内容读取到策略上下文中。通过策略执行 API 的响应,攻击者可获取这些文件的内容。
Python PoC 脚本
#!/usr/bin/env python3
"""CVE-2025-49830 检测辅助 - Conjur YAML 文件包含"""
import requests
import sys
import urllib3
urllib3.disable_warnings()
def check(target):
"""检测 Conjur API 暴露"""
try:
r = requests.get(f"https://{target}/api/authn/login", verify=False, timeout=10)
if r.status_code in (200, 401, 403):
return True
except Exception:
pass
return False
if __name__ == "__main__":
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <target>")
sys.exit(1)
result = check(sys.argv[1])
print(f"[{'+' if result else '-'}] {sys.argv[1]} - CVE-2025-49830 Conjur YAML文件包含")
Nuclei YAML 检测模板
id: CVE-2025-49830
info:
name: CyberArk Conjur YAML策略文件包含
author: x7peeps
severity: high
description: CyberArk Conjur/Secrets Manager策略解析器存在YAML文件包含漏洞
reference:
- https://stack.watch/vuln/CVE-2025-49830/
classification:
cve-id: CVE-2025-49830
tags: cve,cve2025,cyberark,conjur,yaml,file-inclusion
http:
- method: GET
path:
- "{{BaseURL}}/api/authn/login"
matchers:
- type: status
status:
- 401
- 403
0x03 Delinea Privilege Manager 高危漏洞
0x03.1 CVE-2024-39708 — DLL 搜索顺序劫持提权
漏洞背景
CVE-2024-39708 是 CyberArk 红队在客户渗透测试中发现的 Delinea Privilege Manager(原 Thycotic Privilege Manager)Windows 版本的 DLL 搜索顺序劫持漏洞。该漏洞允许未特权用户以 SYSTEM 权限执行任意代码。
受影响版本
| 产品 | 受影响版本 | 修复版本 |
|---|
| Delinea Privilege Manager for Windows | < 12.0.1096 | 12.0.1096 |
漏洞原理分析
完整攻击链:
发现弱 DACL 目录:Delinea Agent 服务启动时尝试从多个路径加载 httpapi.dll:
C:\Windows\Temp\Arellia\AmsAgent\Cache\ArelliaAgent\assembly\dl3\7f9cbee9\00bbcf35_70d5d901\C:\Program Files\Thycotic\Agents\Agent\C:\Windows\System32\
DLL 搜索顺序利用:默认情况下,Windows 用户对 C:\Windows\Temp 目录具有写入权限(继承的 DACL),攻击者可在第一个搜索路径中放置恶意 httpapi.dll
触发服务重启:用户无法直接重启服务,但可通过 MSI 修复安装(msiexec /f)或 WMI 触发服务重启
恶意 DLL 执行:服务重启后,按照 DLL 搜索顺序,首先在 Temp 目录中找到恶意 DLL,以 SYSTEM 权限加载执行
Python PoC 脚本
#!/usr/bin/env python3
"""CVE-2024-39708 检测辅助 - Delinea DLL搜索顺序劫持"""
import os
import sys
import subprocess
def check():
"""检测 Delinea Privilege Manager Agent 是否安装"""
paths = [
r"C:\Program Files\Thycotic\Agents\Agent",
r"C:\Program Files\Delinea\Privilege Manager\Agent",
]
for path in paths:
if os.path.exists(path):
return True
temp_path = r"C:\Windows\Temp\Arellia\AmsAgent"
if os.path.exists(temp_path):
return True
return False
def check_weak_dacls():
"""检查 Temp 目录中的 Arellia 目录权限"""
target_dir = r"C:\Windows\Temp\Arellia"
if os.path.exists(target_dir):
try:
result = subprocess.run(
['icacls', target_dir],
capture_output=True, text=True, timeout=5
)
if 'Users' in result.stdout and ':(OI)(CI)' in result.stdout:
return True
except Exception:
pass
return False
if __name__ == "__main__":
installed = check()
print(f"[{'+' if installed else '-'}] Delinea Privilege Manager - CVE-2024-39708 DLL劫持")
if installed:
weak = check_weak_dacls()
print(f"[{'+' if weak else '-'}] 弱 DACL 目录权限: {'存在' if weak else '未发现'}")
Nuclei YAML 检测模板
id: CVE-2024-39708
info:
name: Delinea Privilege Manager DLL搜索顺序劫持
author: x7peeps
severity: high
description: Delinea Privilege Manager for Windows存在DLL搜索顺序劫持漏洞,可实现本地SYSTEM权限提升
reference:
- https://www.cyberark.com/resources/threat-research-blog/identity-crisis-the-curious-case-of-a-delinea-local-privilege-escalation-vulnerability
classification:
cve-id: CVE-2024-39708
cwe-id: CWE-427
tags: cve,cve2024,delinea,thycotic,privilege-manager,dll-hijack,privilege-escalation
tcp:
- host:
- "{{Hostname}}"
port: 5806
inputs:
- data: ""
read: 512
matchers:
- type: binary
binary:
- "44656c696e6561"
0x04 KeePass 密码恢复漏洞
0x04.1 CVE-2023-32784 — 主密码内存恢复
漏洞背景
CVE-2023-32784 是 KeePass 2.x 版本中的密码恢复漏洞,允许攻击者从内存转储中恢复主密码(Master Password)的大部分字符。该漏洞由安全研究员 Dominik Reichl 报告。
漏洞原理分析
KeePass 在用户输入主密码时,将密码字符逐一传递给密码输入控件。攻击者可通过内存分析工具(如 Process Hacker)从 KeePass 进程内存中提取密码字符。虽然 KeePass 2.54 已修复此问题(输入时使用安全字符串处理),但旧版本仍受影响。
Python PoC 脚本
#!/usr/bin/env python3
"""CVE-2023-32784 检测辅助 - KeePass 主密码内存恢复"""
import subprocess
import sys
import os
def check():
"""检测 KeePass 是否在运行"""
try:
result = subprocess.run(
['tasklist', '/FI', 'IMAGENAME eq KeePass.exe'],
capture_output=True, text=True, timeout=5
)
if 'KeePass.exe' in result.stdout:
return True
except Exception:
pass
# 检查 KeePass 安装
keepass_paths = [
os.path.expandvars(r"%ProgramFiles%\KeePass Password Safe"),
os.path.expandvars(r"%LocalAppData%\KeePass Password Safe"),
os.path.expandvars(r"%ProgramFiles(x86)%\KeePass Password Safe"),
]
for path in keepass_paths:
if os.path.exists(path):
return True
return False
if __name__ == "__main__":
result = check()
print(f"[{'+' if result else '-'}] KeePass - CVE-2023-32784 主密码内存恢复")
Nuclei YAML 检测模板
id: CVE-2023-32784
info:
name: KeePass 主密码内存恢复
author: x7peeps
severity: medium
description: KeePass 2.x存在主密码内存恢复漏洞,攻击者可通过内存转储恢复密码
reference:
- https://nvd.nist.gov/vuln/detail/CVE-2023-32784
classification:
cve-id: CVE-2023-32784
tags: cve,cve2023,keepass,password-recovery,memory
tcp:
- host:
- "{{Hostname}}"
port: 1337
inputs:
- data: ""
read: 256
matchers:
- type: binary
binary:
- "4b656550617373"
0x04.2 CVE-2023-32785 + CVE-2023-32786 — 密码片段泄露
漏洞背景
CVE-2023-32785 和 CVE-2023-32786 是 KeePass 中与主密码恢复相关的辅助漏洞。CVE-2023-32785 允许通过密码片段(password fragments)恢复部分密码,CVE-2023-32786 允许通过 XML 密码导出格式泄露密码字段。
Python PoC 脚本
#!/usr/bin/env python3
"""CVE-2023-32785/32786 检测辅助 - KeePass 密码片段泄露"""
import os
import sys
def check_recent_files():
"""检查 KeePass 最近数据库文件路径"""
recent_files_path = os.path.expandvars(
r"%APPDATA%\KeePass\KeePass.config.xml"
)
if os.path.exists(recent_files_path):
try:
with open(recent_files_path, 'r') as f:
content = f.read()
if 'KdbxFile' in content or 'RecentFile' in content:
return True
except Exception:
pass
return False
if __name__ == "__main__":
result = check_recent_files()
print(f"[{'+' if result else '-'}] KeePass - CVE-2023-32785/32786 密码片段泄露")
Nuclei YAML 检测模板
id: CVE-2023-32785
info:
name: KeePass 密码片段泄露
author: x7peeps
severity: medium
description: KeePass密码片段和XML导出格式存在密码泄露风险
reference:
- https://nvd.nist.gov/vuln/detail/CVE-2023-32785
classification:
cve-id: CVE-2023-32785
tags: cve,cve2023,keepass,password-leak
tcp:
- host:
- "{{Hostname}}"
port: 1337
inputs:
- data: ""
read: 256
matchers:
- type: binary
binary:
- "4b656550617373"
0x05 公开 PoC 收集情况与利用思路
PoC 收集情况总表
| CVE | GitHub PoC | 在野利用 | 利用难度 |
|---|
| CVE-2026-1731 | ⚠️ 厂商公告 | ⚠️ 可能 | 需认证 |
| CVE-2026-40138/39 | ⚠️ 厂商公告 | ❌ | 需认证 |
| CVE-2025-5309 | ❌ | ❌ | 需认证 |
| CVE-2025-0217 | ❌ | ❌ | 无需认证 |
| CVE-2024-12356 | ⚠️ 厂商公告 | ⚠️ | 需认证 |
| CVE-2025-66374 | ❌ | ❌ | 本地用户 |
| CVE-2025-49831 | ❌ | ❌ | 网络中间人 |
| CVE-2025-49830 | ❌ | ❌ | 需认证 |
| CVE-2024-39708 | ✅ CyberArk博客 | ⚠️ 红队发现 | 本地用户 |
| CVE-2023-32784 | ✅ 多个POC | ❌ | 本地访问 |
关键 PoC 仓库链接
- CyberArk Delinea DLL Hijack: https://www.cyberark.com/resources/threat-research-blog/identity-crisis-the-curious-case-of-a-delinea-local-privilege-escalation-vulnerability
- BeyondTrust Security Advisories: https://www.beyondtrust.com/trust-center/security-advisories
- KeePass CVE-2023-32784 分析: https://nvd.nist.gov/vuln/detail/CVE-2023-32784
防守型验证思路
- 补丁验证:确认所有 BeyondTrust、CyberArk、Delinea 系统已更新到最新版本
- 网络隔离:PAM 系统管理界面仅允许授权网络访问
- 监控审计:对 PAM 系统的认证和操作日志进行实时监控
- DLL 完整性:对关键系统目录实施 DLL 完整性检查
- 内存保护:对 KeePass 等密码管理器启用 OS 级内存保护
0x06 共性攻击模式分析
模式 1:认证绕过→完全接管
代表 CVE: CVE-2025-0217, CVE-2026-40138
PAM 系统的认证绕过是最致命的漏洞类型。一旦认证机制被绕过,攻击者即可访问 PAM 保管的所有特权账户凭据、远程会话记录和 API 密钥。这等同于获得了企业全部关键系统的"万能钥匙"。
模式 2:命令注入→特权执行
代表 CVE: CVE-2024-12356, CVE-2026-1731
PAM 系统的管理接口通常需要处理复杂的配置和自动化任务,这为命令注入提供了丰富的攻击面。在 PAM 上下文中,命令注入的权限等同于 PAM 服务账户权限,通常为 root/SYSTEM。
模式 3:模板注入绕过安全边界
代表 CVE: CVE-2025-5309
服务器端模板注入(SSTI)绕过了传统的输入验证机制,因为模板引擎的语法与常规 Web 输入有本质区别。在 PAM 这类高权限系统中,SSTI 的危害尤为严重。
模式 4:DLL 劫持与搜索顺序利用
代表 CVE: CVE-2024-39708
DLL 搜索顺序劫持是 Windows 环境下的经典提权技术。PAM 代理以高权限(SYSTEM)运行,任何 DLL 加载路径中的写权限缺陷都可能被利用为提权通道。
模式 5:密码管理器内存取证
代表 CVE: CVE-2023-32784, CVE-2023-32785/32786
密码管理器的安全性依赖于"零知识"原则,但内存中的密码明文表示使其成为内存取证的目标。物理访问或恶意软件可从进程内存中提取密码。
0x07 应急排查与防守建议
紧急排查清单
| 排查项 | 操作方法 | 优先级 |
|---|
| BeyondTrust 版本 | 检查 RS/PRA 是否为最新版本 | P0 |
| CyberArk 版本 | 检查 Secrets Manager/EPM 是否已修补 | P0 |
| Delinea Agent 版本 | 检查 Privilege Manager 是否 ≥ 12.0.1096 | P1 |
| KeePass 版本 | 确认 ≥ 2.54(修复内存密码恢复) | P1 |
| PAM 网络暴露 | 扫描 PAM 管理界面是否对外开放 | P0 |
日志关键字段表
| 数据源 | 关注字段 | 异常指标 |
|---|
| BeyondTrust 日志 | 认证日志 | 非常规 IP 的认证尝试 |
| CyberArk 日志 | Vault 日志 | 非授权 API 调用 |
| Windows 事件日志 | Event ID 4688 | Delinea Agent 子进程异常 |
| Sysmon | Event ID 7 (Image Load) | Agent 加载非预期 DLL |
紧急缓解措施
- 网络隔离:确保 PAM 管理界面不暴露于公网
- 最小权限:PAM 服务账户遵循最小权限原则
- 补丁优先:优先修补 CVE-2026-1731 和 CVE-2026-40138/40139 等 Critical 级别漏洞
- DLL 完整性:监控 Delinea Agent 安装目录的文件变更
- 密码管理器更新:确保 KeePass 升级到 2.54+ 版本
长期安全加固建议
- PAM 分段:将 PAM 系统部署在独立的安全分段中
- 零信任架构:对 PAM 访问实施零信任策略(MFA + 设备合规)
- 凭据轮换:定期轮换 PAM 系统保管的特权凭据
- 审计日志:对 PAM 系统的所有操作进行不可篡改的审计记录
- 红队演练:定期对 PAM 系统进行渗透测试和红队演练
0x08 参考资料
- NVD - CVE-2026-1731: https://nvd.nist.gov/vuln/detail/CVE-2026-1731
- BeyondTrust BT26-02: https://www.beyondtrust.com/trust-center/security-advisories/bt26-02
- BeyondTrust BT26-03: https://www.beyondtrust.com/trust-center/security-advisories/bt26-03
- BeyondTrust BT25-04 (SSTI): https://www.beyondtrust.com/trust-center/security-advisories/bt25-04
- BeyondTrust BT24-10 (Command Injection): https://www.beyondtrust.com/trust-center/security-advisories/bt24-10
- CyberArk Delinea DLL Hijack: https://www.cyberark.com/resources/threat-research-blog/identity-crisis-the-curious-case-of-a-delinea-local-privilege-escalation-vulnerability
- CyberArk Conjur CVE-2025-49830/49831: https://stack.watch/product/cyberark/
- KeePass CVE-2023-32784: https://nvd.nist.gov/vuln/detail/CVE-2023-32784
- Verizon DBIR 2025: https://www.verizon.com/business/resources/reports/dbir/
- IBM Cost of a Data Breach 2024: https://www.ibm.com/reports/data-breach
免责声明:本文仅供安全研究和教育目的使用。所有 PoC 代码和检测模板仅用于授权的安全测试。未经授权对目标系统进行测试属于违法行为。作者不对任何因使用本文内容导致的损害承担责任。请在合法授权范围内开展安全评估工作。