Diamond Ticket
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
Diamond Ticket
Like a golden ticket, a diamond ticket is a TGT which can be used to ์ด๋ค ์ฌ์ฉ์๋ก์๋ ์ด๋ค ์๋น์ค์ ์ ๊ทผํ ์ ์์ต๋๋ค. A golden ticket is forged completely offline, encrypted with the krbtgt hash of that domain, and then passed into a logon session for use. Because domain controllers donโt track TGTs it (or they) have legitimately issued, they will happily accept TGTs that are encrypted with its own krbtgt hash.
There are two common techniques to detect the use of golden tickets:
- Look for TGS-REQs that have no corresponding AS-REQ.
- Look for TGTs that have silly values, such as Mimikatzโs default 10-year lifetime.
A diamond ticket is made by modifying the fields of a legitimate TGT that was issued by a DC. This is achieved by requesting a TGT, decrypting it with the domainโs krbtgt hash, modifying the desired fields of the ticket, then re-encrypting it. This overcomes the two aforementioned shortcomings of a golden ticket because:
- TGS-REQs will have a preceding AS-REQ.
- The TGT was issued by a DC which means it will have all the correct details from the domainโs Kerberos policy. Even though these can be accurately forged in a golden ticket, itโs more complex and open to mistakes.
์๊ตฌ์ฌํญ ๋ฐ ์ํฌํ๋ก์ฐ
- ์ํธํ ์๋ฃ: TGT๋ฅผ ๋ณตํธํํ๊ณ ์ฌ์๋ช ํ๊ธฐ ์ํ krbtgt AES256 ํค(๊ถ์ฅ) ๋๋ NTLM hash.
- ์ ์ TGT blob:
/tgtdeleg,asktgt,s4u๋ก ํ๋ํ๊ฑฐ๋ ๋ฉ๋ชจ๋ฆฌ์์ ํฐ์ผ์ ๋ด๋ณด๋ด์ด ์ป์ ๊ฒ. - ์ปจํ ์คํธ ๋ฐ์ดํฐ: ๋์ ์ฌ์ฉ์ RID, ๊ทธ๋ฃน RIDs/SIDs, ๋ฐ (์ ํ์ ์ผ๋ก) LDAP์์ ๊ฐ์ ธ์จ PAC ์์ฑ๋ค.
- ์๋น์ค ํค (์๋น์ค ํฐ์ผ์ ์ฌ๋ฐํํ๋ ค๋ ๊ฒฝ์ฐ์๋ง): ์์กฐํ ์๋น์ค SPN์ AES ํค.
- ์ ์ด ๊ฐ๋ฅํ ์ฌ์ฉ์๋ก AS-REQ์ ํตํด TGT๋ฅผ ์ป์ต๋๋ค. Rubeus์
/tgtdeleg๋ ์๊ฒฉ์ฆ๋ช ์์ด ํด๋ผ์ด์ธํธ๊ฐ Kerberos GSS-API ์ ์ฐจ๋ฅผ ์ํํ๋๋ก ๊ฐ์ ํ๋ฏ๋ก ํธ๋ฆฌํฉ๋๋ค. - ๋ฐํ๋ TGT๋ฅผ krbtgt ํค๋ก ๋ณตํธํํ๊ณ PAC ์์ฑ(์ฌ์ฉ์, ๊ทธ๋ฃน, ๋ก๊ทธ์จ ์ ๋ณด, SIDs, ์ฅ์น ํด๋ ์ ๋ฑ)์ ํจ์นํฉ๋๋ค.
- ๋์ผํ krbtgt ํค๋ก ํฐ์ผ์ ๋ค์ ์ํธํ/์๋ช
ํ๊ณ ํ์ฌ ๋ก๊ทธ์จ ์ธ์
์ ์ฃผ์
ํฉ๋๋ค (
kerberos::ptt,Rubeus.exe ptt๋ฑ). - ์ ํ์ ์ผ๋ก, ์ ์ ์์์ ์๋ฐํจ์ ์ ์งํ๊ธฐ ์ํด ์ ํจํ TGT blob๊ณผ ๋์ ์๋น์ค ํค๋ฅผ ์ ๊ณตํ์ฌ ์๋น์ค ํฐ์ผ์ ๋ํด ๋์ผํ ํ๋ก์ธ์ค๋ฅผ ๋ฐ๋ณตํ ์ ์์ต๋๋ค.
์ ๋ฐ์ดํธ๋ Rubeus ๊ธฐ๋ฒ (2024+)
Huntress์ ์ต๊ทผ ์์
์ผ๋ก Rubeus ๋ด๋ถ์ diamond ์ก์
์ด modernized ๋์๊ณ , ์ด์ ์ golden/silver ํฐ์ผ์์๋ง ์กด์ฌํ๋ /ldap ๋ฐ /opsec ๊ฐ์ ์ฌํญ์ด ์ด์๋์์ต๋๋ค. /ldap๋ ์ด์ AD์์ ์ ํํ PAC ์์ฑ(์ฌ์ฉ์ ํ๋กํ, logon hours, sidHistory, ๋๋ฉ์ธ ์ ์ฑ
๋ฑ)์ ์๋์ผ๋ก ์ฑ์์ฃผ๋ฉฐ, /opsec๋ ๋ ๋จ๊ณ์ pre-auth ์ํ์ค๋ฅผ ์ํํ๊ณ AES-only ์ํธํ๋ฅผ ๊ฐ์ ํ์ฌ AS-REQ/AS-REP ํ๋ฆ์ Windows client์ ๊ตฌ๋ถํ ์ ์๊ฒ ๋ง๋ญ๋๋ค. ์ด๋ ๋น ์ฅ์น ID๋ ๋นํ์ค์ ์ธ ์ ํจ ๊ธฐ๊ฐ๊ณผ ๊ฐ์ ๋ช
ํํ ์งํ๋ฅผ ํฌ๊ฒ ์ค์ฌ์ค๋๋ค.
# Query RID/context data (PowerView/SharpView/AD modules all work)
Get-DomainUser -Identity <username> -Properties objectsid | Select-Object samaccountname,objectsid
# Craft a high-fidelity diamond TGT and inject it
.\Rubeus.exe diamond /tgtdeleg \
/ticketuser:svc_sql /ticketuserid:1109 \
/groups:512,519 \
/krbkey:<KRBTGT_AES256_KEY> \
/ldap /ldapuser:MARVEL\loki /ldappassword:Mischief$ \
/opsec /nowrap
/ldap(with optional/ldapuser&/ldappassword)๋ ๋์ ์ฌ์ฉ์์ PAC ์ ์ฑ ๋ฐ์ดํฐ๋ฅผ ๋ฏธ๋ฌ๋งํ๊ธฐ ์ํด AD์ SYSVOL์ ์ฟผ๋ฆฌํฉ๋๋ค./opsec๋ Windows-์ ์ฌ AS-REQ ์ฌ์๋๋ฅผ ๊ฐ์ ํ๋ฉฐ ๋ ธ์ด์ฆ๊ฐ ํฐ ํ๋๊ทธ๋ฅผ 0์ผ๋ก ์ด๊ธฐํํ๊ณ AES256์ ๊ณ ์ ์ ์ผ๋ก ์ฌ์ฉํฉ๋๋ค./tgtdeleg๋ ํผํด์์ ํ๋ฌธ ๋น๋ฐ๋ฒํธ๋ NTLM/AES ํค์ ์ง์ ์ ๊ทผํ์ง ์์ผ๋ฉด์๋ ๋ณตํธํ ๊ฐ๋ฅํ TGT๋ฅผ ๋ฐํํฉ๋๋ค.
Service-ticket recutting
๊ฐ์ Rubeus ์
๋ฐ์ดํธ๋ diamond technique์ TGS blobs์ ์ ์ฉํ๋ ๊ธฐ๋ฅ์ ์ถ๊ฐํ์ต๋๋ค. diamond์ base64-encoded TGT (from asktgt, /tgtdeleg, or a previously forged TGT), the service SPN, and the service AES key๋ฅผ ์ ๊ณตํ๋ฉด KDC๋ฅผ ๊ฑด๋๋ฆฌ์ง ์๊ณ ๋ ํ์ค์ ์ธ ์๋น์ค ํฐ์ผ์ ์์ฑํ ์ ์์ต๋๋ค โ ์ฌ์ค์ ๋ ์๋ฐํ silver ticket.
.\Rubeus.exe diamond \
/ticket:<BASE64_TGT_OR_KRB-CRED> \
/service:cifs/dc01.lab.local \
/servicekey:<AES256_SERVICE_KEY> \
/ticketuser:svc_sql /ticketuserid:1109 \
/ldap /opsec /nowrap
์ด ์ํฌํ๋ก์ฐ๋ ์ด๋ฏธ ์๋น์ค ๊ณ์ ํค(์: lsadump::lsa /inject ๋๋ secretsdump.py๋ก ๋คํํ)๋ฅผ ๋ณด์ ํ๊ณ ์์ผ๋ฉฐ ์๋ก์ด AS/TGS ํธ๋ํฝ์ ๋ฐ์์ํค์ง ์๊ณ AD ์ ์ฑ
, ํ์๋ผ์ธ, PAC ๋ฐ์ดํฐ์ ์ ํํ ์ผ์นํ๋ ์ผํ์ฑ TGS๋ฅผ ์์ฑํ๋ ค๋ ๊ฒฝ์ฐ์ ์ด์์ ์
๋๋ค.
OPSEC ๋ฐ ํ์ง ๋ ธํธ
- ์ ํต์ ์ธ ํํฐ ํด๋ฆฌ์คํฑ(AS ์์ด ์ป์ TGS, ์์ญ ๋ ์ง๋ฆฌ ์๋ช )์ golden tickets์๋ ์ฌ์ ํ ์ ์ฉ๋์ง๋ง, diamond tickets๋ ์ฃผ๋ก PAC ๋ด์ฉ์ด๋ ๊ทธ๋ฃน ๋งคํ์ด ๋ถ๊ฐ๋ฅํด ๋ณด์ผ ๋ ๋๋ฌ๋ฉ๋๋ค. ์๋ ๋น๊ต์์ ์์กฐ๋ฅผ ์ฆ์ ํ์งํ์ง ์๋๋ก ๋ชจ๋ PAC ํ๋(๋ก๊ทธ์จ ์๊ฐ, ์ฌ์ฉ์ ํ๋กํ ๊ฒฝ๋ก, ์ฅ์น ID ๋ฑ)๋ฅผ ์ฑ์ฐ์ธ์.
- ๊ทธ๋ฃน/RIDs๋ฅผ ๊ณผ๋ํ๊ฒ ํ ๋นํ์ง ๋ง์ธ์. ๋ง์ฝ
512(Domain Admins)์519(Enterprise Admins)๋ง ํ์ํ๋ค๋ฉด ๊ฑฐ๊ธฐ์ ๋ฉ์ถ๊ณ ๋์ ๊ณ์ ์ด AD์ ๋ค๋ฅธ ๊ณณ์์ ํด๋น ๊ทธ๋ฃน์ ๊ทธ๋ด๋ฏํ๊ฒ ์ํด ์๋์ง ํ์ธํ์ธ์. ๊ณผ๋ํExtraSids๋ ๋๋ฌ๋ฉ๋๋ค. - Splunk์ Security Content ํ๋ก์ ํธ๋ diamond tickets์ฉ attack-range ํ ๋ ๋ฉํธ๋ฆฌ์ Windows Domain Admin Impersonation Indicator ๊ฐ์ ํ์ง ๊ท์น์ ๋ฐฐํฌํฉ๋๋ค. ์ด ๊ท์น์ ๋น์ ์์ ์ธ Event ID 4768/4769/4624 ์ํ์ค์ PAC ๊ทธ๋ฃน ๋ณ๊ฒฝ์ ์ฐ๊ด์ํต๋๋ค. ํด๋น ๋ฐ์ดํฐ์ ์ ์ฌ์ํ๊ฑฐ๋(๋๋ ์ ๋ช ๋ น์ผ๋ก ์์ฒด ์์ฑํ๋ฉด) T1558.001์ ๋ํ SOC ์ปค๋ฒ๋ฆฌ์ง๋ฅผ ๊ฒ์ฆํ๊ณ ํํผ๋ฅผ ์ํ ๊ตฌ์ฒด์ ์ธ ๊ฒฝ๋ณด ๋ก์ง์ ์ป๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค.
References
- Huntress โ Recutting the Kerberos Diamond Ticket (2025)
- Splunk Security Content โ Diamond Ticket attack data & detections (2023)
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


