Skip to main content
Kerberos is the default authentication protocol for Active Directory environments. Unlike NTLM, Kerberos uses tickets instead of password hashes for authentication, providing better security and enabling features like delegation.

Kerberos Basics

Kerberos authentication involves three main components:
  • KDC (Key Distribution Center): Domain Controller that issues tickets
  • TGT (Ticket Granting Ticket): Initial ticket obtained after authentication
  • Service Ticket (TGS): Ticket for accessing specific services

Authentication Flow

1

Request TGT

Client sends AS-REQ (Authentication Service Request) to the KDC with user credentials
2

Receive TGT

KDC validates credentials and returns TGT in AS-REP (Authentication Service Reply)
3

Request Service Ticket

Client sends TGS-REQ (Ticket Granting Service Request) with TGT to access a service
4

Receive Service Ticket

KDC returns service ticket in TGS-REP
5

Access Service

Client presents service ticket to target service via AP-REQ

Requesting a TGT

With Password

With NT Hash (Pass-the-Hash)

With AES Key (Pass-the-Key)

Saving and Loading Tickets

Save TGT to ccache File

Load TGT from ccache File

Use Tickets with Scripts

Requesting Service Tickets

Request TGS for Specific Service

Using getTGT.py Script

Using getST.py Script

Kerberos Delegation

S4U2Self: Impersonation

Request a service ticket on behalf of another user:

S4U2Proxy: Constrained Delegation

Request ticket for a different service:

Full S4U Example with getST.py

Constrained delegation requires the service account to have the appropriate delegation rights configured in Active Directory. The target SPN must be in the account’s “msDS-AllowedToDelegateTo” attribute.

Ticket Manipulation

Alter Service Name (SPN)

Change the target service in a ticket:

Golden Ticket Creation

Silver Ticket Creation

Working with ccache Files

Inspect Ticket Contents

Convert Ticket Formats

Programmatic Ticket Inspection

Kerberos Authentication Modes

Authentication with Password

Authentication with ccache

Encryption Types

Kerberos supports multiple encryption algorithms:
Encryption Type Notes:
  • RC4-HMAC: Uses NT hash directly, compatible with older systems
  • AES128/AES256: More secure, requires AES keys
  • Modern Windows systems prefer AES256
  • RC4 is being deprecated but still widely supported

Common Kerberos Errors

KDC_ERR_PREAUTH_FAILED

Invalid credentials:

KDC_ERR_C_PRINCIPAL_UNKNOWN

User doesn’t exist:

KDC_ERR_S_PRINCIPAL_UNKNOWN

Service doesn’t exist:

Practical Examples

Example 1: Complete Authentication Flow

Example 2: Ticket Renewal

Security Considerations

Kerberos Security Best Practices:
  1. Protect TGTs: Ticket Granting Tickets provide access to all services - guard them carefully
  2. Use AES Encryption: Prefer AES256 over RC4 when possible
  3. Enable PAC Validation: Helps prevent Golden Ticket attacks
  4. Monitor Delegation: Audit constrained delegation configurations
  5. Rotate Keys: Regularly change the krbtgt account password
  6. Time Synchronization: Kerberos requires synchronized clocks (within 5 minutes by default)

See Also

Pass-the-Ticket

Reuse Kerberos tickets for authentication

NTLM Auth

Alternative authentication with NTLM