Kerberos Delegations: Unconstrained, Constrained, and RBCD
Concept
Section titled “Concept”In multi-tier enterprise applications (e.g., Frontend Web Server $\rightarrow$ Backend SQL Database), the frontend server must frequently query the database under the security context of the authenticated end user to enforce database-level access controls. This is the role of Kerberos Delegation.
Active Directory implements three successive architectures of delegation:
- Unconstrained Delegation (Windows 2000): The client forwards a full, reusable copy of its TGT to the frontend service. The frontend can subsequently impersonate that client against any service across the entire forest.
- Constrained Delegation with S4U (Windows Server 2003): The frontend account is restricted by a domain administrator to a predefined whitelist of target SPNs (configured in
msDS-AllowedToDelegateTo). - Resource-Based Constrained Delegation (RBCD - Windows Server 2012): Inverts configuration control: the target resource server configures its own
msDS-AllowedToActOnBehalfOfOtherIdentityattribute to specify which service accounts are permitted to impersonate users against it.
Why It Matters in DFIR
Section titled “Why It Matters in DFIR”Delegation abuse lies at the center of sophisticated enterprise takeovers:
- Harvesting Tier 0 TGTs: An Unconstrained Delegation server acts as a credential trap. Attackers leverage authentication coercion techniques (PetitPotam, PrinterBug / MS-RPRN) to force a DC to authenticate to the compromised host, capturing the DC’s machine TGT from LSASS.
- Protocol Transition Attacks (S4U2Self / S4U2Proxy): In constrained delegation with protocol transition, an attacker possessing the service key can synthesize a service ticket for any domain user (including Domain Admins) without requiring user interaction.
- Stealthy RBCD Persistence: Attackers with write permissions (
GenericWrite,WriteProperty) over a computer object can inject an attacker-controlled machine account intomsDS-AllowedToActOnBehalfOfOtherIdentity, granting permanent local administrative compromise.
How It Works
Section titled “How It Works”1. Unconstrained Delegation
Section titled “1. Unconstrained Delegation”- Active Directory Attribute:
userAccountControlcontains the flagTRUSTED_FOR_DELEGATION(0x80000). - When a client requests a TGS for this service, the KDC bundles a forwardable copy of the client’s TGT inside the service ticket.
- The receiving host decrypts the ticket and stores the forwarded TGT directly in local LSASS memory.
2. Constrained Delegation (S4U)
Section titled “2. Constrained Delegation (S4U)”- AD Attributes:
msDS-AllowedToDelegateTo(whitelisted SPNs) andTRUSTED_TO_AUTH_FOR_DELEGATION(protocol transition flag). - Employs Microsoft Kerberos extensions S4U2Self (service requests a ticket to itself on behalf of an arbitrary user) and S4U2Proxy (service exchanges this ticket for a TGS targeting the authorized backend service).
3. Resource-Based Constrained Delegation (RBCD)
Section titled “3. Resource-Based Constrained Delegation (RBCD)”- AD Attribute:
msDS-AllowedToActOnBehalfOfOtherIdentity(binary security descriptor DACL). - Can be configured without
Domain Adminsrights by any identity possessing delegated management rights over the target computer.
What Is Possible
Section titled “What Is Possible”- Dumping Cached TGTs from Memory: On an Unconstrained host, executing
sekurlsa::ticketsdumps all forwardable TGTs stored in LSASS since the last reboot. - Coercing Domain Controller Authentication: Running PetitPotam against a DC while listening on an Unconstrained host yields the
DC01$machine TGT, enabling instant DCSync. - Protecting High-Value Accounts: Setting
Account is sensitive and cannot be delegated(NOT_DELEGATED/0x100000) or adding the account to theProtected Usersgroup blocks TGT forwarding entirely.
What Is Not Possible
Section titled “What Is Not Possible”- Delegating Members of
Protected Users: Members of this group cannot have their credentials forwarded or delegated under any Kerberos delegation model. - Abusing Constrained Delegation to Access Unlisted SPNs: Target KDCs validate
msDS-AllowedToDelegateTo. Unauthorized SPN requests fail withKDC_ERR_BADOPTION. - Configuring RBCD Without an Account Bearing an SPN: Executing the S4U2Proxy leg requires that the operating principal possesses at least one valid SPN (standard computer account or gMSA).
Common DFIR Confusions
Section titled “Common DFIR Confusions”| Frequent Confusion | Verifiable Forensic Reality |
|---|---|
| ”All Windows servers have Unconstrained Delegation enabled by default.” | Only Domain Controllers have Unconstrained Delegation enabled by default. Any member server with this flag represents an architectural anomaly. |
| ”The Protected Users group prevents all credential harvesting.” | It disables NTLM and Kerberos delegation, but does not protect against NTDS database extraction or DCSync. |
| ”RBCD configuration requires Domain Admin rights.” | False. Any user with write permissions on the computer object (e.g., Owner, creator, or delegated technician) can populate RBCD attributes. |
Concrete Forensic Example
Section titled “Concrete Forensic Example”During an investigation, an auxiliary print server PRINT-SRV is compromised:
- Triage reveals
PRINT-SRVholds theTRUSTED_FOR_DELEGATIONflag. - The adversary triggers PetitPotam against domain controller
DC01:python3 petitpotam.py PRINT-SRV 10.0.1.1 DC01connects via MS-EFSR RPC toPRINT-SRV, providing its forwardable machine TGT (DC01$).- The attacker extracts
DC01$’s TGT from LSASS using Rubeus. - The attacker injects this ticket into their session and invokes DCSync to dump the domain
krbtgthash. - DFIR Assessment: Complete domain takeover executed within 10 minutes originating from an unmonitored print server.
Key Forensic Artefacts
Section titled “Key Forensic Artefacts”- Active Directory Attributes:
userAccountControl: Flags0x80000(TRUSTED_FOR_DELEGATION) or0x1000000(TRUSTED_TO_AUTH_FOR_DELEGATION).msDS-AllowedToDelegateTo: Multi-valued list of target SPNs.msDS-AllowedToActOnBehalfOfOtherIdentity: Binary security descriptor on target computer objects.
- DC Security Event Logs:
- Event ID 4769 (TGS Request): Telemetry capturing S4U2Self and S4U2Proxy operations (service name appearing in client identity field).
- Event ID 4738 / 4742: Account modifications capturing updates to delegation attributes.
Investigation Methods
Section titled “Investigation Methods”- Inventory All Unconstrained Delegation Hosts:
Run
Get-ADComputer -Filter {TrustedForDelegation -eq $True}to identify high-risk TGT collection points. - Audit RBCD Configurations Across the Fleet:
Query for computer accounts where
msDS-AllowedToActOnBehalfOfOtherIdentityis populated. - Monitor Inbound DC-to-Member-Server RPC Connections: Inspect network and host firewalls for anomalous outbound RPC/SMB traffic originating from DCs toward member servers (coercion signatures).
Investigative Tooling
Section titled “Investigative Tooling”- PowerView:
Terminal window Get-DomainComputer -UnconstrainedGet-DomainUser -TrustedToAuthGet-DomainComputer | Where-Object { $_.'msds-allowedtoactonbehalfofotheridentity' -ne $null } - BloodHound:
Cypher Queries:
MATCH (c:Computer {unconstraineddelegation:true}) RETURN cMATCH p=(u)-[:AllowedToAct]->(c:Computer) RETURN p
Key Takeaways
Section titled “Key Takeaways”- Unconstrained delegation caches full client TGTs in LSASS.
- Chaining authentication coercion (PetitPotam) with Unconstrained Delegation achieves instantaneous domain compromise.
- RBCD enables granting administrative access over a workload without requiring Domain Admin rights.
- Privileged identities must be protected with
Account is sensitive and cannot be delegated.