Skip to main content

Kerberos Protocol

Status: Scaffold — content in progress

Kerberos v5 is the primary authentication protocol in Active Directory since Windows 2000. Understanding the ticket lifecycle is essential for understanding Kerberoasting, Golden Tickets, Silver Tickets, Pass-the-Ticket, and unconstrained delegation attacks.

Protocol Flow

Client KDC (AS) KDC (TGS) Service
│ │ │ │
│── AS-REQ (username) ──>│ │ │
│<─ AS-REP (TGT) ────────│ │ │
│ │ │ │
│── TGS-REQ (TGT + SPN) ───────────────────────>│ │
│<─ TGS-REP (Service Ticket) ────────────────────│ │
│ │ │ │
│── AP-REQ (Service Ticket) ──────────────────────────────────────────>│
│<─ AP-REP (session key) ──────────────────────────────────────────────│

Step 1 — AS Exchange (Get TGT)

  1. Client sends AS-REQ with username and pre-authentication data (timestamp encrypted with user's key)
  2. KDC validates pre-auth, returns AS-REP containing the TGT (Ticket Granting Ticket)
  3. TGT is encrypted with the krbtgt account's NTLM hash — only the KDC can decrypt it

Step 2 — TGS Exchange (Get Service Ticket)

  1. Client presents TGT to TGS with the target SPN (Service Principal Name)
  2. TGS returns a Service Ticket encrypted with the service account's NTLM hash
  3. Client can now authenticate to the service

Step 3 — AP Exchange

  1. Client presents Service Ticket to the target service
  2. Service decrypts it using its own key, verifies the client's identity

Critical Security Details

DetailSecurity Implication
TGT encrypted with krbtgt hashCompromise krbtgt = forge any TGT (Golden Ticket)
Service ticket encrypted with service account hashCrack the hash offline = Kerberoasting
TGT lifetime: 10 hours defaultShort-lived, but forged Golden Tickets can have arbitrary lifetimes
Pre-authentication disabled for some accountsAS-REP Roasting — can request TGT without knowing password
PAC (Privilege Attribute Certificate)Contains group memberships — can be forged in Golden Ticket

Encryption Types

EtypeAlgorithmNotes
17AES-128-CTS-HMAC-SHA1-96Current default
18AES-256-CTS-HMAC-SHA1-96Current default (stronger)
23RC4-HMACLegacy; == NTLM hash — easier to crack

Kerberoasting targets etype 23 (RC4) because the resulting hash is an NT hash, crackable with hashcat.

Delegation Models

TypeHow it worksRisk
UnconstrainedService gets copy of user's TGTAny service ticket from a user includes their TGT — attacker on this server can steal TGTs from all incoming authentications
Constrained (KCD)Service can impersonate user only to specific targetsLower risk, but still abusable via msDS-AllowedToDelegateTo
Resource-Based Constrained (RBCD)Target service controls who can delegate to itAttacker with write access to msDS-AllowedToActOnBehalfOfOtherIdentity can create delegation path

Telemetry

Event IDDescription
4768Kerberos Authentication Ticket (TGT) request
4769Kerberos Service Ticket request
4770Kerberos Service Ticket renewal
4771Kerberos pre-auth failed
TopicLink
Kerberoastingkerberoasting
AS-REP Roastingasrep-roasting
Golden Ticketgolden-ticket
Pass-the-Ticketpass-the-ticket