# Unconstrained Delegation

As we mentioned before what is the risk to having Unconstrained Delegation, is that anytime an account connects to the compromised computer for any reason, their ticket (TGT) is stored in memory so it can be used later by the computer for impersonation.

How does this look like, well let's setup an account for this.

Right-Click on the proper Computer Name and move to the Delgation Tab. And click apply to finish the setup.

![](https://244509215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lx2b2zLkTKHrsGfxMoR%2F-M-wi_90CmuthF4DURlV%2F-M-wirCC79juLEOMoVfo%2Fimage.png?alt=media\&token=51d94c1d-8cb1-401b-80fb-628b180fb218)

From the Domain Controller we can query for the Unconstrained Computers.

![Active Directory Module](https://244509215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lx2b2zLkTKHrsGfxMoR%2F-M-wi_90CmuthF4DURlV%2F-M-wk6dS5IGzsLL6Kcg6%2Fimage.png?alt=media\&token=ee0b79bc-b0b7-49c1-9d40-d10f51ef45aa)

{% hint style="info" %}
From here a Administrator user on the Compromised machine is needed
{% endhint %}

But when we compromise a Domain user we can use PowerView to find the Unconstrained computer with a syntax

```
Get-NetComputer -Unconstrained
```

![](https://244509215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lx2b2zLkTKHrsGfxMoR%2F-M-wi_90CmuthF4DURlV%2F-M-wkR0A1Ts7o4xZp_5j%2Fimage.png?alt=media\&token=1ecc5baa-09a7-498f-997b-bde8e6a235fd)

```
Get-NetComputer -Unconstrained -FullData |ConvertFrom-UACValue
```

![](https://244509215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lx2b2zLkTKHrsGfxMoR%2F-M-wm1HcMcdPk_yvV_dq%2F-M-wnCV0WnXvs5tHikpC%2Fimage.png?alt=media\&token=757228a8-4d2a-4144-9865-b1b5437b1bc2)

The next step in our attack to listen for a connection on a Domain User (in this case the Domain Admin). All the Domain Admin needs to do here is authenticate to our compromised workstation. Even just listing the directory is enough for us to capture a ticket. And we can use mimikatz to extract the ticket from our session with the compromised Admin.

![](https://244509215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lx2b2zLkTKHrsGfxMoR%2F-M0uKyLaVfFDGbDEpPLK%2F-M0uQFzjsxVgNS1HWgxk%2Fimage.png?alt=media\&token=a50d98fa-0f42-4c6c-aeae-114d362142af)

With mimikatz we can see the tickets saved. In the current session. Currently as another Domain User (Kevin)

![](https://244509215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lx2b2zLkTKHrsGfxMoR%2F-M0uQYRYOBu22LOq0PWz%2F-M0uQz15w-lVro6pgpg5%2Fimage.png?alt=media\&token=b5d5f8dd-ec4a-415d-952a-7254a4392a76)

And with kevin I can dump the tickets once gaining higher access and finally we can use this ticket until it expires by using mimikatz "Pass the Ticket" method.

![](https://244509215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lx2b2zLkTKHrsGfxMoR%2F-M0uR0fo7_ur6tJvh5DS%2F-M0uRTtgHaNoOWyB8M68%2Fimage.png?alt=media\&token=d27a4f7b-8d95-4829-8d00-bc2dd2824472)

![](https://244509215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lx2b2zLkTKHrsGfxMoR%2F-M0uRWgf7jWEDOLZUhdf%2F-M0uTPv0AznaWfVa_5ZS%2Fimage.png?alt=media\&token=550c8184-8d57-4864-a9fa-1f8460174ad6)

And just to verify I will list the C directory of the Domain Controller. Currently as the user Kevin but the Domain Admins Ticket

![](https://244509215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lx2b2zLkTKHrsGfxMoR%2F-M0uTS2YGu5m9YvWnrus%2F-M0uU0EhcPI6RJgoVkyp%2Fimage.png?alt=media\&token=5193fac8-122a-4a51-a8d2-1a7b5724a7d3)

We can enumerate the DC directories, as we can see this gives us no limits on who we want to impersonate as this attack is just a waiting game because we need a user to authenticate to our compromised machine, just a matter of time for automated scripts, there are numerous way's to approach this situation, such as Covenant just a few syntax, Rubeus and SpoolCheck that is able to "force" an authentication to our machine using the "Printer Bug", and also using the impacket tool set.

{% embed url="https://www.riccardoancarani.it/exploiting-unconstrained-delegation/" %}

{% embed url="https://adsecurity.org/?p=1667" %}

{% embed url="https://dirkjanm.io/krbrelayx-unconstrained-delegation-abuse-toolkit/" %}

