Skip to content

Interview PrepDirectories · Advanced

Kerberos and Windows Authentication ​

144. What is Kerberos, and how does it work at a high level? ​

The short answer

Kerberos is a network login protocol, created at MIT in the 1980s and the default in Windows domains, that lets you prove who you are to many services without ever sending your password over the network. A trusted server, the Key Distribution Center, which in AD is the domain controller, gives you a ticket-granting ticket when you log in. When you want a service, such as a file share, you show that ticket to the KDC and get a service ticket for that one service. You show the service ticket to the service, which checks it with its own key. Tickets expire, typically after 10 hours.

Asha's PCticket cachedomain controller: KDCauthentication serviceticket-granting servicefile serverhas its own key① sign in② TGT③ TGT + "file server"④ service ticket⑤ service ticket⑥ server decrypts it with its own key: no call to the DC
A wristband, then ride tickets. ① and ② Logging in once gets a ticket-granting ticket, like a wristband at a fair. ③ and ④ Each service needs its own ticket, which the KDC issues on sight of the wristband. ⑤ and ⑥ The service checks the ticket with its own secret key. The password never crosses the network.

Why it works without sending the password. Every user and service shares a secret key with the KDC: for users, derived from their password; for services, a random key. The KDC encrypts each answer so that only the intended party can open it. A ticket for the file server is locked with the file server's key, so only the real file server can read it, and only the KDC could have made it.

What depends on it:

NeedWhy
Clocks within 5 minutesTickets carry timestamps to stop replay
DNS workingClients find the KDC and name services through DNS
Service principal names (SPNs)Each service is registered by name, such as HTTP/intranet.acme.example

Attacks to know by name. Kerberoasting: any user can request service tickets, and a ticket for a service account with a weak password can be cracked offline, so service accounts need long random passwords or managed accounts. Golden ticket: with the KDC's own key, an attacker can forge tickets for anyone.

145. What is NTLM? ​

The short answer

NTLM, NT LAN Manager, is Windows' older challenge-response login protocol. The server sends a random challenge, the client answers with a value computed from the challenge and the hash of the user's password, and the server, or the domain controller for it, checks the answer. It works without a KDC, which is why it is still the fallback when Kerberos cannot be used, for example when connecting by IP address. It is weak: the password hash itself works as a password, so attackers can pass the hash or relay NTLM logins to other servers. Microsoft has deprecated it and is removing it step by step.

KerberosNTLM
DesignTickets from a trusted KDCChallenge and response per connection
Mutual authenticationYes, the client also verifies the serverNo
Password hash usable as a passwordNoYes, pass the hash
Relay attacksHardA long series of real attacks
Works by IP address, outside a domainNot normallyYes
StatusDefaultDeprecated; NTLMv1 removed in recent Windows

What to do as an engineer: make apps and services use Kerberos, register their service principal names, audit NTLM use with Windows' logging, require SMB and LDAP signing so relays fail, and block NTLM where audits show it is unused.

146. How do Kerberos and LDAP differ? ​

The short answer

They do different jobs. Kerberos is for authentication: proving who you are and getting tickets for services, without sending passwords. LDAP is for directory access: looking up and changing information about users, groups and computers. In Active Directory they work together: Kerberos logs you in, and LDAP is how Windows and apps read your groups and attributes. An LDAP connection can itself be authenticated with Kerberos, through a SASL bind called GSSAPI, which is better than a simple bind with a password.

KerberosLDAP
PurposeAuthentication, SSO inside the networkReading and changing directory data
Question it answersIs this really Asha?What groups is Asha in?
Port88389, 636
Carries passwordsNever over the networkA simple bind does; use TLS
OutputTicketsDirectory entries

147. How does Windows authentication work? ​

The short answer

When you sign in to a domain-joined Windows PC, the local security service, LSASS, sends your credentials, protected with a key from your password or from Windows Hello's device key, to a domain controller using Kerberos, and gets a ticket-granting ticket. Windows builds an access token listing your user ID and all your group IDs. Every file, folder and printer has an access control list, and Windows compares your token against it. When you open a file share or an intranet site, Windows silently gets a Kerberos service ticket for it, so you are never asked for a password again. That is Integrated Windows Authentication.

From sign-in to opening a file share:

  1. Sign in. You type a password or use Windows Hello. LSASS authenticates you to a domain controller with Kerberos and receives a TGT.
  2. Access token. Windows builds a token with your security identifier and the identifiers of every group you belong to.
  3. Open \\files\finance. Windows asks the domain controller for a service ticket for the file server and presents it. You type nothing.
  4. Authorisation. The file server reads your groups from the ticket and checks them against the folder's access control list.
  5. Intranet website. A browser on the same PC can do the same with Negotiate authentication, sending a Kerberos ticket in an Authorization header to sites in the trusted intranet zone.
  6. Fallback. If Kerberos fails, for example because there is no service principal name, Windows may fall back to NTLM (question 145).

Windows Hello for Business replaces the password at step 1 with a key pair held in the PC's TPM chip and unlocked by face, fingerprint or PIN, much like a passkey, so there is no reusable password to steal.

Cloud sign-in. On a PC joined to Microsoft Entra ID, the same sign-in also gets a Primary Refresh Token from Entra ID, which gives silent SSO to Microsoft 365 and cloud apps, in the same way the TGT gives SSO to on-premises services.

Combine chapters into one PDF

Pick the chapters you want. They print in the order you pick them.

Interview Prep
Authentication & Identity
Cookies & sessions
Authentication
Tokens
OAuth & OIDC
Enterprise SSO
Directories
Authorization
Other topics
Nothing picked yet