Skip to main content
NTLM, Kerberos & Active Directory Authentication Flows
Lesson 10 of 12

NTLM, Kerberos & Active Directory Authentication Flows

Trace NTLM challenge-response and Kerberos ticket exchanges in Active Directory, inspect cached tickets and security events, and mitigate relay and offline cracking risks.

Advanced 32 min Linux & Windows
Authorised environments only — The techniques described here are used only in training labs and on systems you own or have written permission to test.

Learning objectives

  • Trace the NTLM challenge-response handshake and Kerberos AS/TGS ticket exchanges step by step
  • Inspect cached Kerberos tickets, flags, and encryption types on Windows using klist and Security logs
  • Explain the preconditions behind NTLM relaying, AS-REP roasting, and Kerberoasting
  • Apply defensive controls including SMB signing, Extended Protection for Authentication, AES enforcement, and gMSAs

Recommended first: Windows Security Architecture, CLI, Registry & ServicesWindows Security Auditing & Sysmon Telemetry

#Why this matters

Every time a user opens a file share, queries a database, or signs in to an internal portal in Active Directory (AD), the client and server must prove identity over the network. Windows supports two main protocols for this: Kerberos (preferred when contacting domain resources by hostname) and NTLM (the fallback when Kerberos cannot locate a Service Principal Name or legacy applications require it).

Understanding how tickets and hashes move across the wire is essential for defenders and authorised testers. Most domain-escalation paths do not rely on memory-corruption exploits; instead, they abuse legitimate protocol mechanics such as missing SMB signing, weak service account passwords, or NTLM fallback.

#NTLM challenge-response and relay exposure

NTLM is a stateless, connection-oriented challenge-response protocol carried inside protocols such as SMB, HTTP, and LDAP. Unlike Kerberos, the client does not contact the Domain Controller (DC) directly. Instead, the application server proxies validation back to a DC over Netlogon.

NTLM three-message authentication flowNTLM three-message authentication flowClientServerDCType 1 (Negotiate flags)Type 2 (8-byte Challenge)Type 3 (Username + NTLMv2 Response)Netlogon Pass-Through VerifyLogon Success or FailureNo mutual authentication of the server

In modern Windows (NTLMv2), the client combines the user's NT hash (an MD4 digest of the UTF-16LE password) with the server's 8-byte challenge, a client nonce, and timestamp data using HMAC-MD5. Legacy NTLMv1 uses weaker DES-based cryptography and should always be blocked by policy.

Even with NTLMv2, NTLM does not natively authenticate the server. If an attacker receives an incoming NTLM Type 1/Type 3 exchange (for example, from a mistyped share or coerced outbound SMB/HTTP request), they can forward those messages in real time to another target such as an SMB share or LDAP server. This is an NTLM relay.

Two defences stop relaying per protocol:

  • Message signing (SMB signing or LDAP signing), requiring packets to be signed with a session key the relayer lacks.
  • Channel binding / Extended Protection for Authentication (EPA) on HTTPS and LDAPS, binding the NTLM exchange to the outer TLS server certificate.

#Kerberos ticket exchange in Active Directory

Kerberos is a ticket-based protocol running on TCP and UDP port 88 that provides mutual authentication without sending passwords or password-derived responses directly to application servers. The Domain Controller acts as the Key Distribution Center (KDC), running two logical services: the Authentication Service (AS) and the Ticket-Granting Service (TGS).

Kerberos AS and TGS exchangeKerberos AS and TGS exchangeClientKDC (AS)KDC (TGS)AppServerAS-REQ (User ID + encrypted timestamp)AS-REP (TGT encrypted with krbtgt + session key)TGS-REQ (TGT + Authenticator + Target SPN)TGS-REP (Service Ticket encrypted with service key)AP-REQ (Service Ticket + Authenticator)AppServer decrypts ticket using its own long-term key

The exchange proceeds in three distinct phases:

  1. Initial authentication (AS-REQ / AS-REP): By default, the client proves its identity via Kerberos pre-authentication, encrypting a current timestamp with a key derived from the user's password. If valid, the AS returns a Ticket-Granting Ticket (TGT) encrypted with the krbtgt account's secret key, plus a session key encrypted for the client.
  2. Service ticket request (TGS-REQ / TGS-REP): To reach a service such as cifs/fs01.lab.local, the client sends its TGT and the target Service Principal Name (SPN) to the TGS. The TGS does not check whether the user is authorised on fs01; it simply mints a Service Ticket encrypted with the target service account's long-term key.
  3. Service presentation (AP-REQ): The client sends the Service Ticket to fs01.lab.local. Because fs01 shares its long-term key only with the KDC, it decrypts the ticket locally without asking the DC, then evaluates local ACLs using the Privilege Attribute Certificate (PAC) embedded inside.

You can inspect cached tickets in your Windows logon session with klist:

Inspecting cached Kerberos tickets on a lab host
$ klist

Current LogonId is 0:0x4a2f1

Cached Tickets: (2)

#0>     Client: student01 @ LAB.LOCAL
        Server: krbtgt/LAB.LOCAL @ LAB.LOCAL
        KerbTicket Encryption Type: AES-256-CTS-HMAC-SHA1-96
        Ticket Flags 0x40e10000 -> forwardable renewable initial pre_authent
        Start Time: 11/19/2026 9:05:12 (local)
        End Time:   11/19/2026 19:05:12 (local)

#1>     Client: student01 @ LAB.LOCAL
        Server: cifs/fs01.lab.local @ LAB.LOCAL
        KerbTicket Encryption Type: AES-256-CTS-HMAC-SHA1-96
        Ticket Flags 0x40a50000 -> forwardable renewable pre_authent

Notice KerbTicket Encryption Type. Modern domains should negotiate AES-256-CTS-HMAC-SHA1-96 (0x12) or AES-128-CTS-HMAC-SHA1-96 (0x11). Seeing RSADSI RC4-HMAC(NT) (0x17) signals legacy downgrade or weak account configuration.

#Ticket-based risks: AS-REP roasting and Kerberoasting

Because Kerberos encrypts ticket material with account-derived keys, misconfigured accounts let attackers shift password guessing offline, away from DC lockout thresholds.

Technique Precondition Why offline guessing works Primary detection signal
NTLM Relay NTLM allowed and signing or EPA missing Attacker forwards real-time Type 3 response Unexpected NTLM logons (4624) to sensitive hosts
AS-REP Roasting Account has pre-authentication disabled Anyone can request an AS-REP encrypted with user key Event 4768 without pre-auth or 0x17 cipher
Kerberoasting User-managed account holds an SPN Any domain user can request a TGS encrypted with service key Burst of Event 4769 with encryption 0x17

In AS-REP roasting, an administrator disables "Kerberos pre-authentication" on a user account. Any unauthenticated sender on the network can send an AS-REQ for that username and receive an AS-REP containing a component encrypted with the user's key, which can then be tested offline.

In Kerberoasting, any authenticated domain user requests service tickets (TGS-REQ) for accounts that have an SPN registered (for example, MSSQLSvc/db01.lab.local:1433). Because the KDC encrypts the Service Ticket using the service account's password-derived key, an attacker who obtains the ticket in memory (using built-in APIs or auditing tools like Rubeus) can attempt offline guessing against it. Machine accounts and Group Managed Service Accounts (gMSAs) use long, randomly generated 120-byte passwords, making offline guessing infeasible. Human-managed service accounts with static 10-character passwords and RC4 encryption are the classic weak link.

#Defending and common mistakes

Hardening AD authentication closes both downgrade paths and weak-credential exposures:

  • Enforce signing and channel binding: Require SMB signing everywhere, enable LDAP signing and channel binding (LdapEnforceChannelBinding), and enable EPA on AD CS web enrollment and IIS.
  • Eliminate NTLMv1 and audit NTLM: Set LAN Manager authentication level to Send NTLMv2 response only. Refuse LM & NTLM, and audit NTLM traffic before restricting outbound NTLM.
  • Use gMSAs and enforce AES: Migrate SPN accounts to gMSAs for automatic 120-byte random password rotation, and disable RC4 (0x17) where compatible.
  • Keep pre-authentication enabled: Audit AD regularly so no accounts have DONT_REQ_PREAUTH set.

Common mistakes include accessing shares by IP address (forcing NTLM fallback), leaving RC4 enabled domain-wide for one legacy appliance, and rotating user passwords while ignoring static service account passwords.

#Summary

Active Directory relies on Kerberos for mutual, ticket-based authentication and falls back to NTLM challenge-response when SPNs are unavailable or legacy clients connect. Without SMB signing, LDAP signing, or channel binding, NTLM exchanges can be relayed in real time to other hosts. Kerberos prevents credential forwarding, but disabling pre-authentication or assigning human-chosen passwords and RC4 keys to SPN-bearing accounts enables offline password guessing via AS-REP roasting and Kerberoasting. Enforcing signing, AES-only Kerberos, and gMSAs removes these structural weaknesses.

Knowledge check

Sign in to take the test, complete lessons and save your progress. Log in

Practice: test your knowledge