klist.exe: Kerberos Ticket Management
klist.exe
is a command-line utility included with Windows operating systems that allows users and administrators to view and manage Kerberos tickets. Kerberos is the primary authentication protocol used in Active Directory domains, and understanding how to use klist
is crucial for troubleshooting authentication and access issues.
Origin and Purpose
klist.exe
is a native Windows component, developed by Microsoft as part of the Kerberos implementation within the operating system. Its primary purpose is to:
- Display cached Kerberos tickets: Show currently held Ticket Granting Tickets (TGTs) and service tickets.
- Purge the Kerberos ticket cache: Remove all cached tickets, forcing the client to re-authenticate.
- Troubleshoot Kerberos authentication problems: Analyze ticket details to diagnose issues related to domain logins, resource access, and single sign-on (SSO).
- List Kerberos Keytabs: Show Keytabs list.
- Diagnose Kerberos configuration Issues: Diagnose configuration Issues.
Is it a Virus?
No, klist.exe
is not a virus. It is a legitimate and essential system file provided by Microsoft. If you find a file named klist.exe
located outside of the %SystemRoot%\System32
directory (typically C:\Windows\System32
), it might be a malicious imposter. However, the genuine klist.exe
in its correct location is safe.
Can it Become a Virus?
klist.exe
itself cannot «become» a virus. It’s a static executable file. However, as mentioned above, malware could masquerade as klist.exe
by using the same filename and placing itself in a different directory. This is why it’s important to verify the file’s location and, if suspicious, scan it with a reputable antivirus program. Another potential (though less common) risk is if a vulnerability were discovered in klist.exe
, it could theoretically be exploited by malware. However, Microsoft regularly releases security updates to address such vulnerabilities, so keeping your system up-to-date is crucial.
Usage and Examples
klist.exe
is a command-line tool, meaning you interact with it through the Command Prompt (cmd.exe) or PowerShell. Open either of these as an administrator for full functionality (although some commands work without administrator privileges).
Here are some common klist
commands and their explanations:
1. klist
(or klist tickets
)
This is the most basic command. It displays the currently cached Kerberos tickets for the logged-in user.
Output (Example):
Current LogonId is 0:0x3e7
Cached Tickets: (6)
#0> Client: user @ EXAMPLE.COM
Server: krbtgt/EXAMPLE.COM @ EXAMPLE.COM
KerbTicket Encryption Type: AES-256-CTS-HMAC-SHA1-96
Ticket Flags 0x40e10000 -> forwardable renewable initial pre_authent name_canonicalize
Start Time: 2/8/2025 10:00:00 (local)
End Time: 2/8/2025 20:00:00 (local)
Renew Time: 2/15/2025 10:00:00 (local)
Session Key Type: AES-256-CTS-HMAC-SHA1-96
Cache Flags: 0x1 -> PRIMARY
Kdc Called: dc1.example.com
#1> Client: user @ EXAMPLE.COM
Server: host/server1.example.com @ EXAMPLE.COM
KerbTicket Encryption Type: AES-256-CTS-HMAC-SHA1-96
Ticket Flags 0x40a50000 -> forwardable renewable pre_authent ok_as_delegate name_canonicalize
Start Time: 2/8/2025 10:15:00 (local)
End Time: 2/8/2025 20:00:00 (local)
Renew Time: 2/15/2025 10:00:00 (local)
Session Key Type: AES-256-CTS-HMAC-SHA1-96
Cache Flags: 0
Kdc Called: dc1.example.com
...(other tickets)...
Explanation of Output:
- Client: The user principal name (UPN) of the user who holds the ticket.
- Server: The service principal name (SPN) of the service the ticket grants access to.
krbtgt
is the Kerberos Key Distribution Center (KDC) itself. - KerbTicket Encryption Type: The encryption algorithm used for the ticket.
- Ticket Flags: Indicate the properties of the ticket (e.g., forwardable, renewable). Understanding these flags is essential for advanced troubleshooting.
- Start Time, End Time, Renew Time: The validity period of the ticket.
- Session Key Type: The encryption algorithm used for the session key.
- Cache Flags: Indicates whether the ticket is the primary TGT (usually 0x1).
- Kdc Called: The domain controller that issued the ticket.
2. klist tgt
This command specifically displays only the Ticket Granting Ticket (TGT). The TGT is used to obtain service tickets.
3. klist purge
This command purges (deletes) all cached Kerberos tickets for the current user session. This forces the user to re-authenticate to the domain to obtain new tickets. This is often a critical step in troubleshooting Kerberos issues, especially when a user’s password has been changed or there are suspected problems with cached credentials. Requires administrator privileges.
After running klist purge, you can check with ‘klist’ that the user has no cached tickets.
4. klist -li <LogonId>
This command displays tickets for a specific logon session. <LogonId>
is a hexadecimal value representing a particular logon session (e.g., 0x3e7
). You can find the LogonId in the output of the basic klist
command. This is useful when multiple users are logged on to the same machine (e.g., via Remote Desktop Services).
5. klist -h
or klist help
This shows a short help about parameters that klist.exe can use.
6. klist keytab
Displays the list of Kerberos keytabs and their entries on a local machine.
Troubleshooting with klist
Here are some common Kerberos troubleshooting scenarios and how klist
can help:
- User cannot access a network resource:
- Run
klist
to check if the user has a valid service ticket for the resource. If not, tryklist purge
and then attempt to access the resource again. - Check the ticket’s
End Time
to ensure it hasn’t expired. - Examine the
Ticket Flags
to see if there are any restrictions preventing access. - Check the
Server
field, make sure user has the right ticket.
- Run
- «Clock skew» errors: Kerberos is very sensitive to time differences between the client and the server. If the clocks are out of sync by more than a few minutes (typically 5 minutes by default), authentication will fail.
klist
can help you see the time the ticket was issued, which can help identify a time synchronization problem. - Password change issues: If a user changes their password and continues to have problems,
klist purge
is often the first step to ensure they are using the new credentials. - Delegation problems: Kerberos delegation allows a service to act on behalf of a user to access other resources.
klist
can show you if the necessary delegation flags are present on the service ticket.
Important Considerations
- Administrator Privileges: While some
klist
commands work without elevated privileges,klist purge
and viewing tickets for other logon sessions require administrator rights. - Time Synchronization: Kerberos relies on accurate time synchronization. Ensure your client and domain controllers are synchronized with a reliable time source.
- SPN Configuration: Service Principal Names (SPNs) must be correctly configured for Kerberos to function properly. Incorrect SPNs can lead to authentication failures.
- Network Connectivity: The client must be able to communicate with the domain controller (specifically the KDC) to obtain tickets.
klist.exe
is a powerful tool for understanding and troubleshooting Kerberos authentication in Windows environments. By mastering its commands and interpreting its output, you can effectively diagnose and resolve a wide range of authentication and access issues.
To view or delete Kerberos tickets you can use the Kerberos List (Klist.exe). The Klist.exe is a command-line tool you can find in the Kerberos resource kit. You can only use it to check and delete tickets from the current logon session.
How to check if Kerberos authentication is enabled in Windows?
To use Kerberos authentication, you must make sure that all the following conditions are true:
- Both the server and the client computers must be members of the same Windows domain or members of trusted domains.
- The server’s service principal name (SPN) must be registered in the Active Directory directory service.
How do I check my Kerberos authentication?
To determine whether a problem is occurring with Kerberos authentication, check the System event log for errors from any services (such as Kerberos, kdc, LsaSrv, or Netlogon) on the client, target server, or domain controller that provide authentication.
Which command is used to check the Kerberos ticket?
The klist command displays the contents of a Kerberos credentials cache or key table.
How do I get my Kerberos tickets?
If PAM is configured properly, a ticket is created automatically when you log in, and you need not do anything special to obtain a ticket. However, you might need to create a ticket if your ticket expires.
20 related questions found
Where are Kerberos settings?
On the domain controller machine, go to Active Directory Users and Computers, locate the account of the machine that you want to configure Kerberos to. In the Properties section, go to the Delegation tab and select Trust this computer for delegation to specified services only and click Add.
How do I refresh Kerberos ticket windows?
When the ticket expires you can no longer read or write to Kerberos authenticated directories like your home directory or research share. If this happens, you can just run “kinit”. It will prompt you for your password, and you’ll get a new ticket valid for the next 9 hours.
Where is my Kerberos ticket stored?
Whenever you go to a service that uses Kerberos, you show that master ticket to the Kerberos server and get a ticket specifically for that service. Then, you show the ticket just for that service to the service to prove who you are. All of those tickets are stored on your local system in what is called a ticket cache.
Where is Kerberos installed Windows?
Settings for Kerberos are specified through a configuration file. You can set up the configuration file as an . ini file in the default location, which is the C:\ProgramData\MIT\Kerberos5 directory.
What is Kerberos authentication in Windows?
Kerberos is a computer network security protocol that authenticates service requests between two or more trusted hosts across an untrusted network, like the internet. It uses secret-key cryptography and a trusted third party for authenticating client-server applications and verifying users’ identities.
Is Windows authentication the same as Kerberos?
The main difference between NTLM and Kerberos is in how the two protocols manage authentication. NTLM relies on a three-way handshake between the client and server to authenticate a user. Kerberos uses a two-part process that leverages a ticket granting service or key distribution center.
What tool to test Kerberos?
Klist.exe—Kerberos List is a command-line tool available in the resource kit. Use it to view and delete Kerberos tickets granted to the current logon session. To use Kerberos List to view tickets, you must run the tool on a computer that’s a member of a Kerberos realm.
Does Windows still use Kerberos?
Kerberos is a protocol for authenticating service requests between trusted hosts across an untrusted network, such as the internet. Kerberos support is built in to all major computer operating systems, including Microsoft Windows, Apple macOS, FreeBSD and Linux.
How do I troubleshoot Kerberos authentication?
So, how can we reproduce the problem?
- Get a command prompt as the “SYSTEM” and attempt to access the remote system. …
- Start the network capture utility.
- Clear all name resolution cache as well as all cached Kerberos tickets. …
- Now you need to run a command that will require authentication to the target server.
How can I check my Windows authentication?
On the taskbar, click Start, and then click Control Panel. In Control Panel, click Programs and Features, and then click Turn Windows Features on or off. Expand Internet Information Services, then World Wide Web Services, then Security. Select Windows Authentication, and then click OK.
Is Kerberos in Active Directory?
Kerberos is used in Active Directory to provide information about the privileges of each user, however it does not perform authorization. It is the responsibility of each service to determine if the user has access to its resources and Kerberos does not validate which resource or service a user can access.
How do I open Kerberos configuration manager?
To view a server’s Kerberos configuration information from the saved file: Select Load.
…
To generate the SPN List from the command line:
- Go to the command line. Note. …
- Switch to the folder that contains KerberosConfigMgr.exe.
- Enter KerberosConfigMgr.exe -q -l .
- For more command-line options, type KerberosConfigMgr.exe -h .
How do I know if my Kerberos ticket is expired?
Resolution
- Connect to the master node using SSH.
- To confirm that the ticket is expired, run the klist command. …
- To confirm the Kerberos principal name, list the contents of the keytab file: …
- To renew the Kerberos ticket, run kinit and specify both the keytab file and the principal: …
- Confirm that the credentials are cached:
How do I clear Kerberos ticket cache?
Deleting Kerberos tickets from the cache
- In the search field, enter Kerberos Tickets .
- From the search results, click Kerberos Tickets.
- From the list of Kerberos tickets, select the Kerberos ticket to delete.
- Click Delete.
What port does Kerberos run on?
Kerberos clients need to send UDP and TCP packets on port 88 and receive replies from the Kerberos servers.
Does Windows use LDAP or Kerberos?
As mentioned before, the Windows Active Directory supports both Kerberos and LDAP; these can be used one at a time or simultaneously as well. By default, Windows uses Kerberos for authentication purposes.
What port uses Kerberos?
Ports 88 and 464 are the standard ports for Kerberos authentication. These ports are configurable. Port 464 is only required for password change operations. Ports 88 and 464 can use either the TCP or UDP protocol depending on the packet size and your Kerberos configuration, see Section 2.2.
How do I monitor Kerberos?
In the Select Monitor menu, click Kerberos 5.
…
Under Test Parameters, enter the monitor testing parameters.
- Enter the IP address or domain name of the resource you want to monitor.
- Enter the UDP port number that the targeted resource responds on. …
- Enter the account realm for the monitored authentication service.
What is Kerberos command?
Kerberos database administration GUI program, which is used to manage principals and policies. /usr/sbin/gsscred. Manage gsscred table entries. /usr/sbin/kadmin. Remote Kerberos database administration program (run with Kerberos authentication), which is used to manage principals, policies, and keytab files.
How do I enable Kerberos in Active Directory?
Configuring Kerberos authentication with Active Directory
- Enter the user’s First name and User logon name.
- Specify the Password and confirm the password. Select the User cannot change password and Password never expires check boxes.
- Verify that you have not selected the Require preauthentication check box.
About
The klist utility display the entries (tickets,..) in the local credentials cache and key table.
Articles Related
Java
Usage: klist [[-c] [-f] [-e] [-a [-n]]] [-k [-t] [-K]] [name]
name name of credentials cache or keytab with the prefix. File-based cache or keytab's prefix is FILE:.
-c specifies that credential cache is to be listed
-k specifies that key tab is to be listed
options for credentials caches:
-f shows credentials flags
-e shows the encryption type
-a shows addresses
-n do not reverse-resolve addresses
options for keytabs:
-t shows keytab entry timestamps
-K shows keytab entry key value
-e shows keytab entry key type
Usage: java sun.security.krb5.tools.Klist -help for help.
MIT kerberos
Usage: klist [-e] [-V] [[-c] [-l] [-A] [-d] [-f] [-s] [-a [-n]]] [-k [-t] [-K]] [name]
-c specifies credentials cache
-k specifies keytab
(Default is credentials cache)
-i uses default client keytab if no name given
-l lists credential caches in collection
-A shows content of all credential caches
-e shows the encryption type
-V shows the Kerberos version and exits
options for credential caches:
-d shows the submitted authorization data types
-f shows credentials flags
-s sets exit status based on valid tgt existence
-a displays the address list
-n do not reverse-resolve
options for keytabs:
-t shows keytab entry timestamps
-K shows keytab entry keys
Windows
C:\Windows\System32\klist.exe
Usage: klist.exe [command]
Command list:
[tickets] [-lh <LogonId.HighPart>] [-li <LogonId.LowPart>]
tgt [-lh <LogonId.HighPart>] [-li <LogonId.LowPart>]
purge [-lh <LogonId.HighPart>] [-li <LogonId.LowPart>]
sessions [-lh <LogonId.HighPart>] [-li <LogonId.LowPart>]
kcd_cache [-lh <LogonId.HighPart>] [-li <LogonId.LowPart>]
get <SPN> [-lh <LogonId.HighPart>] [-li <LogonId.LowPart>]
[-kdcoptions <options>] [-cacheoptions <options>]
add_bind <DOMAIN> <DC>
query_bind
purge_bind
where:
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/klist
Example
klist -f
Credentials cache: C:\Users\gerard\krb5cc_gerard
Default principal: [email protected], 1 entry found.
[1] Service Principal: krbtgt/[email protected]
Valid starting: Jul 10, 2014 10:11:40
Expires: Jul 10, 2014 20:11:40
Flags: INITIAL;PRE-AUTHENT
where:
-
The default principal is your kerberos principal
Flags | Description |
---|---|
F | Forwardable |
f | forwarded |
P | Proxiable |
p | proxy |
D | postDateable |
d | postdated |
R | Renewable |
I | Initial |
i | invalid |
H | Hardware authenticated |
A | preAuthenticated |
T | Transit policy checked |
O | Okay as delegate |
a | anonymous |
What is Kerberos?
Kerberos is an authentication protocol. It is designed for client-server applications and requires mutual verification. It is the default protocol used for logging into a Windows machine that is part of a domain, relies on a secure communication channel between the client and the Domain Controller (DC). Windows updates address security concerns such as vulnerabilities in this channel, ensuring that the user database stored on the DC is protected.
Active Directory (AD) is a component running on the DC that implements the Kerberos account database (containing users and passwords). Kerberos messages are resilient against eavesdropping and replay attacks.
It is important to make sure you manage Kerberos protocol when possible. Since some operations still need to use NTLM, Microsoft hasn’t yet disabled it. The main challenge is finding where you can shift to Kerberos. This hardening task ensures your attack surface is as small as possible. The best approach for this task is using automation. By automating the hardening process and securing your servers you won’t be risking production outages.
Kerberos Ticket and Authentication Explained
It works on the basis of tickets and relies on symmetric-key cryptography to ensure secure communication. Here’s a detailed explanation of how Kerberos authentication works.
Principals and Key Distribution Center (KDC)
In Kerberos, each entity (user or service) is known as a principal. The Key Distribution Center (KDC) acts as a trusted third party responsible for authenticating principals and issuing tickets.
The KDC consists of two main components:
- Authentication Server (AS)
- Ticket Granting Server (TGS)
The AS handles initial authentication requests and issues Ticket Granting Tickets (TGTs), while the TGS provides service tickets for accessing specific services.
Ticket Granting Ticket (TGT)
When a client wants to access a service, it first obtains a TGT from the AS. The TGT is a credential that allows the client to request service tickets without repeatedly authenticating with the AS.
Authentication Process
The authentication process begins when a client sends a request to the AS for authentication. This request typically includes the client’s identity and a request for a TGT. The AS verifies the client’s identity, usually by checking the client’s credentials (e.g., password), and if successful, issues a TGT encrypted with the client’s secret key. The client receives the TGT and stores it securely.
Service Ticket Request
When the client needs to access a specific service, it sends a request to the TGS, presenting the TGT obtained in the previous step. The request includes the desired service’s identifier (typically a service principal name) and a timestamp to prevent replay attacks.
Service Ticket Issuance
The TGS verifies the TGT presented by the client. If valid, the TGS issues a Service Ticket (ST) for the requested service. The TGS generates the ST by encrypting it with the service’s secret key, ensuring only the intended service can decrypt and validate the ticket.
Service Authentication
The client presents the ST to the desired service. The service decrypts the ST using its own secret key and verifies the client’s identity and authorization to access the service. If authentication is successful, the service grants access to the client, establishing a secure session for communication.
Session Establishment
Once authentication is successful, the client and service establish a secure session, allowing encrypted communication, often using keys derived from the exchanged tickets.
Ticket Expiration and Renewal
Tickets issued by the KDC have a limited validity period. Clients need to renew their tickets periodically to continue accessing services without authentication.
Overall, Kerberos authentication provides a robust and secure method for authenticating clients and servers in a networked environment, ensuring that only authorized entities can access protected resources. It employs cryptographic techniques and ticket-based authorization to prevent unauthorized access and protect sensitive information.
What happens inside the KDC?
The KDC includes two servers: 1. An authentication server (AS). 2. Ticket Granting Server (TGS).
When a client wants to verify himself to the KDC, he first connects with the AS. He presents to the AS his User ID, and requests a ticket to the targeted server. This request is partially encrypted with his password’s secret key (so that a plain password won’t be sent over an insecure network). The AS uses the client’s password to decrypt his request. This is how the AS verifies the user.
After verifying the client, the AS sends the client a Ticket Granting Ticket (TGT). The TGT is encrypted with a different secret key.
After the client gets the TGT, he sends it to the TGS along with his request to access the target server. When the TGS receives the TGT, it decrypts it with a secret key that he shares with the AS. The TGS issues a token for the client, that it encrypts with another key. This third key is shared between the TGS and the targeted server.
Finally, the client sends the token to the client-server. The targeted server will decrypt the token with the TGS shared key. Now the client can use the targeted server for a limited time (which is set by the token).
The Kerberos authentication process uses three different secret keys.
1. The first key between the client and the AS is based on the client’s password.
2. The AS and the TGS share another secret key.
3. The TGS and the targeted server.
Kerberos Tickets
As mentioned in the previous section, the client requested and granted a ticket. This method is common and used in other programs such as Secure Shell (SSH).
How to check and delete Kerberos tickets:
To view or delete Kerberos tickets you can use the Kerberos List (Klist.exe). The Klist.exe is a command-line tool you can find in the Kerberos resource kit. You can only use it to check and delete tickets from the current logon session.
If you wish to use it your computer must be a member of a Kerberos realm. The Klist.exe uses the following syntax:
klist \[tickets | tgt | purge\] \[-?\]
We recommend destroying your Kerberos tickets after your use. To do that, you can add the kdestroy command to your .logout file.
How to create a Kerberos ticket
Some scenarios may require you to create. For example, when your ticket expires. To create a ticket using the ‘kinit’ command:
% /usr/bin/kinit
Kerberos Attacks
Kerberos was aiming to present a more secure alternative to other authentication protocols. But due to its popularity, hackers have developed ways to crack it. Here are three iconic Kerberos vulnerabilities:
1.) Kerberos Golden Ticket attack:
Kerberos Golden Ticket is the authentication token for the KRBTGT account. The KRBTGT is a hidden account responsible for encrypting all the authentication tokens for the DC. The Golden Ticket forges the TGT. An attacker can use this Golden Ticket with a Pass-the-Hash attack to move around the network.
2.) Kerberos Silver Ticket Attack:
Silver Tickets are services that forge the Kerberos Ticket Granting Services. That means that they have no communication with the DC. The Silver Ticket’s scope is limited to the specific service it is targeting on a specific server. Although its scope is smaller than the Golden Ticket, the Silver Ticket attack is still powerful. It enables persistence and stealthy access to resources.
3.) DCShadow attack:
This attack uses a feature in Mimikatz to simulate DC behavior. This allows the attacker to inject its own data. The attacker first has to hack into an account with DC credentials to push the data. It is very hard to detect this kind of attack.
Kerberos Hardening Configuration
To minimize Kerberos attack surface there are several baseline hardening actions that you should take:
1. Make sure you use efficient encryption
2. Audit Authentication Service
3. Audit Service Ticket Operations
4. Ensure ‘Support device authentication using certificate’ is set to ‘Enabled: Automatic’
To make sure you don’t miss anything, we recommend using hardening automation when securing Kerberos configurations. Using server hardening automation can help you lower the risk for attacks. CalCom Hardening Suite is the perfect tool for this job.
Skip to end of metadata
Go to start of metadata On this page:
OverviewYou will need to get Tickets (called Kerberos credentials in previous versions of KfW) before you can use applications requiring Kerberos authentication. The MIT installation of KfW 4.0.x is pre-configured with ATHENA.MIT.EDU as the default Kerberos realm.
Get New Kerberos Tickets (Basic)
Delete Tickets
Get New Kerberos Tickets (Advanced)To view additional settings when acquiring a ticket, click the «Show Advanced» button on the Initialize Ticket window. Changing these settings will adjust the acquisition of a ticket, but will not affect any existing tickets. The Advanced Settings revert to the default settings each time Kerberos for Windows is started.
Adjusting Ticket Lifetime
Allowing and Adjusting Ticket Renewal
Related Links |
|