After a virtualisation server is restored from backup, staff on its virtual desktops cannot sign in to the domain, although their passwords are correct. The desktops' clocks are 20 minutes behind the domain controllers.
Kerberos tickets, and how attackers abuse them
Kerberos lets a person sign in once and then use many services without typing a password again, by carrying tickets issued by a trusted ticket office. It is how most organisations running Microsoft Windows networks sign their staff in. No background beyond earlier cryptography and passwords is assumed. Attackers who get inside a network go after those tickets, because a stolen or forged ticket opens doors without any password.
By the end of this unit you will be able to:
- Explain the parts of Kerberos: the key distribution centre, its two services, and the two kinds of ticket
- Put in order the steps of a Kerberos sign-in, from password to service
- Explain what Kerberos depends on: synchronised clocks, secret keys and an available key distribution centre
- Tell apart pass the ticket, Kerberoasting, AS-REP roasting, golden ticket, silver ticket and overpass the hash
- Choose the defence that fits each attack on Kerberos
A trainee's account and the backup server's password
An illustrative example
An accountancy firm gives a trainee an ordinary account with no special rights. Her laptop is infected through a fake invoice.
The attacker, using her account, asks the firm's sign-in system for an access ticket to every service on the network. Each request is allowed, and nothing alarms. A week later the attacker signs in to the backup server with its own service account and its real password, which was never sent anywhere.
How could tickets handed to an ordinary user reveal a service account's password?
Kerberos: a ticket office for a whole network
A wristband at a festival
At a music festival, a visitor shows identity once at the gate and receives a wristband. At each stage she shows the wristband to the box office for that stage and gets a stage pass. Stewards check the pass, not her identity. The wristband expires at the end of the day.
Kerberos is a sign-in protocol that works the same way. A trusted third party checks a person's identity once and issues tickets. Services trust the tickets. Its keys are symmetric: each is shared between the trusted party and one user or service.
- Principal
- A principal is any user or service that Kerberos knows and holds a for.
- Key distribution centre (KDC)
- The key distribution centre (KDC) is the trusted third party. It holds every principal's secret key. On a Windows network it runs on each domain controller, the server that holds the accounts.
- Authentication service (AS)
- The part of the KDC that checks identity at sign-in and issues the first ticket. It is the festival gate.
- Ticket-granting service (TGS)
- The part of the KDC that swaps that first ticket for tickets to particular services. It is the stage box office.
- Ticket-granting ticket (TGT)
- The ticket-granting ticket (TGT) is the wristband. It is under the KDC's own key, held by an account called KRBTGT, so the user carries it but cannot read or change it.
- Service ticket
- A service ticket is a stage pass for one service. It is encrypted under that service's key, and holds the user's identity and a session key.
- Realm
- A realm is the set of principals that one KDC looks after, usually one organisation.
A Kerberos sign-in, step by step
A session key is a temporary that the KDC creates for one conversation and gives to both sides. An authenticator is a short message holding the current time, encrypted under the session key, which proves that the sender holds that key.
- Priya types her password. Her computer turns it into her long-term key; the password itself is never sent.
- Her computer asks the authentication service for a TGT, sending the current time encrypted under her key. This is called preauthentication.
- The authentication service the time with its copy of her key. It returns a TGT, plus a session key encrypted under her key.
- To open a file share, her computer sends the TGT and an authenticator to the ticket-granting service.
- The ticket-granting service decrypts the TGT with the KRBTGT key and checks the authenticator. It returns a service ticket for the file server and a new session key.
- Her computer sends the service ticket and a fresh authenticator to the file server. The file server decrypts the ticket with its own key, checks the time, and lets her in.
Kerberos trades one sign-in for service tickets
Read this figure as text
Kerberos gives single sign-on with tickets. Six messages pass in three exchanges, the password never crosses the network, and the file server never talks to the key distribution centre during the visit.
- One: the workstation turns the typed password into the user's key and sends the user's name and the current time encrypted with that key. This is pre-authentication: the authentication service answers only if it can decrypt the time and the time is within a few minutes of its own clock.
- Two: the authentication service returns the ticket-granting ticket, encrypted with the ticket-granting service's own key so that the user cannot read or alter it, with a session key for the ticket-granting service encrypted with the user's key.
- Three: when the user opens a shared folder, the workstation sends the ticket-granting ticket, an authenticator encrypted with that session key, and the name of the file server to the ticket-granting service.
- Four: the ticket-granting service decrypts the ticket with its own key, checks the authenticator and its time, and returns a service ticket encrypted with the file server's key, with a new session key for the user and the file server.
- Five: the workstation presents the service ticket and a fresh authenticator to the file server, which decrypts the ticket with its own key, checks the authenticator and admits the user.
- Six: the file server can reply with proof of its own identity, so that both sides are authenticated. Exchanges three to five repeat for each new service, without the password.
Steps 4 to 6 repeat for each new service, without the password. That is : one sign-in, many services.
What Kerberos depends on
- Clocks that agree. Authenticators carry the time so that an old one cannot be replayed. Each server allows a small difference, typically five minutes; a computer whose clock is further out cannot sign in.
- Secret keys that stay secret. Anyone who steals a principal's key can pose as that principal.
- A KDC that is always reachable. If it fails, nobody can obtain new tickets, so it is a single point of failure. Organisations run several domain controllers for that reason.
- Good passwords. A user's key comes from the password, so a weak password can be guessed offline from captured Kerberos messages.
- Limited ticket lifetimes. A suggested maximum is one day, so a stolen ticket stops working within hours.
Common misconception
“Kerberos tickets are protected by public key cryptography.”
Kerberos itself uses symmetric keys: the KDC shares one secret key with each principal. Optional extensions can bring public keys into some steps, for users who hold certificates, but tickets are still sealed with symmetric keys. That is why stealing the KDC's own key is so damaging.
Stealing and forging tickets
Kerberos exploitation is the abuse of Kerberos tickets and keys to sign in as someone else or to obtain passwords. Each attack aims at one point in the flow.
| Attack | The attacker needs | What it gives |
|---|---|---|
| Pass the ticket | Tickets copied from the memory of a computer the user has signed in to | Access as that user, with no password, until the ticket expires |
| Kerberoasting | Any ordinary account with a TGT | Service tickets for any service, whose encrypted part can be guessed offline to reveal the service account's password |
| AS-REP roasting | The name of an account with preauthentication switched off | A reply encrypted with that user's key, which can be guessed offline |
| Overpass the hash | A stolen password | A genuine TGT obtained with the hash, then used as in pass the ticket |
| Silver ticket | The password hash of one service account | Forged service tickets for that one service, made without asking the KDC, so harder to spot |
| Golden ticket | The KRBTGT account's password hash | Forged TGTs for any account, including administrators, for as long as that key is unchanged |
Kerberoasting works because any user may ask for a ticket to any service, and part of each ticket is encrypted with a key made from the service account's password. A human-chosen password can be guessed offline, where no lockout applies. Older encryption, RC4, makes the guessing faster.
Gold opens every door because it forges the wristband. Silver opens one door because it forges one stage pass.
Defending the ticket office
- Against Kerberoasting
- Give service accounts long passwords, ideally 25 characters or more, or use group managed service accounts, whose long passwords the system sets and changes. Use AES for Kerberos, not RC4. Give service accounts only the rights they need.
- Against AS-REP roasting
- Keep preauthentication switched on for every account, and audit for any account where it has been switched off.
- Against golden tickets
- Protect domain controllers as the most valuable systems on the network. Allow domain administrator accounts to sign in only to domain controllers and a few other servers. After a compromise, reset the KRBTGT password twice, letting the change reach every domain controller in between.
- Against pass the ticket and overpass the hash
- Stop privileged accounts signing in to ordinary computers, where their tickets and hashes can be copied from memory. Keep systems patched.
- For all of them
- Monitor ticket requests: one account asking for many service tickets, requests for RC4, tickets with unusual lifetimes, and service tickets with no matching sign-in.
Common misconception
“After a golden ticket attack, resetting every user's password removes the attacker.”
A golden ticket is forged with the KRBTGT key, not with any user's password. Forged tickets keep working until the KRBTGT password is reset twice.
A question, worked through
An incident responder at a housing association finds that an attacker obtained the KRBTGT password hash from a domain controller three weeks ago. Logs show administrator sessions created from a laptop that no administrator uses. The attacker's malware has been removed from the laptop, and the chief information security officer must decide the next containment step today.
What should the chief information security officer do NEXT?
Decide on your answer, then open the reasoning
- The attacker held the KRBTGT hash, which allows golden tickets: forged TGTs for any account. The question asks for the next containment step.
- Rule out c. Moving to AES makes cracking tickets harder. It does not invalidate tickets forged with a stolen key.
- Rule out d. Strong service account passwords defend against Kerberoasting, which is not what happened here.
- Between a and b: resetting users' passwords is tempting, but golden tickets do not depend on them, so forged tickets keep working.
- Only changing the KRBTGT key, twice with replication between, makes the forged tickets worthless. Option a is the answer.
Answer: A. Reset the KRBTGT password twice, letting each change reach every domain controller
Choosing between good answers
- A scenario has an attacker holding the KRBTGT hash, or forging tickets for any account
- it is a golden ticket. The containment is to reset the KRBTGT password twice.
- An ordinary user requests service tickets for many services and cracks them offline
- it is Kerberoasting. Choose long or managed service account passwords and AES in place of RC4.
- A question asks what Kerberos needs to work
- look for synchronised clocks, an available KDC and secret keys. The KDC is a single point of failure.
- Two options both name forged tickets and differ in scope
- golden forges TGTs for the whole realm; silver forges service tickets for one service.
Try it
Follow one sign-in through to a service and note where a stolen or forged ticket would be accepted.
Loading the preview.
Check your understanding
4 questions on this unit, easiest first. Confirm an answer to see the reasoning for it, then the right answer, the other options and the rule to reuse. Your answers are kept in this browser and feed readiness and review.
These questions are drafts that no named reviewer has approved yet.
Question 1 of 4
What to remember
- Kerberos uses a trusted KDC with two parts: the authentication service issues a TGT, the ticket-granting service issues service tickets.
- Every Kerberos key is symmetric. The TGT is encrypted under the KRBTGT key; each service ticket under that service's key.
- Kerberos needs clocks within about five minutes, secret keys and a reachable KDC, which is a single point of failure.
- Golden ticket: forged TGT from the KRBTGT hash. Silver ticket: forged service ticket from one service's hash.
- Kerberoasting cracks service tickets offline; long managed service account passwords and AES defeat it.
Say it from memory
Name the main attacks on Kerberos and the key defence for each.
Pass the ticket: stolen tickets reused; keep privileged accounts off ordinary computers. Kerberoasting: service tickets cracked offline; long or managed service account passwords, AES not RC4. AS-REP roasting: accounts without preauthentication; keep it on. Golden ticket: TGTs forged with the KRBTGT hash; reset KRBTGT twice. Silver ticket: service tickets forged with one service's hash. Overpass the hash: a hash used to get a real TGT.
In Kerberos, what do the authentication service and the ticket-granting service each do, and what is the ticket-granting ticket encrypted under?
The authentication service checks identity at sign-in and issues the first ticket, the ticket-granting ticket. The ticket-granting service swaps that ticket for service tickets to particular services. The TGT is encrypted under the KDC's own key, held by the KRBTGT account, so the user carries it but cannot read or change it.
What is preauthentication in a Kerberos sign-in, and what is an authenticator?
In preauthentication the computer sends the current time encrypted under the user's key, and the authentication service decrypts it with its copy of that key before issuing a TGT. An authenticator is a short message holding the current time, encrypted under the session key, which proves the sender holds that key.
What must hold for Kerberos to work safely?
Clocks that agree, typically within five minutes, so old authenticators cannot be replayed. Secret keys that stay secret. A KDC that is always reachable, since it is a single point of failure. Good passwords, because a user's key comes from the password. Limited ticket lifetimes, with a suggested maximum of one day.
How do you defend against Kerberoasting, and how do you remove an attacker holding golden tickets?
Against Kerberoasting, give service accounts long passwords, ideally 25 characters or more, or group managed service accounts, and use AES, not RC4. Against golden tickets, reset the KRBTGT password twice, letting the change reach every domain controller in between. Resetting users' passwords does not help.
Sources
- RFC 4120: The Kerberos Network Authentication Service (V5), IETFKerberos as a trusted third-party authentication service using symmetric keys, the KDC with its authentication and ticket-granting functions, tickets, session keys and timestamped authenticators, realms, clock skew of typically five minutes, stolen keys allowing masquerade, offline password guessing, and a recommended maximum ticket lifetime of one day.
- MITRE ATT&CK T1558: Steal or Forge Kerberos Tickets, The MITRE CorporationStealing or forging Kerberos tickets, with golden ticket, silver ticket, Kerberoasting and AS-REP roasting as sub-techniques, and the mitigations of resetting KRBTGT twice, 25-character service account passwords, group managed service accounts, AES in place of RC4 and limiting domain administrators.
- MITRE ATT&CK T1558.001: Golden Ticket, The MITRE CorporationA golden ticket forged with the KRBTGT password hash, giving TGTs for any account, and KRBTGT as the account that encrypts and signs all Kerberos tickets.
- MITRE ATT&CK T1558.002: Silver Ticket, The MITRE CorporationA silver ticket forged with one service account's hash, limited to that resource and made without contacting the KDC, so harder to detect.
- MITRE ATT&CK T1558.003: Kerberoasting, The MITRE CorporationKerberoasting: any user with a valid TGT requesting service tickets whose encrypted part, often RC4, can be brute-forced offline, and detection through unusual numbers of ticket requests and RC4 use.
- MITRE ATT&CK T1558.004: AS-REP Roasting, The MITRE CorporationAS-REP roasting against accounts with Kerberos preauthentication disabled, and preauthentication as a timestamp encrypted with the user's password hash.
- MITRE ATT&CK T1550.003: Pass the Ticket, The MITRE CorporationPass the ticket using stolen Kerberos tickets, and overpass the hash using a password hash to create a valid Kerberos ticket.
- Group Managed Service Accounts overview, MicrosoftManaged service accounts providing automatic password management.