Resource-Based Constrained Delegation
Windows 2012 introduced a new type of delegation called resource-based constrained delegation (RBCD), which allows the delegation configuration to be set on the target rather than the source.
For Constrained Delegation and Unconstrained Delegation, delegation management was done at the level of the service that wanted to impersonate a user to access a resource. Resource-based constrained delegation reverses the responsibilities and shifts delegation management to the final resource. It is no longer at the service level that we list the resources to which we can delegate, but at the resource level, a trust list is established. Any account on this trusted list has the right to delegate authentication to access the resource.
To compare - constrained delegation is configured on the "front-end" service via its msDS-AllowedToDelegateTo
attribute
The resource has the right to modify its own trusted list so any service account has the right to modify its trusted list to allow one or more accounts to delegate authentication to themselves. If a service account adds one or more accounts to its trusted list, it updates its msDS-AllowedToActOnBehalfOfOtherIdentity
attribute.
Enabling unconstrained or constrained delegation on a computer requires the SeEnableDelegationPrivilege user right assignment on domain controllers, which is only granted to enterprise and domain admins.
The two major prerequisites to pull off the attack are:
A target computer on which you can modify
msDS-AllowedToActOnBehalfOfOtherIdentity
Control of another principal that has an SPN.
This query will obtain every domain computer and read their ACL, filtering on the interesting rights.
A common means of obtaining a principal with an SPN is to use a computer account
but if we don't own one we might able to create a new machine account if the MAQ (machine account quota) of a user we own is > 0 (it should be 10 by default)
We'll then use this inside an SDDL to create a security descriptor. The content of msDS-AllowedToActOnBehalfOfOtherIdentity
must be in raw binary format.
another variation of this is the following
These commands do the following
Obtain the computer SID.
Use the Security Descriptor Definition Language (SDDL) to create a security descriptor.
Set
msDS-AllowedToActOnBehalfOfOtherIdentity
in raw binary format.Modify the target computer.
Next, we use the OTTR$ account to perform the S4U impersonation with Rubeus. The s4u
command requires a TGT, RC4 or AES hash.
Finally, pass the ticket into a logon session for use.
To clean up, simply remove the msDS-AllowedToActOnBehalfOfOtherIdentity entry on the target.
or
Another way to perform the attack consists in using the StandIn tool and its functionality to create a computer with a random password.
Rubeus' hash
can take that password and calculate their hashes.
We can also use this script to enumerate for user accounts we can use for RBCD.
From linux the whole process is automated with a script from the Impacket suite
Last updated