Kerberos Unmasked: How a Castle, a Key, and a Ticket Keep Your Enterprise's Network Safe

Kerberos Unmasked: How a Castle, a Key, and a Ticket Keep Your Enterprise's Network Safe


?? DISCLAIMER ??

  1. This is NOT for the tech geniuses out there. If you're expecting mind-bending cryptographic deep dives, RFC dumps, or spaceship-looking network diagrams—sorry, wrong place. This is a basic, low-level explanation of Kerberos, made for people like me who just want to "get it" without frying their brain. That said... this isn’t for complete beginners either.
  2. Kerberos ≠ Federated SSO. Don't mix this up with all those fancy SaaS authentication thingies like SAML, OAuth, or OpenID. Those are for web apps and cloud services. Kerberos lives in the internal network world (the old-school office kind).


Prerequisites

To follow along, it helps if you have at least a basic understanding of:

? Networking (What a server and a client are).

? User authentication (Logging in with usernames & passwords).

? Active Directory (AD) basics (Very high-level, just knowing it exists).

? Basic encryption concepts (The idea that data can be "locked" and "unlocked" for security).

? You do NOT need to be a cryptography expert.

? You do NOT need to configure AD or manage Kerberos in production.


Well, I know you’re probably familiar with the formal definition of Kerberos, so let’s cut to the chase and break it down in a way that actually makes sense to normal humans. But before diving into the details, let’s rewind to a time when Kerberos was still in its infancy; because, trust me, "The Beginning" might be the only part of history that won’t put you to sleep.

The Beginning

In the early 1980s, MIT launched Project Athena, an ambitious initiative aimed at creating a distributed computing environment for students and researchers. But a major problem quickly emerged: how do you securely authenticate users across a growing network without exposing passwords over and over again?

A small team, including Steve Miller and Clifford Neuman, took on the challenge under the guidance of Jerome Saltzer. Inspired by the three-headed dog of Greek mythology, they developed Kerberos, a revolutionary authentication protocol. By using tickets and encryption, Kerberos allowed users to log in once (Single Sign-On) and securely access multiple systems without constantly re-entering credentials.

Originally built to solve MIT’s internal security concerns, Kerberos quickly gained widespread recognition for its robust security and efficiency. By the late 1980s, it had been adopted by universities, enterprises, and eventually integrated into Microsoft Windows. Like its mythological namesake, Kerberos became the guardian of modern authentication, protecting networks from intruders.


Now, Let’s Get Real

Alright, history lesson aside; FIRST, let’s imagine a day without Kerberos from the perspective of an organization or an enterprise.

Here’s what life without Kerberos would look like. Buckle up.

Morning: Logging into Your Computer

You come into the office and boot up your computer. The first thing you do is type in your username and password to log in (like the first login screen you get when you boot your machine... You get that? ). Sounds simple, right? But here’s the catch:

  1. Every service requires a new login: Your computer doesn’t have a way to store this information securely. So this login doesn’t grant you access to anything else; you’ll have to re-enter credentials for every single service you use.
  2. No Single Sign-On (SSO): The system doesn’t trust that once you’ve logged in, it’s really you who will be accessing the services. So, the burden is on you to repeatedly prove your identity.

First Task: Checking Email

You click on your email client (like say MS Outlook). But guess what? The email server has no idea who you are. It pops up a login screen:

Username: [Enter manually]

Password: [Type it again]

By now, you’re already thinking, “Did I type the password wrong?” because the keyboard is a little sticky. After a couple of failed attempts, you finally get in.


Second Task: Accessing Shared Files

Your manager needs you to grab a file from the shared drive. You open your file explorer and navigate to the shared folder. Boom!!! a new login prompt appears:

  • Username: [Again? Didn’t I just do this for email?]
  • Password: [Oh no, caps lock was on…]

This shared drive is on a different server, so your computer treats it as a completely separate system. It doesn’t care that you already logged in earlier. Frustrated, you re-enter your credentials, trying to avoid typos. By now, you’ve wasted a few minutes just getting access to basic resources.


Third Task: Printing a Document

You need to print the file you downloaded from the shared drive. But here’s the kicker; the printer is also on the network, which means another login prompt:

  • Username: [Ugh, here we go again.]
  • Password: [Wait… which password? The one for email or the shared drive?]

If you accidentally mix up passwords, you might get locked out, and now you have to call IT. They’ll reset your account, and you’ll need to create a new password. Oh, and let’s not forget:

  • Password requirements are strict: Like minimum 12 characters, a mix of uppercase, lowercase, symbols, and numbers etc.
  • You have to change your password every, say, 60 days.

Printing something as simple as one file feels like climbing a bureaucratic mountain.


Midday: Intranet Applications

Your company uses an internal website (intranet) for announcements, policies, and HR tasks. You try to log in to check your vacation days, but—surprise! Another login prompt. The system doesn’t care that you already authenticated multiple times today.

By now, you’ve typed your credentials so many times that you’ve memorized every keystroke. Unfortunately, this muscle memory also increases the risk of making habitual mistakes:

  1. Writing down passwords: Employees start sticking Post-it notes with passwords on their monitors because they’re sick of remembering them.
  2. Reusing passwords: People use the same password everywhere, making it easier for hackers to compromise multiple systems if they steal just one password.


Afternoon: IT Panic

Around 3 PM, IT sends out an urgent email: “Phishing Alert! Do NOT enter your credentials on fake login screens.” You realize this is a real problem because:

  • You’ve already seen so many login prompts today that you can’t always tell which ones are legitimate.
  • Cyber criminals can set up fake login pages to steal passwords, knowing employees are used to entering credentials everywhere.

In this era, passwords are flying around everywhere. They’re sent across the network in plain text or weakly encrypted forms. This makes it ridiculously easy for hackers to intercept and steal them using basic tools like network sniffers.


Evening: Logging Out

At the end of the day, you close your computer, thinking your struggles are over. But wait, IT just announced that you need to change your password by tomorrow morning because of a potential security breach. You groan because:

  1. You’ll need to remember this new password across all the services you use.
  2. Tomorrow, you’ll spend half the day figuring out which systems still remember your old password and updating them one by one.


Why Was This So Bad?

Without a system like Kerberos, authentication is a nightmare:

  1. Too many passwords: Employees had to juggle multiple credentials for different systems, leading to poor security practices like weak passwords or writing them down.
  2. Repetition and inefficiency: Every interaction with a network service required separate authentication, wasting valuable time.
  3. Increased risk of breaches: Passwords were often sent over the network in insecure ways, making them easy targets for attackers.
  4. Lack of centralized management: IT teams had no efficient way to revoke access if an employee left the company or to enforce security policies across the board.


Enter the Realm of Kerberos: Now We Talking...

Kerberos was designed to fix all of these problems. With Kerberos:

  1. You log in once, and the system gives you a "ticket" to access everything else securely.
  2. You don’t have to re-enter your password for every service; it’s all handled automatically behind the scenes.
  3. Passwords are never sent over the network after the initial login, reducing the risk of interception.

Kerberos Analogy

Now, if this is still a bit hard to follow, let me make it even simpler (for dummies like me… yeah, yeah, I know).

Imagine a massive castle with multiple rooms, each containing valuable treasures. These treasures are only accessible to those with permission.

One fine day, there’s a grand event, and hundreds of people want to enter the castle and explore its rooms. But there’s a problem; the guards at the gate are extremely strict. They can’t allow strangers or imposters inside, but at the same time, they don’t want to waste time checking everyone’s identity every time they enter another room.

So, the castle uses a brilliant system: magic tickets.

  • These tickets prove who you are, what rooms you’re allowed to enter, and how long you can stay.
  • The guards check your identity only once at the main gate.
  • After that, you can roam freely, showing your magic ticket at each room’s entrance.
  • The system ensures that your ticket is uniquely tied to you, meaning no one else can steal or fake it.


So, how can you relate this scenario to Kerberos? (Don't worry about the technical key words, It will make sense as you read along)

  • The castle = The network (enterprise systems).
  • The rooms = Different services (file servers, printer servers, databases).
  • The guards at the gate = The Key Distribution Center (KDC).
  • The magic ticket = Your Kerberos Ticket Granting Ticket (TGT) + Service Tickets.
  • No need for re-checking passwords every time = Single Sign-On (SSO).


NOW, LETS GET INTO THE MAIN STUFF...

What Is Kerberos? (Technically...)

Kerberos is like the ticket system in the castle; it’s a secure method of authenticating who you are in a network. It ensures that:

  1. You are who you say you are.
  2. You’re only allowed to access what you’re supposed to.
  3. It does this without constantly asking for your password every time you access a new resource.

It’s like a bouncer for the digital world, designed to protect sensitive systems and services while making life easier for users.


Well... When Would You Use Kerberos?

Now imagine you’re in a company network (think of the castle). Each employee needs access to resources like email, shared files, printers, or servers. You don’t want employees to repeatedly enter their passwords every time they access a new service (Remember the struggles we went through during the life of an employee without Kerberos above somewhere? yess...).

Kerberos comes in handy when:

  • You’re in an enterprise environment with many systems or servers.
  • You need a centralized way to authenticate users securely.
  • You want to prevent constant password use to minimize risks like password theft.
  • You need to allow employees to log in once (Single Sign-On) and then access multiple services seamlessly.

Think of Kerberos as a trusted mediator between you (the user) and the services you want to use.

AGAIN, PLS DO NOT CONFUSE THIS WITH FEDERATED SSOs. Kerberos is NOT the same as Federated SSO. It doesn’t handle web app authentication or cloud-based login systems. Kerberos is strictly for internal network environments (at least, to the best of my knowledge at the time of writing this article).


Where Does Kerberos Work?

Kerberos works best in environments like:

  • Corporate networks: Where employees need secure access to internal tools.
  • Datacenters: To control access to critical servers and applications.
  • Universities or large organizations: Where users need to access shared resources like libraries, labs, or course materials.

Kerberos is a common component in systems like Windows Active Directory, where it’s the backbone of authentication.


Why Kerberos?

Traditional authentication systems would require a user to enter their password every time they access a service. But this is:

  • Insecure: Passwords can be stolen during transmission.
  • Inconvenient: Users hate typing passwords repeatedly.
  • Inefficient: Servers get bogged down checking passwords constantly.

Kerberos solves this by:

  1. Using a "ticket" system to avoid re-authentication.
  2. Encrypting communications to ensure security.
  3. Minimizing password exposure.

It’s like having a passport for your network; proving your identity without constantly showing private details.


Who Uses Kerberos, and Whom Does It Protect?

Who uses it?

  • Companies running systems like Windows Active Directory, Linux servers, or even cloud platforms often use Kerberos for INTERNAL authentication.

Whom does it protect?

  • Employees, administrators, and the organization’s sensitive resources. It ensures only the right people can access what they’re supposed to.


How Does Kerberos Work? (Simplified)

Let’s go back to the castle analogy:

  1. You (the user) arrive at the castle gate (say Windows login screen and type in your credentials).
  2. The gatekeeper (Key Distribution Center) gives you a "ticket to roam."
  3. You want to enter a specific room (services like file share server, printer, fax etc).
  4. You show the ticket to the room’s guard (say File Share service).

The beauty? Once you get the initial ticket, the system takes care of the rest. No passwords are sent around after that.


"Aha! This Is When I Need Kerberos" - Moment

You’ll know you need Kerberos when:

  1. You have a complex network (within your organization) with multiple systems or services requiring authentication.
  2. You need to securely manage user access without constantly exposing passwords.
  3. You want Single Sign-On (SSO)—users log in once and access everything they need.
  4. You’re setting up a Windows domain or a Linux environment where centralized authentication is needed.


Now that you have a fair idea about the little details, let’s dive a bit deeper into how things work behind the scenes. I’ll break it down step by step.

Let’s visualize a basic enterprise scenario; nothing too complex. Imagine a work PC connected to a central server that handles user authentication when logging into the machine. This central system is called Active Directory (AD).

Within AD, there are Kerberos components such as the Authentication Server (AS) and Ticket Granting Server (TGS), which manage secure authentication.

Important Note: AD runs thousands of services, and Kerberos is just one small part of the big picture. It plays a key role in authentication, but AD handles much more than just Kerberos.

And one more thing before we dive deep. "Kerberos" is not just one service or one component that doing all this work. To function properly, Kerberos has multiple players that work together like a team:


Kerberos Components

Now its time for a walk-through. Also, keep in mind, you might want to refer the above table to keep you in track if you get kinda lost in the Acronyms I mentioned below. That being said, lets try to understand the work flow of how Kerberos system works. So, we have a user getting ready for their day at the work place.

Step 1: The staff or employee sits in front of their work PC and start typing the credentials (Username and Password)



Step 2: User click "Enter" or "Login" button to send the credential to the server where KDC (refer the Kerberos components table above if you are getting lost) service is running. The client machine does not send the plaintext password to the AS. Instead, the client hashes the password and uses it to encrypt a timestamp (e.g., 2022-01-30T14:00:00). Now visualize the user credentials i.e. the username and encrypted timestamp (using the password-derived hash) passing through the wires towards the Active Directory server.

Message Sent to AS:

Username: Kimposhible

Encrypted Timestamp: {2022-01-30T14:00:00 encrypted with (Password Hash)}


Step 3: The AS checks AD to verify the username (Kimposhible) exists. AD does not store plaintext passwords instead, it stores a hash of Kimposhible’s password. Then the AS retrieves the password hash of the user from Active Directory. The AS uses this stored password hash to decrypt the timestamp. If decryption is successful, the AS gets a valid timestamp (i.e as mentioned before, 2022-01-30T14:00:00). If decryption fails, it means the user entered the wrong password because the encryption key was incorrect.

If the timestamp is within an acceptable range (e.g., ±5 minutes), the AS assumes:

  • The user knows the correct password (because only the correct password would have produced a decryptable timestamp).
  • The request is fresh (to prevent replay attacks).

If authentication succeeds, the AS creates a Ticket Granting Ticket (TGT). The TGT is encrypted with the KDC’s secret key (so only the TGS can read it). The AS sends the TGT back to Kimposhible’s computer.

Once Kimposhible's computer get the TGT, it then stores the TGT in main memory (RAM) in the Kerberos ticket cache.

Credential Authentication and issuing TGT


Step 4: Now, that Kimposhible is logged into their machine, they are ready to start the day and address their day-to-day responsibilities. As they progress, for example the user might want to access a file server, print server, database, etc. for this to work, their computer sends the TGT + Authenticator to the Ticket Granting Server (TGS).


Summary of what is inside the TGT and Authenticator


Why Does Kerberos Use Both the TGT and Authenticator?

  • TGT proves that AS has already authenticated the user.
  • Authenticator proves that the request is fresh and coming from the user in real-time (see the timestamp in the Authenticator column from above table).
  • TGS decrypts both to validate authenticity and prevent replay attacks.



Step 5: If the TGT is valid, the TGS creates a Service Ticket for the requested resource. The TGS uses the Service Principal Key (SPK) to encrypt the Service Ticket before sending it to the client.


Now the question comes, what is SPK? What is Service Ticket? How is they created? What does it contain? Well, if your curiosity hits, then lets dive into that...

Service Principal Key (SPK): Every Kerberos-enabled service (e.g., file servers, print servers, databases) must have a secret key to decrypt our fancy Service Tickets. This key is called the Service Principal Key (SPK) and is stored in the Keytab file on the service’s machine (both AD and Servers).

What happens here is that, whenever a File Server, Print Server, or Database joins the Active Directory domain, it receives a copy of its SPK. This SPK is then stored locally into the respective servers(like print server, file server etc.) so the service can decrypt the Service Tickets when the user's machine sends it.

On Windows systems perspective, the SPK is stored inside Active Directory and automatically retrieved by the service. On the other side, in the Linux environment the SPK is stored in /etc/krb5.keytab. The service (e.g., Samba, CUPS, PostgreSQL) reads this file to verify the kerberos Service Tickets.


Where the SPK is stored.

Service Ticket (ST): It is a secure proof that the user is authenticated and allowed to access a service. It contains the username, service name, session key, timestamp, and more, and is encrypted so that only the service itself can read it. The Service Ticket prevents password reuse, ensuring secure, password-less access once authentication is completed. Well, I'll just show you what is inside the Service Ticket:

What’s Inside the Service Ticket


Step 6: Now that the user got the Service Ticket, they are ready to use this ticket to access services (eg: to print, or to access a file from the network drive). User's machine sends the Service Ticket + Authenticator (fresh one again, encrypted with the session key) to the resource server (e.g., print server or file server). The service in the server decrypts the ticket using its own secret key (remember the SPK from Step 5? Yup, that's the secret key), then uses the Session Key inside it to decrypt the Authenticator. If valid, the service grants access without needing the user’s password. The session key inside the Service Ticket allows encrypted communication between the client and service. The user can now interact with the service until the ticket expires.


THAT'S IT FOR TECHNICAL JARGON... BONUSSSS!! LET'S SEE AN EXAMPLE!!!!!

Scenario 1: User "Alice" Accessing a File Named a.txt from a File Server

Step 1: User Logs into Their Computer

Action:

Alice enters their username and password at the login screen.

The system needs to authenticate them using Kerberos.

Network Communication:

The client machine sends an authentication request to the Authentication Server (AS) inside the KDC (Active Directory).

The request contains: Username (e.g., Alice) Current timestamp (to prevent replay attacks) Encrypted challenge (random number encrypted using Alice’s password hash)

AS verifies the username and password against Active Directory.

If valid, the AS encrypts a Ticket Granting Ticket (TGT) and sends it back.

The response contains: TGT is stored in Alice's Computer's RAM (in the Kerberos Ticket Cache).


Step 2: User Requests Access to a.txt on the File Server

Action:

Alice tries to open a.txt from a shared network folder.

Network Communication:

The client sends a request to the Ticket Granting Server (TGS).

The request contains: TGT (proving Alice’s identity) Authenticator (A new timestamp encrypted with Alice’s session key)Requested Service (File Server \\fileserver1\share)

TGS validates: Is the TGT still valid? (i.e., not expired) Does Alice have permissions for the requested service?

If valid, TGS issues a Service Ticket for the File Server.

The response contains: Service Ticket (Encrypted with File Server’s key, so only the File Server can decrypt it) New Session Key for communication between Alice and the File Server and Ticket Expiry Time (e.g., 10 hours)


Step 3: User Accesses a.txt on the File Server

Action:

Alice’s machine sends a request directly to the File Server.

Network Communication:

The request contains: Service Ticket (Received from TGS, encrypted with File Server’s secret key) Authenticator (Fresh timestamp encrypted with new session key)

Requested Action: Read a.txt

File Server Response:

The File Server decrypts the Service Ticket using its secret key.

It validates: Is the ticket valid (not expired)? Does the Authenticator match the session key? Does Alice have permissions to access a.txt?

If everything checks out, the File Server grants access.

Final Data Transfer:

The File Server sends the contents of a.txt to Alice’s machine.

Data is encrypted using the Session Key to protect it from network sniffers.


?? Bonus Round! A Quick Visual Recap of the Kerberos Authentication Flow ??


Kerberos Work Flow

Phew.... Thats it...

要查看或添加评论,请登录

Vivek Gopal的更多文章

  • The Impact and Methodology of a Cyberattack

    The Impact and Methodology of a Cyberattack

    Incident Overview: In an environment where complex threats are ever-present, even the most fortified systems can be…

社区洞察

其他会员也浏览了