Constrained
Last updated
Was this helpful?
Last updated
Was this helpful?
Constrained delegation does not leverage TGTs, and thus, cannot impersonate a user freely on any service (msds-allowedtodelegateto
). Instead, it uses the S4U2Self
and S4U2Proxy
Keberos extensions:
S4U2Proxy: allows a service to obtain a ST on behalf of a client to another service. The initial client ST is required as evidence that the client has authenticated.
S4U2Self: allows a service to obtain a ST to itself as evidence that a client has authenticated. Any services (SPN account) can invoke S4U2Self.
This process requires only a ST (evidence/additional) as a requirement to invoke it.
We need an account with at least one SPN (Figure 2.1).
We can impersonate web01
through its credentials (Figure 2.2).
Any SPN account can configure RBCD for itself. So we will make web01
to trust attl4s
, so the latter can impersonate any user to the former (Figure 3).
Now, we can use attl4s
machine to obtain a ST for web01
, impersonating the administrator
(S4U2Self
& S4U2Proxy
) (Figure 4).
Since the second ST ticket is forwardable
, it can be used on Kerberos for authenticating as administrator
(TGT).
PT means "I don't care how the client authenticates". It just needs the client's name.
If we compromise a service configured for CD with PT (web01
), then we can generate a ST for any user we want (administrator
) with S4U2Self
pointing to web01
(Figure 6).
The ST generated from S4U2Self
will be forwardable
, and thus can be used with S4U2Proxy
to generate a second ST for the targeted service (cifs
) as the impersonated user (administrator
) (Figure 7).
Althought, the SPN account will have specific service(s) in the msDS-AllowedToDelegateTo
attribute (cifs
) (Figure 8), this can modified to target other services from the same service account (http
) (Figure 6 & 7).
The difference vs. is that the S4U2Proxy
cannot be invoked as we don't have a ST for the user (since NTLM authentication was used) (Figure 5.1).
The difference with is that the KDC checks the TRUST_TO_AUTH_FOR_DELEGATION
setting and sees that web01
is trusted, so it issues a forwardable
ST to it (Figure 5.2), therefore, the S4U2Proxy
can now be invoked.
web01
(image taken from).forwardable
ST as administrator with the S4U2Self
for web01
(image taken from).S4U2Proxy
for the targeted service as administrator (image taken from).msds-allowedtodelegateto
attribute of WEB01
(image taken from).