← Home
Kerberos Authentication Flow

How Kerberos Works

Kerberos is the default authentication protocol in Active Directory since Windows 2000. It is a ticket-based system — users authenticate once and receive tokens (tickets) that prove their identity without transmitting their password over the network.

The three key components are: the client (user workstation), the Key Distribution Center (KDC) running on the Domain Controller, and the service the user wants to access. The KDC has two logical sub-services: the Authentication Server (AS) and the Ticket Granting Server (TGS).

  1. AS-REQ — The client sends an Authentication Service Request to the KDC, including its username and a timestamp encrypted with the user's password hash (NTLM hash of the password). This proves the client knows the password without sending it.
  2. AS-REP — The KDC verifies the timestamp, then responds with two things: a Ticket Granting Ticket (TGT) encrypted with the krbtgt account's hash, and a session key encrypted with the user's hash. The client cannot read the TGT — only the KDC can.
  3. TGS-REQ — When the user wants to access a service (e.g. SMB share), the client sends the TGT + a request for a service ticket to the TGS. The client also specifies the target service by its Service Principal Name (SPN).
  4. TGS-REP — The KDC returns a Service Ticket encrypted with the service account's password hash. Again, the client cannot read this ticket — only the target service can.
  5. AP-REQ — The client presents the Service Ticket to the target service. The service decrypts it with its own key, extracts the user's identity, and grants or denies access.
Client KDC (Domain Controller) Service (e.g. SMB) | | | |--- AS-REQ ------------>| | | (username + enc | | | timestamp) | | |<-- AS-REP -------------| | | (TGT + session key) | | | | | |--- TGS-REQ ----------->| | | (TGT + SPN target) | | |<-- TGS-REP ------------| | | (Service Ticket) | | | | | |--- AP-REQ ----------------------------------------> | (Service Ticket) | |<-- AP-REP ---------------------------------------- | (access granted) |
The TGT is valid for 10 hours by default (configurable via GPO). Service tickets are valid for 10 minutes. Attackers who steal a TGT can use it to request service tickets until it expires — this is the basis of Pass the Ticket attacks.
Kerberos is vulnerable when pre-authentication is disabled (AS-REP Roasting), when service accounts have weak passwords (Kerberoasting), or when the krbtgt hash is compromised (Golden Ticket). Modules 04 and 08 cover these attacks.
LDAP Basics

What LDAP Is and How AD Uses It

The Lightweight Directory Access Protocol (LDAP) is the protocol used to query and modify the Active Directory database. Every piece of AD data — users, groups, computers, GPOs, OUs — is stored as an LDAP object and is accessible via LDAP queries.

AD listens on port 389 (LDAP, plaintext) and port 636 (LDAPS, TLS). For enumeration, attackers typically use port 389 since it requires only a valid domain credential (or sometimes no credential at all for anonymous bind on older configurations).

Every object in AD has a Distinguished Name (DN) that describes its full path in the directory tree:

CN=John Smith,OU=Employees,OU=Users,DC=meridianfg,DC=local

LDAP queries use a filter syntax. To search for all users in the domain:

# LDAP filter for all user objects (&(objectClass=user)(objectCategory=person)) # With ldapsearch (from Kali) kali@kali:~$ ldapsearch -x -H ldap://192.168.1.10 -b "DC=meridianfg,DC=local" \ -D "CN=jsmith,OU=Employees,DC=meridianfg,DC=local" -w "Password123" \ "(&(objectClass=user)(objectCategory=person))" sAMAccountName
LDAP is the backbone of all AD enumeration tools. BloodHound, ldapdomaindump, and PowerView all make LDAP queries under the hood. Understanding the raw protocol helps you interpret what these tools collect and craft custom queries when needed.
DNS in Active Directory

Why DNS Is Critical in AD

Active Directory is entirely DNS-dependent. Every domain-joined machine locates services — Domain Controllers, Kerberos, LDAP, global catalog — by querying DNS. Without working DNS, domain functionality breaks entirely.

The Domain Controller also acts as the authoritative DNS server for the domain zone (e.g. meridianfg.local). Key DNS records in a healthy AD environment:

From an attacker's perspective, DNS is a valuable enumeration target. Zone transfers (AXFR), if allowed, expose the full list of hostnames and IPs. Even without zone transfers, standard A/SRV lookups reveal the domain structure.

# Attempt DNS zone transfer (often blocked) kali@kali:~$ dig axfr meridianfg.local @192.168.1.10 # Query for Domain Controllers via SRV records kali@kali:~$ nslookup -type=SRV _ldap._tcp.dc._msdcs.meridianfg.local 192.168.1.10
LLMNR and NBT-NS exist partly as fallback mechanisms when DNS fails. Disabling LLMNR and NBT-NS is a key hardening recommendation — but since many orgs don't do this, it's a reliable attack vector (Module 03).
Trust Relationships

Domain and Forest Trusts

A trust is a relationship between two domains (or forests) that allows authentication to flow across the boundary. Trusts are the attack path between otherwise separate domains — compromising one domain may allow pivoting to a trusted domain.

Transitivity determines whether a trust can be extended through a chain: if A trusts B and B trusts C, a transitive trust means A also trusts C. Most internal AD trusts are transitive.

In penetration tests, always enumerate trusts. A Golden Ticket combined with a forest trust can allow cross-forest compromise if the SID filtering is not correctly configured. Inter-forest attacks are covered in the advanced module extensions.
AD Object Model

Objects, Attributes, and the Schema

Everything in Active Directory is an object — users, groups, computers, OUs, GPOs, contacts, printers. Each object is an instance of a class defined in the AD Schema (a master blueprint for what object types exist and what attributes they can have).

Key object types relevant to pentesting:

The userAccountControl attribute is a bitmask. The flag DONT_REQ_PREAUTH (0x400000) disables Kerberos pre-authentication for that account — making it vulnerable to AS-REP Roasting. Tools like PowerView enumerate this flag automatically.
ACL Overview

Discretionary ACLs and Access Control Entries

Every AD object has a Discretionary ACL (DACL) — a list of Access Control Entries (ACEs) that define which principals (users, groups) have which permissions on that object.

Common ACE rights that are dangerous when misconfigured:

BloodHound maps these ACL relationships as edges in a graph, making it easy to find paths from a low-privilege account to Domain Admin. Understanding the underlying ACE model explains why those paths exist.

ACL abuse is covered in depth in Module 05. For now, the key takeaway is: misconfigured DACL entries on AD objects are as dangerous as misconfigured group memberships. Attackers who can write to another object's DACL can grant themselves any right on that object.