githubEdit

Unconstrained Delegation

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

Requirements

Elevated privileges on the host that is configured for Unconstrained Delegation

Domain Controllers will always have TrustedForDelegation enabled!

Description

Kerberos delegation in Active Directory refers to the ability of an object, such as a user or computer, to reuse end-user credentials for accessing resources hosted on a different server.

Unconstrained Delegation occurs when a computer, such as a File Server, has the "Trust this computer for delegation to any service" option enabled, and a Domain Administrator logs into the File Server. This enables us to grab a copy of the Domain Administrator's TGT, which can be used to authenticate anywhere in the Domain.

Explanation

WITHOUT Unconstrained Delegation

When a system is not configured for unconstrained delegation, typically only a Ticket Granting Service (TGS) ticket for the relevant service is stored on the system when a user authenticates through Kerberos. This ticket can only be used to authenticate to the same service on that same system and cannot be used to authenticate to other services or systems within the domain.

WITH Unconstrained Delegation

When a system is configured for Unconstrained Delegation and a user, such as the Domain Administrator, connects to the system through a protocol like WinRM or CIFS, the TGT for the user account may be stored on the system.

If an attacker can gain access to this TGT, either by compromising the system or using other techniques, they can potentially use it to impersonate the user and access resources anywhere in the domain. This is known as a Pass-the-Ticket (PtT) attack.

Enumeration

1) Powerview

2) Powershell

Ticket Acquisition

1) Rubeus (Binary)

Triage for existing tickets

Dump tickets for selected user,service or LUID

Monitor for and dump new tickets

2) Invoke-Rubeus

Triage for existing tickets

Dump tickets for selected user,service or LUID

Monitor for and dump new tickets

3) Mimikatz

Export tickets (Preferred Method (More Accurate))

Alternative Method

4) Invoke-Mimikatz

Export tickets (Preferred Method (More Accurate))

Alternative Method

Pass the Ticket (PtT)

1) Rubeus (Binary)

Method 1: Pass ticket into seperate session (Preferred)

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)

3) Mimikatz

Pass ticket into current session

Confirm if ticket has been stored

Open new session with injected ticket

4) Invoke-Mimikatz

Pass ticket into current session

Confirm if ticket has been stored

Open new session with injected ticket

Then proceed with lateral movement using WinRM for example

Forced Authentication

When a system has Unconstrained Delegation enabled, a potential attack vector is to force other users or systems to authenticate against the host which is configured for unconstrained delegation.

By doing so we can force the victim user / computer account to store a copy of their TGT into the compromised system.

Printer Bug https://raw.githubusercontent.com/NotMedic/NetNTLMtoSilverTicket/master/Get-SpoolStatus.ps1

Enumerate for vulnerable servers

PowerView

Get all computers

Get all servers

Set Rubeus for ticket harvesting

OR

Perform Forced Authentication

1) Invoke-SpoolSample

Load into memory

Execute

2) SharpSpoolTrigger https://github.com/cube0x0/SharpSystemTriggers

Execute

Collect Ticket for Profit! Impersonate this using Pass the Ticket.

Last updated