Kerberos
Kerberos is the ticket-based authentication protocol behind Active Directory. It proves identity with encrypted tickets instead of sending passwords.
Overview
Kerberos is a network authentication protocol. It lets a user or a computer prove who it is to a service without sending a password across the network. Instead, a trusted third party called the Key Distribution Center (KDC) hands out encrypted tickets. The client shows a ticket to a service, and the service accepts it because only the KDC could have made it.
Kerberos version 5 is the default authentication protocol in Microsoft Active Directory (AD). Every domain controller runs a KDC. When someone logs on to a domain-joined Windows machine, opens a file share, or connects to an internal web application with single sign-on, Kerberos is almost always doing the work underneath. NTLM is the older fallback.
Kerberos sits at the application layer. The KDC listens on port 88 over both UDP and TCP. Most application protocols do not speak Kerberos directly. They carry Kerberos tokens inside SMB, LDAP, HTTP, or RPC, usually wrapped in SPNEGO (the negotiation layer that picks Kerberos or NTLM).
Defenders care for three reasons. First, the keys behind Kerberos are the keys to the domain. Whoever holds the key of the krbtgt account can forge access to anything. Second, many of the best-known Active Directory attacks (Kerberoasting, golden tickets, delegation abuse) are Kerberos abuse. Third, the protocol leaks useful metadata. Tickets are encrypted, but user names, service names, encryption types, and error codes travel in the clear. That makes Kerberos one of the richest sources for network detection.
History and evolution
Kerberos was built at MIT in the 1980s as part of Project Athena, a campus computing project. The name comes from Kerberos, the three-headed dog of Greek myth, for the three parties in every exchange: client, server, and KDC.
Versions 1 to 3 stayed inside MIT. Version 4 was released publicly in the late 1980s and saw wide academic use. It was tied to DES encryption and had design limits that later versions fixed.
Version 5 was first published as RFC 1510 in 1993. RFC 4120 replaced it in 2005 and is the current core specification. Version 5 added ASN.1 encoding, support for several encryption types, ticket forwarding and delegation, and cross-realm trust.
The encryption story matters most for security:
| Year | Specification | Change |
|---|---|---|
| 2005 | RFC 3961 | A framework that lets Kerberos use different encryption and checksum types |
| 2005 | RFC 3962 | AES128 and AES256 encryption types |
| 2006 | RFC 4757 | Documents the RC4-HMAC type that Windows had shipped since Windows 2000 |
| 2006 | RFC 4556 | PKINIT, which lets a certificate replace the password in the first exchange |
| 2011 | RFC 6113 | FAST, which wraps pre-authentication in a protected tunnel (Microsoft calls it Kerberos armoring) |
| 2012 | RFC 6649 | Deprecates DES and other weak types |
| 2018 | RFC 8429 | Deprecates 3DES and RC4 |
Microsoft adopted Kerberos as the default for Active Directory with Windows 2000 and added extensions, documented in the MS-KILE specification. The most important extension is the Privilege Attribute Certificate (PAC), documented in MS-PAC, which carries the user's security identifier (SID) and group memberships inside the ticket.
Since 2020, Microsoft has shipped a series of Kerberos hardening updates in response to published attacks. They include fixes for the Bronze Bit flaw (CVE-2020-17049), the sAMAccountName spoofing flaws known as noPac (CVE-2021-42278 and CVE-2021-42287), and certificate mapping changes after Certifried (CVE-2022-26923). Many of these shipped in an audit mode first and moved to enforcement later, so patch level alone does not tell you whether a domain is protected. Check the enforcement settings too.
Where Kerberos is used in enterprise networks
In an Active Directory environment, Kerberos is used for:
- Interactive logons to domain-joined Windows machines, and the network logons that follow
- SMB file shares and admin shares, using
cifsandhostservice names - LDAP queries and binds to domain controllers
- Microsoft SQL Server, using
MSSQLSvcservice names - Web single sign-on with the HTTP
Negotiatescheme on IIS, SharePoint, and many internal applications, usingHTTPservice names - Remote Desktop with Network Level Authentication, and Windows Remote Management
- Secure dynamic DNS updates, using GSS-TSIG
- Linux and macOS machines joined to the domain through SSSD or similar tools, plus NFSv4 with
sec=krb5, SSH with GSSAPI, and Hadoop clusters
Kerberos traffic in a healthy domain is constant and predictable. Each user gets a ticket-granting ticket at logon and renews it during the day. Each new service they touch adds a service ticket request. This stable baseline is what makes anomalies stand out: a workstation that suddenly requests tickets for 80 services, or a client that asks for the weak RC4 cipher in an all-AES domain.
Architecture and components
| Component | What it is | What it holds |
|---|---|---|
| Principal | Any identity Kerberos knows about | A name such as jdoe@CORP.LOCAL or MSSQLSvc/sql01.corp.local:1433 |
| Realm | The administrative domain | In AD, the DNS domain name in capital letters, such as CORP.LOCAL |
| Key Distribution Center (KDC) | The trusted third party. Logically two services: the Authentication Service (AS) and the Ticket-Granting Service (TGS) | Access to every principal's long-term key. In AD, every domain controller runs a KDC and the database is Active Directory |
krbtgt account | A special account whose key protects every ticket-granting ticket in the domain | The most sensitive key in the domain |
| Long-term key | A key tied to a principal | For users, derived from the password. For computers and managed service accounts, derived from a long random password |
| Ticket-granting ticket (TGT) | A ticket for the TGS itself | Proof of logon. Encrypted with the krbtgt key |
| Service ticket | A ticket for one specific service | Encrypted with the long-term key of the account that runs the service |
| Session key | A temporary key created by the KDC for one client and one service | Used to encrypt authenticators and, optionally, the application data |
| Authenticator | A short, fresh message the client encrypts with the session key | The client name and a timestamp. Proves the client holds the session key right now |
| Service Principal Name (SPN) | A mapping from a service name to the account that runs it | Stored in the servicePrincipalName attribute of a user or computer account |
| Privilege Attribute Certificate (PAC) | Microsoft authorization data inside the ticket | User SID, group SIDs, and signatures from the service key and the KDC key |
| Keytab | A file that stores long-term keys on Linux and Unix services | Lets a service decrypt tickets without a password prompt |
Two facts follow from this design. The KDC can decrypt every ticket, so a compromised domain controller is a compromised domain. And a ticket works for whoever holds it together with its session key. Kerberos tickets are bearer tokens.
How Kerberos works step by step
- AS-REQ. The client asks the Authentication Service for a ticket-granting ticket. It sends its user name, the realm, the target
krbtgt/REALM, a random nonce, and the list of encryption types it supports. With pre-authentication on (the default), it also sends the current time encrypted with the user's long-term key, in a field calledPA-ENC-TIMESTAMP. - AS-REP. The KDC decrypts the timestamp with its copy of the user's key. If the time is within the allowed clock skew (5 minutes by default), the KDC creates a session key. It returns the TGT, encrypted with the
krbtgtkey, and a separate part, encrypted with the user's key, that holds the session key. The client can read the second part but not the TGT. - TGS-REQ. When the client needs a service, it sends the TGT to the Ticket-Granting Service, along with a new authenticator encrypted with the TGT session key, and the SPN of the target service.
- TGS-REP. The KDC decrypts the TGT with the
krbtgtkey, checks the authenticator, and issues a service ticket. The service ticket is encrypted with the long-term key of the account behind that SPN. A new service session key comes back encrypted with the TGT session key. - AP-REQ. The client sends the service ticket and a fresh authenticator to the service. In Windows this travels inside the application protocol, for example in an SMB Session Setup or an HTTP
Authorization: Negotiateheader. - AP-REP. The service decrypts the ticket with its own key, extracts the session key, and checks the authenticator. If the client asked for mutual authentication, the service proves its own identity with an AP-REP.
Notice what the service does not do: it does not contact the KDC. It trusts the ticket because the ticket is encrypted with its own key. That one design choice explains why silver tickets work.
sequenceDiagram participant C as Client participant AS as KDC Authentication Service participant TGS as KDC Ticket-Granting Service participant S as Service C->>AS: AS-REQ with user name and encrypted timestamp AS->>C: AS-REP with TGT and session key C->>TGS: TGS-REQ with TGT, authenticator, and target SPN TGS->>C: TGS-REP with service ticket and service session key C->>S: AP-REQ with service ticket and authenticator S->>C: AP-REP for mutual authentication (optional)
Packet-level anatomy
Transport, ports, and discovery
| Port | Protocol | Use |
|---|---|---|
| 88 | UDP and TCP | KDC traffic: AS and TGS exchanges |
| 464 | UDP and TCP | Password changes (kpasswd) |
| 749 | TCP | Administration in MIT Kerberos (kadmin) |
Over TCP, every Kerberos message starts with a 4-byte length field (the record mark), followed by the ASN.1 message. Over UDP there is no length prefix. If a reply is too large for UDP, the KDC returns error 52 (KRB_ERR_RESPONSE_TOO_BIG) and the client retries over TCP. Users in many groups get large PACs, so their tickets usually travel over TCP. Windows also switches to TCP on its own when a message is bigger than a size threshold.
Clients find KDCs through DNS SRV records such as _kerberos._tcp.corp.local, and in AD also _kerberos._tcp.dc._msdcs.corp.local. A host that queries these records but is not domain-joined is worth a look.
Message types
Every message carries a msg-type number.
| msg-type | Message | Direction | Encrypted part protected by |
|---|---|---|---|
| 10 | AS-REQ | Client to KDC | Pre-authentication data uses the client's long-term key |
| 11 | AS-REP | KDC to client | Ticket: krbtgt key. Client part: client's long-term key |
| 12 | TGS-REQ | Client to KDC | Authenticator: TGT session key |
| 13 | TGS-REP | KDC to client | Ticket: service account key. Client part: TGT session key |
| 14 | AP-REQ | Client to service | Ticket: service key. Authenticator: service session key |
| 15 | AP-REP | Service to client | Service session key |
| 20 | KRB-SAFE | Either | Integrity only |
| 21 | KRB-PRIV | Either | Encrypted application data |
| 22 | KRB-CRED | Either | Used to forward tickets to another host |
| 30 | KRB-ERROR | KDC or service to client | Not encrypted |
Encoding
Kerberos messages are ASN.1 structures encoded with DER (Distinguished Encoding Rules). Each top-level message has an APPLICATION tag: AS-REQ is [APPLICATION 10], AS-REP is [APPLICATION 11], a Ticket is [APPLICATION 1], an Authenticator is [APPLICATION 2], and the encrypted ticket body (EncTicketPart) is [APPLICATION 3]. Fields inside each structure carry context tags such as [0], [1], [2]. Wireshark and Zeek decode these tags into field names.
AS-REQ and TGS-REQ (KDC-REQ)
AS-REQ and TGS-REQ share one structure.
| Field | Type or encoding | Purpose | Security note |
|---|---|---|---|
pvno [1] | INTEGER | Protocol version, always 5 | None |
msg-type [2] | INTEGER | 10 for AS-REQ, 12 for TGS-REQ | None |
padata [3] | SEQUENCE OF PA-DATA, optional | Pre-authentication and extra data. In AS-REQ, usually PA-ENC-TIMESTAMP (type 2). In TGS-REQ, PA-TGS-REQ (type 1), which carries the TGT and authenticator. Windows also sends PA-PAC-REQUEST (type 128) | An AS-REQ with no PA-ENC-TIMESTAMP that still gets a ticket means pre-authentication is off for that account. The etype inside the encrypted timestamp shows which key the client used |
req-body [4] | KDC-REQ-BODY | The request itself | See below |
kdc-options [0] | BIT STRING | Flags such as forwardable, renewable, canonicalize | Unusual flag combinations can identify attack tools |
cname [1] | PrincipalName, optional | Client name. Present in AS-REQ | Visible in clear text on the wire |
realm [2] | Realm | The realm | A realm name in lower case or a short NetBIOS form can point to tooling |
sname [3] | PrincipalName, optional | Target service. krbtgt/REALM for AS-REQ, the SPN for TGS-REQ | Visible in clear text, so you see every service each client asks for |
till [5] | KerberosTime | Requested end time | Windows clients send the fixed value 2037-09-13 02:48:05 UTC |
nonce [7] | UInt32 | Random number matched in the reply | None |
etype [8] | SEQUENCE OF Int32 | Encryption types the client supports, in order of preference | A list containing only RC4 from a modern Windows host is a strong sign of tooling or a downgrade |
additional-tickets [11] | SEQUENCE OF Ticket, optional | Used for user-to-user and S4U2Proxy delegation | Its presence marks delegation traffic |
AS-REP and TGS-REP (KDC-REP)
| Field | Type or encoding | Purpose | Security note |
|---|---|---|---|
pvno [0] | INTEGER | Always 5 | None |
msg-type [1] | INTEGER | 11 for AS-REP, 13 for TGS-REP | None |
padata [2] | SEQUENCE OF PA-DATA, optional | In AS-REP, PA-ETYPE-INFO2 tells the client the encryption type and salt for its key | The salt reveals the exact casing of the principal name used for key derivation |
crealm [3] | Realm | Client realm | None |
cname [4] | PrincipalName | Client name | None |
ticket [5] | Ticket | The TGT or service ticket | Its encrypted part is what Kerberoasting cracks |
enc-part [6] | EncryptedData | Session key, nonce, times, and flags for the client | In AS-REP this is encrypted with the user's key, which is what AS-REP roasting cracks |
Ticket and EncTicketPart
The outer Ticket is [APPLICATION 1] with four fields: tkt-vno (5), realm, sname, and enc-part. Only enc-part is encrypted. The service name in sname sits outside the encryption, which is why some delegation attacks can change it.
Inside enc-part, the EncTicketPart holds:
| Field | Purpose | Security note |
|---|---|---|
flags [0] | Ticket flags: forwardable, forwarded, renewable, pre-authent, and others | Forged tickets often carry flag sets that real KDCs never issue |
key [1] | The session key | Holding the ticket plus this key means holding the identity |
crealm [2] and cname [3] | The client | In a forged ticket these can name any account |
authtime [5], starttime [6], endtime [7], renew-till [8] | Validity times | Golden tickets made with default tool settings often last 10 years. Real AD tickets last 10 hours |
authorization-data [10] | In AD, the PAC, wrapped in AD-IF-RELEVANT with ad-type 128 (AD-WIN2K-PAC) | The PAC states group memberships. Whoever can encrypt the ticket can write any PAC |
All encrypted fields use the EncryptedData structure: etype [0] (which algorithm), kvno [1] (the key version number, optional), and cipher [2] (the ciphertext). The etype and kvno values are readable without decryption.
Encryption types
| etype | Name | How the key is made | Status |
|---|---|---|---|
| 17 | aes128-cts-hmac-sha1-96 | PBKDF2 with HMAC-SHA1, 4,096 iterations, salt built from realm and principal name | Supported in AD |
| 18 | aes256-cts-hmac-sha1-96 | Same as 17, with a 256-bit key | The preferred type in modern AD |
| 23 | rc4-hmac | The NT hash of the password (MD4), no salt | Deprecated by RFC 8429. Still enabled in many domains |
| 1 and 3 | des-cbc-crc, des-cbc-md5 | DES | Deprecated. Disabled by default since Windows 7 and Windows Server 2008 R2 |
The difference between 18 and 23 is the difference between slow and fast offline cracking. With RC4 the key is the NT hash, so a stolen NT hash can request tickets directly, and a captured ticket can be cracked quickly. With AES, the key derivation is salted and iterated, which slows cracking considerably but does not save a weak password.
Common KRB-ERROR codes
| Code | Name | Meaning | Detection value |
|---|---|---|---|
| 6 | KDC_ERR_C_PRINCIPAL_UNKNOWN | The client name does not exist | Bursts mean user enumeration |
| 7 | KDC_ERR_S_PRINCIPAL_UNKNOWN | The service name does not exist | Can mean scanning for SPNs or a broken application |
| 14 | KDC_ERR_ETYPE_NOSUPP | No encryption type in common | Common after hardening if old clients remain |
| 18 | KDC_ERR_CLIENT_REVOKED | Account disabled, locked, or expired | Spikes can follow a password spray |
| 23 | KDC_ERR_KEY_EXPIRED | Password expired | Mostly noise |
| 24 | KDC_ERR_PREAUTH_FAILED | Wrong password in pre-authentication | Many accounts failing from one source means password spraying |
| 25 | KDC_ERR_PREAUTH_REQUIRED | The normal first reply when a client sends no pre-authentication | Normal at low volume. If an account never gets this reply, pre-authentication is off for it. Zeek does not log this error by default (see the detection section) |
| 37 | KRB_AP_ERR_SKEW | Clock difference too large | Time synchronization problems |
| 52 | KRB_ERR_RESPONSE_TOO_BIG | Reply too large for UDP | Normal. The client retries over TCP |
| 68 | KDC_ERR_WRONG_REALM | Request belongs to another realm | Normal in multi-domain forests |
Example decoded AS-REQ
This is an illustrative AS-REQ from a Windows client, laid out the way Wireshark shows it.
Kerberos
Record Mark: 247 bytes (TCP only)
as-req
pvno: 5
msg-type: krb-as-req (10)
padata: 2 items
PA-DATA pA-ENC-TIMESTAMP
padata-value
etype: eTYPE-AES256-CTS-HMAC-SHA1-96 (18)
cipher: 9c41e2... (current time, encrypted with the user's AES key)
PA-DATA pA-PAC-REQUEST
include-pac: True
req-body
kdc-options: 40810010 (forwardable, renewable, canonicalize, renewable-ok)
cname
name-type: kRB5-NT-PRINCIPAL (1)
cname-string: jdoe
realm: CORP.LOCAL
sname
name-type: kRB5-NT-SRV-INST (2)
sname-string: krbtgt, CORP.LOCAL
till: 2037-09-13 02:48:05 (UTC)
nonce: 1883947582
etype: 18, 17, 23, ...
The same exchange appears in Zeek's kerberos.log as one line per request, with fields such as request_type (AS or TGS), client, service, success, error_msg, cipher, till, forwardable, and renewable. An illustrative TGS line for a Kerberoasting request looks like this:
request_type=TGS client=jdoe/CORP.LOCAL service=MSSQLSvc/sql01.corp.local:1433 success=T cipher=rc4-hmac forwardable=T
Configuration in practice
Domain Kerberos policy
These settings live in the Default Domain Policy under Account Policies, Kerberos Policy.
| Setting | Default | Recommended | Why |
|---|---|---|---|
| Maximum lifetime for user ticket (TGT) | 10 hours | 10 hours or less | Limits how long a stolen TGT works |
| Maximum lifetime for user ticket renewal | 7 days | 7 days or less | Limits how long a stolen TGT can be renewed |
| Maximum lifetime for service ticket | 600 minutes | 600 minutes or less | Must not exceed the TGT lifetime |
| Maximum tolerance for computer clock synchronization | 5 minutes | 5 minutes | Larger values weaken replay protection |
| Enforce user logon restrictions | Enabled | Enabled | Makes the KDC check account restrictions on every service ticket |
Encryption types
| Setting | Default | Recommended | Why |
|---|---|---|---|
| Group Policy: Network security, Configure encryption types allowed for Kerberos | Not defined | AES128, AES256, and future types, after testing | Removes RC4 and DES from clients and servers that apply the policy |
Account attribute msDS-SupportedEncryptionTypes | Not set on most user accounts | 0x18 (AES128 and AES256) on service accounts | Stops the KDC from issuing RC4 tickets for that account |
| Accounts with old passwords | Common | Reset the password | Accounts whose password has not changed since the domain reached the Windows Server 2008 functional level may have no AES keys at all |
The bit values in msDS-SupportedEncryptionTypes are: DES-CBC-CRC 0x1, DES-CBC-MD5 0x2, RC4 0x4, AES128 0x8, AES256 0x10. AES only is 0x18.
Account and group settings
| Setting | Default | Recommended | Why |
|---|---|---|---|
"Do not require Kerberos preauthentication" (userAccountControl flag 0x400000) | Off | Off on every account, with an alert on change | When on, anyone can request crackable material for that account |
"Account is sensitive and cannot be delegated" (flag 0x100000) | Off | On for all privileged accounts | Stops the account's tickets from being delegated |
| Protected Users group | Empty | All administrators | Members cannot use NTLM, DES, or RC4, cannot be delegated, and get a 4-hour TGT by default |
ms-DS-MachineAccountQuota | 10 | 0 | By default any user can create 10 computer accounts, which several delegation attacks need |
krbtgt password | Set at domain creation | Reset twice on a schedule and after any suspected compromise | Old krbtgt keys keep forged tickets valid |
| Kerberos armoring (FAST), KDC and client policies | Not configured | Supported, then required where all clients can use it | Protects pre-authentication from offline attacks and some downgrades |
Linux clients
On Linux, /etc/krb5.conf holds the equivalent settings. A hardened example:
[libdefaults]
default_realm = CORP.LOCAL
dns_lookup_kdc = true
rdns = false
ticket_lifetime = 10h
renew_lifetime = 7d
permitted_enctypes = aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96
Ticket caches on Linux are often files such as /tmp/krb5cc_<uid>. Anyone who can read that file can reuse the tickets inside it, so file permissions and cache type (kernel keyring versus file) matter.
Security model and common misconfigurations
Kerberos rests on four assumptions:
- The KDC is trusted and its database is secret.
- Long-term keys stay secret. For users that means strong passwords.
- Clocks are synchronized, because authenticators use timestamps to stop replay.
- A ticket plus its session key is proof of identity. Kerberos does not bind tickets to a machine, and in AD the client address field is normally empty.
Most real-world Kerberos compromises break one of these assumptions through configuration, not cryptography. The most common problems in enterprise domains:
- Service accounts with SPNs and short, years-old passwords, often in privileged groups
- Accounts with pre-authentication turned off, usually for an old application nobody remembers
- Unconstrained delegation on servers other than domain controllers
- RC4 still allowed domain-wide, and old accounts with no AES keys
- A
krbtgtpassword that has not changed since the domain was built (checkpwdLastSeton the account) - Administrators outside the Protected Users group and not marked as sensitive
ms-DS-MachineAccountQuotaleft at 10, combined with write access on computer objects- Certificate templates in Active Directory Certificate Services (AD CS) that let users request certificates for other identities
Attacks against Kerberos
User enumeration and password spraying
How it works: the attacker sends AS-REQ messages for a list of user names. A non-existent name returns error 6. An existing name returns error 25 (pre-authentication required). For spraying, the attacker adds a PA-ENC-TIMESTAMP encrypted with a guessed password. A wrong guess returns error 24.
Prerequisites: network access to port 88 on a domain controller. No account is needed for enumeration.
Tools: Kerbrute and similar scripts.
ATT&CK: T1110.003 (Password Spraying).
On the wire and in logs: many AS-REQs from one source across many user names, with high rates of errors 6 or 24. Failed pre-authentication logs as Event 4771 (failure code 0x18), not as the familiar 4625. Teams that only watch 4625 miss Kerberos spraying entirely.
AS-REP roasting
How it works: for accounts with pre-authentication turned off, the attacker sends an AS-REQ with no pre-authentication data. The KDC returns an AS-REP whose enc-part is encrypted with the user's key. The attacker cracks it offline.
Prerequisites: a list of user names, and at least one account with "Do not require Kerberos preauthentication" set.
Tools: Rubeus, Impacket GetNPUsers.py. Hashcat mode 18200 cracks the result.
ATT&CK: T1558.004 (AS-REP Roasting).
On the wire and in logs: a successful AS-REP with no preceding error 25 and no PA-ENC-TIMESTAMP in the request. On the domain controller, Event 4768 with Pre-Authentication Type 0. The domain controller event is the more reliable signal: by default, Zeek leaves error 25 out of kerberos.log, so the missing-error check only works on the wire after the change described under Log sources.
Kerberoasting
How it works: any domain user requests service tickets for accounts that have SPNs, then cracks the encrypted ticket part offline to recover the service account password. See the full Kerberoasting entry for mechanics and defenses.
Prerequisites: any domain account.
Tools: Rubeus, Impacket GetUserSPNs.py. Hashcat modes 13100 (RC4), 19600 (AES128), and 19700 (AES256).
ATT&CK: T1558.003 (Kerberoasting).
On the wire and in logs: one client sending TGS-REQs for many SPNs in a short window, often asking for RC4 only. On domain controllers, bursts of Event 4769 with Ticket Encryption Type 0x17.
Pass-the-ticket
How it works: the attacker steals TGTs or service tickets from memory on a compromised Windows host (from the LSASS process) or from cache files on Linux, then loads them into their own session. Because tickets are bearer tokens, they work from any machine.
Prerequisites: local administrator or SYSTEM on a host where the victim has logged on, or read access to their ticket cache.
Tools: Mimikatz, Rubeus.
ATT&CK: T1550.003 (Pass the Ticket).
On the wire and in logs: TGS-REQs for a user from a host that never sent an AS-REQ for that user during the ticket lifetime. This "TGS without a matching AS" check is one of the most useful network detections for stolen tickets.
Overpass-the-hash (pass-the-key)
How it works: with a stolen NT hash or AES key, the attacker builds a valid PA-ENC-TIMESTAMP and asks for a real TGT. No password is needed. With an NT hash, this only works if RC4 is allowed for the account.
Prerequisites: the user's NT hash or AES key, usually dumped from memory.
Tools: Rubeus asktgt, Mimikatz.
On the wire and in logs: AS-REQs whose encrypted timestamp uses RC4 (etype 23) for accounts that normally use AES. On the domain controller, Event 4768 with Ticket Encryption Type 0x17 for a user who usually shows 0x12.
Golden ticket
How it works: with the krbtgt key, the attacker forges a TGT for any user with any group memberships and any lifetime. The KDC accepts it because it is encrypted with the right key. Variants called diamond and sapphire tickets start from a real TGT and modify or replace its PAC, which leaves a normal AS exchange behind and is harder to spot.
Prerequisites: the krbtgt key, usually obtained through DCSync (T1003.006) or a copy of the NTDS.dit database.
Tools: Mimikatz, Rubeus, Impacket ticketer.py.
ATT&CK: T1558.001 (Golden Ticket).
On the wire and in logs: TGS-REQs that use a TGT no domain controller issued (no AS-REQ for that user from that host). Ticket lifetimes far longer than domain policy. Accounts in the PAC that do not exist or do not match the ticket's client name. Domain controllers patched for CVE-2021-42287 check a field called PAC_REQUESTOR, which defeats forgeries for non-existent accounts. Forgeries for real accounts still work.
Silver ticket
How it works: with the long-term key of a service account or computer account, the attacker forges a service ticket for that service directly. The KDC is never involved, because services check tickets with their own key.
Prerequisites: the service account's key, or the computer account hash for cifs, host, and similar services on that machine.
Tools: Mimikatz, Impacket ticketer.py.
ATT&CK: T1558.002 (Silver Ticket).
On the wire and in logs: an AP-REQ to a service with no matching TGS-REQ from that client to any domain controller. On the target server, logon events (Event 4624, logon type 3, Kerberos) with no matching Event 4769 on any domain controller.
Delegation abuse
Kerberos delegation lets a service act on behalf of a user. Each of the three forms has an attack path, all under ATT&CK T1558 (Steal or Forge Kerberos Tickets) and related techniques.
- Unconstrained delegation: users who connect to the server send a copy of their TGT with the service ticket. An attacker who compromises that server collects those TGTs. Combined with authentication coercion (forcing a domain controller to connect, for example through the print spooler), this yields a domain controller's TGT and then full domain compromise.
- Constrained delegation (S4U2Self and S4U2Proxy): an account allowed to delegate to listed SPNs can request tickets as any user to those SPNs. Because the service name sits outside the ticket encryption, the attacker can often swap the service class, for example from
httptocifson the same host. CVE-2020-17049 (Bronze Bit) let attackers bypass the protection on non-forwardable tickets until it was patched. - Resource-based constrained delegation (RBCD): if an attacker can write the
msDS-AllowedToActOnBehalfOfOtherIdentityattribute on a computer object and controls any account with an SPN (easy whenms-DS-MachineAccountQuotais 10), they can impersonate administrators to that computer.
On the wire and in logs: TGS-REQs with additional-tickets (S4U2Proxy) from accounts that do not normally delegate. Event 4769 with the Transited Services field filled in. Directory changes to delegation attributes (Event 5136), and new computer accounts created by ordinary users (Event 4741).
Certificate abuse through PKINIT
How it works: PKINIT lets a certificate replace the password in the AS exchange. An attacker who obtains a certificate for another user, usually through a misconfigured AD CS template, gets that user's TGT. With the same certificate they can also recover the user's NT hash. Certificates keep working after the victim changes their password.
Prerequisites: a vulnerable certificate template, or control over a principal that can request certificates for others.
Tools: Certipy, Rubeus, Certify.
ATT&CK: T1649 (Steal or Forge Authentication Certificates).
On the wire and in logs: AS-REQs with PKINIT pre-authentication from accounts that normally use passwords. On the domain controller, Event 4768 with certificate fields filled in. On the certificate authority, issuance events (4886 and 4887) for templates and requesters that do not match normal use.
sAMAccountName spoofing (noPac)
How it works: an attacker creates a computer account, renames it to the name of a domain controller without the trailing $, requests a TGT, renames it back, and then asks for a service ticket with S4U2Self. The KDC cannot find the renamed account, appends $, finds the real domain controller account, and issues a ticket for it. The result is domain administrator access from an ordinary account.
Prerequisites: a normal domain account, the ability to create or modify a computer account, and unpatched domain controllers (CVE-2021-42278 and CVE-2021-42287, patched in November 2021).
ATT&CK: T1068 (Exploitation for Privilege Escalation).
On the wire and in logs: computer accounts renamed so their names lack the trailing $ (Events 4742 and 4781), followed shortly by S4U2Self requests.
Detection engineering
Log sources
| Source | Event or field | What to look for |
|---|---|---|
| Domain controller Security log | 4768, TGT requested | Ticket Encryption Type (0x12 normal, 0x17 worth a look), Pre-Authentication Type (0 means none, 2 is encrypted timestamp, 15 or 16 is PKINIT, 138 is an armored FAST logon), failure codes such as 0x6 |
| Domain controller Security log | 4769, service ticket requested | Service Name, Ticket Encryption Type, Transited Services, failure codes |
| Domain controller Security log | 4771, pre-authentication failed | Failure code 0x18 (bad password) across many accounts from one IP |
| Domain controller Security log | 4770, ticket renewed | Renewals far beyond policy |
| Member servers | 4624 logon type 3 with Kerberos | Service logons with no matching 4769 at any domain controller |
| Directory changes | 5136, 4738, 4741, 4742, 4781 | Delegation attributes, the pre-authentication flag, new and renamed computer accounts |
Zeek kerberos.log | request_type, client, service, success, error_msg, cipher, till | Bursts, RC4, unusual lifetimes, error patterns. By default Zeek does not log the pre-authentication-required error (it is listed in KRB::ignored_errors). Remove it from that set to see error 25 replies, at the cost of higher log volume |
Zeek conn.log | Connections to port 88 | Port 88 traffic from hosts that are not domain members, or to hosts that are not domain controllers |
Turn on the advanced audit subcategories "Kerberos Authentication Service" and "Kerberos Service Ticket Operations" for both success and failure on every domain controller. Without them, most of the events above never exist.
Example detections
Kerberoasting burst over Zeek data, as pseudo-SQL:
SELECT orig_h, client, COUNT(DISTINCT service) AS spns
FROM kerberos_log
WHERE request_type = 'TGS'
AND cipher = 'rc4-hmac'
AND success = true
AND ts > now() - INTERVAL '10 minutes'
GROUP BY orig_h, client
HAVING COUNT(DISTINCT service) >= 10;
Expected false positives: vulnerability scanners and inventory tools that touch many services, and old applications that still need RC4. Exclude them by source address after review.
AS-REP roasting, as Sigma-style YAML:
title: Kerberos TGT issued without pre-authentication
logsource:
product: windows
service: security
detection:
selection:
EventID: 4768
PreAuthType: '0'
Status: '0x0'
condition: selection
falsepositives:
- Accounts that are meant to have pre-authentication disabled. Fix those rather than tune them out.
level: high
Password spraying over Kerberos, as Sigma-style YAML:
title: Kerberos pre-authentication failures across many accounts
logsource:
product: windows
service: security
detection:
selection:
EventID: 4771
Status: '0x18'
condition: selection | count(TargetUserName) by IpAddress > 20
timeframe: 15m
falsepositives:
- A misconfigured application cycling through stale credentials
level: medium
Stolen or forged TGT, as a network heuristic:
For each TGS-REQ (client C, user U, time T):
if no AS-REQ for U from C succeeded between T minus the TGT lifetime and T,
and C is not a known jump host or terminal server,
then raise an alert: TGS without a matching AS.
Expected false positives: TGTs obtained from a domain controller your sensor cannot see, and long-lived sessions that span sensor restarts. Make sure the sensor covers every domain controller before trusting this rule.
Prevention and hardening
In order of impact:
- Give every service account a long random password, or move it to a Group Managed Service Account. This removes most of the value of Kerberoasting.
- Find and clear "Do not require Kerberos preauthentication" on every account, and alert when anyone sets it.
- Move to AES. Set
msDS-SupportedEncryptionTypesto0x18on service accounts, reset passwords on accounts with no AES keys, then disable RC4 by policy after testing. - Remove unconstrained delegation from everything except domain controllers. Mark privileged accounts as sensitive and add administrators to Protected Users.
- Set
ms-DS-MachineAccountQuotato 0 and limit who can create computer accounts and write delegation attributes. - Reset the
krbtgtpassword twice on a regular schedule. Many organizations use 180 days. Wait at least the maximum ticket lifetime plus replication time between the two resets. - Keep domain controllers fully patched and check that hardening updates are in enforcement mode, not only installed.
- Review AD CS certificate templates. Remove templates that let a requester supply another identity and also allow client authentication.
- Turn on Kerberos armoring (FAST) once all clients support it.
- Use a tiered administration model so privileged TGTs never sit in memory on ordinary workstations.
- Turn on Kerberos auditing on every domain controller and send the events to your SIEM.
- Allow port 88 to domain controllers only from networks that need it, and watch port 88 traffic from anywhere else.
Incident response and remediation
When compromise involving Kerberos is suspected:
- Scope. Build a timeline from Events 4768, 4769, and 4771 on all domain controllers, and from
kerberos.logon your network sensors. Identify the accounts, hosts, and services involved. - Contain the hosts. Isolate machines where tickets were stolen or tools ran, and purge their ticket caches (
klist purgeon Windows) or reboot them. - Reset compromised accounts. For user and service accounts, set new long random passwords. For computer accounts used in silver tickets, reset the machine account password.
- If the
krbtgtkey may be exposed, resetkrbtgttwice. A planned double reset waits between the two changes so normal sessions are not broken. In an active golden ticket incident, resetting twice in quick succession ends attacker access faster, at the cost of forcing everyone to log on again. - Remove delegation abuse. Clear unexpected values in
msDS-AllowedToActOnBehalfOfOtherIdentityandmsDS-AllowedToDelegateTo, and delete computer accounts the attacker created. - Revoke certificates. Certificates obtained through AD CS abuse keep working after password resets. Revoke them at the certificate authority and fix the template.
- Hunt for persistence. Check for new DCSync rights (Replicating Directory Changes permissions) on unexpected accounts, changes to AdminSDHolder, new SPNs added to privileged accounts, and pre-authentication flags flipped off.
- Watch for return. Keep the detections above at high priority for several weeks, since attackers often come back through access you have not found yet.
Real-world cases
- CVE-2020-17049, Bronze Bit: a flaw in how the KDC checked the forwardable flag in S4U2Proxy let attackers abuse constrained delegation even for protected accounts. Microsoft fixed it in 2020 and later moved the fix to enforcement.
- CVE-2021-42287, noPac: together with CVE-2021-42278, this let any domain user impersonate a domain controller. Public exploit code appeared in December 2021, shortly after the patches, and the technique became a common step in intrusions against unpatched domains.
- CVE-2022-26923, Certifried: by changing a computer account's DNS host name, a domain user could get a certificate for a domain controller and then a TGT through PKINIT. The fix changed how domain controllers map certificates to accounts.
- Mimikatz: the open-source tool that made golden tickets, silver tickets, and pass-the-ticket practical for both attackers and red teams. Its Kerberos features remain the reference implementation many detections are tested against.
Framework mappings
- T1558.001: Steal or Forge Kerberos Tickets: Golden Ticket
- T1558.002: Steal or Forge Kerberos Tickets: Silver Ticket
- T1558.003: Steal or Forge Kerberos Tickets: Kerberoasting
- T1558.004: Steal or Forge Kerberos Tickets: AS-REP Roasting
- T1550.003: Use Alternate Authentication Material: Pass the Ticket
- T1110.003: Brute Force: Password Spraying
- T1649: Steal or Forge Authentication Certificates
- T1003.006: OS Credential Dumping: DCSync
- T1558: Steal or Forge Kerberos Tickets
- T1068: Exploitation for Privilege Escalation
Kerberos in the news
News stories tagged with Kerberos. This list updates on its own while the page is open.
No news stories are tagged with this topic yet.
Frequently asked questions
Which ports does Kerberos use?
The KDC uses port 88 over both UDP and TCP. Password changes use port 464. Windows switches to TCP for large messages, which is common for users in many groups. Application traffic carries Kerberos inside its own protocol, such as SMB on 445 or LDAP on 389.
Is Kerberos traffic encrypted?
The sensitive parts are. Tickets, authenticators, and session keys are encrypted. But user names, service names, the realm, encryption types, flags, and error codes travel in clear text, which is exactly what network detection uses.
Why do so many domains still allow RC4?
Compatibility. Old applications, old devices, and accounts whose passwords have not changed in years may lack AES support or AES keys. Find them with Event 4769 filtered on encryption type 0x17, fix them, then disable RC4 by policy.
What is the difference between a golden ticket and a silver ticket?
A golden ticket is a forged TGT made with the krbtgt key. It grants access to any service in the domain. A silver ticket is a forged service ticket made with one service account's key. It only works for that service, but it never touches a domain controller, which makes it harder to see.
How often should the krbtgt password be reset?
On a regular schedule, which many organizations set at 180 days, and immediately after any suspected compromise. Always reset it twice, because the domain accepts both the current and the previous key.
Can Kerberos authentication be relayed like NTLM?
Classic NTLM-style relay does not apply directly, because a service ticket only works for the service it was issued for. Kerberos relay techniques do exist against services that do not require signing or channel binding, such as LDAP without signing. Requiring LDAP signing and channel binding closes most of that path.
References and further reading
- RFC 4120: The Kerberos Network Authentication Service (V5)
- RFC 3961: Encryption and Checksum Specifications for Kerberos 5
- RFC 3962: Advanced Encryption Standard (AES) Encryption for Kerberos 5
- RFC 4757: The RC4-HMAC Kerberos Encryption Types Used by Microsoft Windows
- RFC 8429: Deprecate Triple-DES (3DES) and RC4 in Kerberos
- RFC 6113: A Generalized Framework for Kerberos Pre-Authentication (FAST)
- RFC 4556: Public Key Cryptography for Initial Authentication in Kerberos (PKINIT)
- Microsoft Learn: Event 4768, a Kerberos authentication ticket (TGT) was requested
- Microsoft Learn: Event 4769, a Kerberos service ticket was requested
- Zeek script reference: Kerberos analyzer (base/protocols/krb)
- MITRE ATT&CK Enterprise matrix
- MITRE CWE list
- NIST Computer Security Resource Center glossary
Found a technical error in this entry? Tell us and we will fix it.