githubEdit

Constrained Delegation

Constrained Delegation

Link: https://viperone.gitbook.io/pentest-everything/everything/everything-active-directory/credential-access/steal-or-forge-kerberos-tickets/constrained-delegation

Requirements

Compromise of the Active Directory Object that is configured for "Trusted to Auth".

Explanation

Microsoft introduced Constrained Delegation in Windows Server 2003 to provide a more secure form of delegation compared to the high-risk Unconstrained Delegation.

With Constrained Delegation, administrators can specify the services or applications for which a server is allowed to act on behalf of a user, thereby limiting the attack surface. This feature can reduce the risk of an attacker impersonating a user and accessing resources that they are not authorized to access.

Enumeration

1) Powerview

Get computer Constrained Delegation

Get-DomainComputer -TrustedToAuth| Select DnsHostName,UserAccountControl,msds-allowedtodelegateto | FL

Get user Constrained Delegation

Get-DomainUser -TrustedToAuth

2) Powershell

Search both users and computers for Constrained Delegation

Obtain TGT

1) Rubeus

Triage current tickets

Dump the systems TGT

OR

If you have the NTLM hash for the compromised account

If you have the aes265 hash for the compromised account

If you have the plain text password

2) Invoke-Rubeus

Triage current tickets

Dump the systems TGT

OR

If you have the NTLM hash for the compromised account

If you have the aes265 hash for the compromised account

If you have the plain text password

Obtain TGS for service

1) Rubeus

Use obtained TGT to request a TGS ticket for the delegated service and impersonate another user

Example

2) Invoke-Rubeus

Use obtained TGT to request a TGS ticket for the delegated service and impersonate another user

Example

Pass the Ticket (PtT)

1) Rubeus

Method 1: Pass ticket into seperate session (Preffered)

Create new LUID session (Requires Elevation)

Pass ticket into new session

Method 2: Pass ticket directly into current session (Can cause auth issues)

2) Invoke-Rubeus

Method 1: Pass ticket into seperate session (Preffered)

Create new LUID session (Requires Elevation)

Pass ticket into new session

Method 2: Pass ticket directly into current session (Can cause auth issues)

Alternate Service Name

Kerberos uses a Service Principal Name (SPN) to identify a service during authentication, which is typically a combination of the service name and the host's name where the service is running. Rubeus.exe includes an option called /altservicename that enables an attacker to use a different service name when constructing the SPN. This option can be helpful in certain situations, such as when the default service name is unavailable or the attacker wants to target a specific service.

Generate TGS for the alternative service name

1) Rubeus

Example

2) Invoke-Rubeus

Example

Generate service tickets for all service types

Last updated