Kerberos Authentication Explained: How Windows Domain Authentication Works

Millions of individuals sit down every day, type a password once, and then open file shares, intranet sites, email and databases without being asked to sign in again. In most Windows settings, Kerberos authentication is the silent engine performing that task.

This book explains how Kerberos authentication works within an Active Directory domain: what a Ticket Granting Ticket is, what the Ticket Granting Service performs, why the Key Distribution Center is at the center of everything, and how attackers have learned to misuse the protocol. If you run Windows servers or are studying for a security certification then this tutorial is for you.

What Is Kerberos Authentication And Why Does Windows Use It?

Kerberos Authentication

Kerberos is a network authentication mechanism developed at MIT in the 80’s as part of Project Athena. It is named after the three-headed dog Cerberus of Greek mythology, and with good reason. Every transaction involves three parties, the client, the service and a trusted third party in the midst. The current version is Kerberos v5, as defined in RFC 4120. Microsoft designated it the default protocol for Active Directory domains in Windows 2000 and later.

The basic premise is straightforward to say. You confirm your identity to one trusted authority and that authority gives you tickets that you can display to other systems. Your password is never transmitted over the network, and the file server or SQL server you connect to never sees it. Kerberos authentication is faster for repeated connections, checks both sides of a conversation, and scales significantly better in big domains than traditional NTLM, which Microsoft is progressively moving away from. It does depend on a few things being perfect though, functional DNS, synchronised clocks (5 minutes of tolerance by default) and a healthy domain controller.

The Role Of The KDC (Key Distribution Center)

That trusted third party is known as the Key Distribution Center, or KDC. It operates on every domain controller in a Windows domain, listens on port 88 and reads from the Active Directory database. It maintains a secret key for each user, computer and service account and those keys are derived from the account passwords. Inside the KDC you have two logical services . One is the Authentication Service ( AS ) , which issues your first ticket . The other is the Ticket Granting Service ( TGS ) , which issues tickets for particular resources .

One story is of special note. Each domain has a built-in account called krbtgt. The account’s secret key is used to encrypt and sign every Ticket Granting Ticket the domain produces. No one signs in as krbtgt, but whomever takes its key can issue tickets to anybody. This is why the KDC is the crown gem of Kerberos authentication, and why domain controllers demand stricter protection than just about anything else on the network.

What Is A Ticket Granting Ticket (TGT) ?

After your first successful sign in , you get a proof of login called a Ticket Granting Ticket . Think of it as a festival wristband. You show ID at the gate once and then the wristband lets you inside all the stages with no additional inspections. The TGT includes your identification, a session key, a validity period, and some authorisation data called the Privilege Attribute Certificate (PAC) which lists your group memberships. It is encrypted with the krbtgt key, so it cannot be read or altered. You just put it on.”

A windows TGT by default is valid for 10 hours and renewable for up to 7 days. Both can be changed by Group Policy . Shorter lives imply stolen tickets expire faster . Most of the Kerberos authentication process, including the TGT, resides in workstation memory, and that’s precisely where credential-theft programs go hunting.

What Is The Ticket Granting Service (TGS)?

Kerberos Authentication

The Ticket Granting Service is the part of the KDC that sells you access to individual resources. When you open a finance share on a file server, it does not re-log you into your machine. It presents the TGT to the TGS and requests a service ticket for that specific service identified by its Service Principal Name (SPN), e.g. cifs/fileserver.corp.local. The TGS verifies the TGT and delivers a service ticket encrypted with the key of the service account you want to use, not your own. Only that service may unseal it.

This separation enables single sign-on via Kerberos authentication. One TGT provides you with multiple service tickets, each service ticket limited to one service. The server never needs to call the domain controller to see about you. It decrypts the ticket with its own key, reads the PAC and decides what you may do.

Kerberos Authentication Flow, Step By Step

The whole Kerberos authentication exchange is six messages long, and it helps to follow them in order.

It starts with the AS-REQ

When you log in, your computer tells the KDC your name. If pre-authentication is enabled (which it is by default), the request additionally contains a timestamp encrypted with a key derived from your password. That shows you know the password without ever sending it.

Then follows the AS-REP

The KDC uses your saved key to decrypt the timestamp and if all looks good, it sends you your TGT and a session key (wrapped in such a way that only you can open it).

TGS-REQ

When you later need a resource, your machine transmits the TGT along with an authenticator (a fresh timestamp encrypted with the session key) and names the SPN it wishes to contact.

TGS-REP

The KDC authenticates both things and issues a service ticket and a new session key to talk to that service.

AP-REQ

Your machine sends the service ticket and another authenticator to the destination server. The server then uses its own key to decode the ticket, checks the authenticator and creates an access token from the PAC.

The last is the AP-REP. It is optional, but it is common. The server responds with a message saying it’s real too, thus you have mutual authentication.

Common Kerberos Authentication Attacks

Kerberos authentication is cryptographically secure but the real world is messy and attackers will target the weak places surrounding it.

Kerberoasting is the most popular one. Any domain user that is authenticated can ask for a service ticket for any SPN. Part of that ticket is encrypted with a key derived from the service account’s password, so an attacker can take it offline and guess passwords at their leisure with no lockouts and very little noise. Service accounts easily crack old and weak passwords. AS-REP roasting is a close cousin: if an account has “Do not require Kerberos preauthentication” checked, anyone can request an AS-REP for it and crack the encrypted section offline.

Worst case scenario is the Golden Ticket. With the krbtgt key, an attacker can forge TGTs for any user, with any group membership and practically any lifetime. Forged tickets come from the KDC, so they’ll seem legit.” Recovery is to reset the krbtgt password twice. Silver Ticket does a similar method, but on a smaller scale: given one service account’s key, the attacker forges service tickets just for that service, never touching the KDC, which makes it harder to detect.

And last we have pass-the-ticket and delegated abuses Tickets stolen from memory can be replayed from another computer until they expire. Misconfigured delegation, especially unrestrained delegation, allows a compromised server to impersonate users to other services. MITRE ATT&CK categorises the majority of these actions under technique T1558.

How To Defend Kerberos Authentication In Your Domain?

Kerberos Authentication

Hardening Kerberos authentication is largely good hygiene. Use large random passwords for service accounts, 25 characters or more. Even better, use group Managed Service Accounts and Windows will rotate them for you. Implement AES encryption and deprecate RC4. Ensure that the number of accounts with pre-authentication turned off is zero. Change the krbtgt password regularly and after any suspected compromise. Place privileged users in the Protected Users group and limit delegation wherever possible.

Then check logs. A burst of 4769 events employing RC4 encryption (type 0x17) is the classic Kerberoasting tell, with event IDs 4768, 4769 and 4771 logging ticket requests and failures. The identity controls in NIST SP 800-53 and the OWASP Authentication Cheat Sheet indicate the same way: solid credentials, least privilege and appropriate logging.

Real-Life Examples

MS14-068, a Kerberos Authentication Bug (CVE-2014-6324)

In November 2014, Microsoft provided an emergency out-of-band patch for a vulnerability in the way domain controllers validated the PAC inside a ticket. The KDC accepted a signature method of the client’s choice, which led to an ordinary domain user forging a PAC claiming membership of Domain Admins. Microsoft classified this critical and claimed it has encountered limited, targeted attacks before the update. The takeaway is clear: patch your domain controllers faster than any other server.

noPac, Another Kerberos Authentication Bug (CVE-2021-42278 and CVE-2021-42287)

NoPac was linked two bugs patched in Nov 2021. A normal user can create up to 10 machine accounts by default. The attacker generated one, renamed it to a domain controller name without the trailing dollar sign, requested a TGT, then renamed it back. When the attacker next requested a service ticket, the KDC could not detect that account, appended the dollar sign, and submitted a ticket as the true domain controller. The door is closed by applying the patches and setting MachineAccountQuota to zero.

Conclusion

Kerberos authentication is elegant , it uses one login , short-lived tickets and a trusted authority in the middle . It has been protecting Windows networks for over two decades . The problem is not the cryptography, but the bad service passwords, and unpatched domain controllers. If you learn about the TGT, the TGS and the KDC, you will know where to look when Kerberos authentication goes awry.

Frequently Asked Questions

1. What Is Kerberos Authentication In Simple English?

Kerberos is a ticket-based authentication system that allows you to prove who you are on a network. You sign in once, and a trusted server called the KDC provides you a ticket, and then you display that ticket to other services instead of sending your password over and over.

2. What distinguishes a TGT ticket from a TGS ticket in Kerberos authentication?

The TGT indicates that you have logged in . It is solely used to request more tickets from the KDC . A TGS ticket is sometimes called a service ticket, because it is issued for a certain service. This is what you really offer to a file server, database or website.

3. Why does Kerberos authentication require synchronised clocks?

Tickets and authenticators have timestamps so captured messages cannot be replayed later. If the machine clock is more than 5 minutes out of sync with the domain controller clock (the default setting in Windows), requests are denied and the user gets a logon error.

4. Is Kerberos better than NTLM authentication?

Yes, for most purposes. Kerberos offers mutual authentication, does not send password hashes in the exchange and allows delegation. NTLM is older and simpler to transmit, thus Microsoft is slowly phasing it out for organisations.

5. How can I detect Kerberoasting in Kerberos authentication logs?

Look for anomalous volumes of Event ID 4769 from a single account, especially requests for several different SPNs utilising RC4 encryption. Another cheap and effective tripwire is honeypot service accounts with enticing names.

Try Our Tools

It’s a good start to read about identity security, but hands-on practice is what stays. We have a free tools page with useful utilities for anyone who care about security, networking and everyday technology. They’re all designed to save you time and make it easy to test difficult ideas for yourself.

References

  1. Microsoft Learn: Windows Server Kerberos overview
  2. OWASP Cheat Sheet Series: Authentication Cheat Sheet
  3. NIST: SP 800-53 Rev. 5, Security and Privacy Controls for Information Systems and Organizations
  4. Google Cloud: Managed Service for Microsoft Active Directory overview
  5. MITRE ATT&CK: T1558, Steal or Forge Kerberos Tickets

If you want more technology, cybersecurity and digital-security ideas, head on over to ExplainMeTech.com and see our latest guides, tools and insights.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top