Kerberos Ticket Reuse from Linux
Domain-joined Linux hosts maintain Kerberos ticket caches that can be stolen and reused to authenticate to Active Directory services (SMB shares, MSSQL, HTTP services, and other Kerberos-integrated resources) without knowing any password. Keytab files go further: they contain the encrypted key material needed to request fresh tickets at any time.
This page covers locating, validating, and using ccache files and keytabs found on a Linux host. Detecting whether a host is domain-joined and finding these files is covered in the post-exploitation section.
Confirming Kerberos Configuration
The default_realm field gives you the domain name. The kdc entries point to the domain controller. Both are needed for tool configuration.
If klist returns ticket information, the current session already has a valid TGT. If it returns No credentials cache found, you need to load one.
Finding ccache Files
Ticket caches are stored in files or memory-backed locations:
Also check the environment for a non-default cache location:
Inspecting a ccache File
Before using a cache, check its contents and expiry:
Credentials cache: FILE:/tmp/krb5cc_1000
Principal: svc_backup@CORP.LOCAL
Issued Expires Principal
Mar 14 08:23:01 2024 Mar 14 18:23:01 2024 krbtgt/CORP.LOCAL@CORP.LOCAL
Mar 14 08:23:05 2024 Mar 14 18:23:05 2024 cifs/fileserver.corp.local@CORP.LOCAL
A TGT (krbtgt/) that has not expired is usable. Service tickets (cifs/, http/, mssql/) are for specific services. An expired TGT cannot be renewed without the original credentials, but you can still use valid service tickets until they expire.
Requesting a TGT with Credentials
When you recover a plaintext password or NT hash but no ticket file exists on disk, request a TGT directly. impacket-getTGT authenticates to the KDC and writes a .ccache file you can use with any Kerberos-aware tool.
With a password:
[*] Saving ticket in $USER.ccache
With an NT hash (pass-the-hash to Kerberos):
[*] Saving ticket in $USER.ccache
Explain command
| -hashes | LMHASH:NTHASH format. Leave LMHASH empty for NTLM-only. |
With an AES key (from a DCSync or keytab extraction):
[*] Saving ticket in $USER.ccache
Set the output ccache as your active ticket and continue with lateral movement tools:
Using a ccache for Lateral Movement
Set KRB5CCNAME to point at the stolen cache, then use Impacket tools to authenticate:
List SMB shares on a domain host:
Get a shell via SMB:
Connect to MSSQL:
-k tells Impacket to use Kerberos authentication. -no-pass skips the password prompt and uses the ccache.
For SMB access with nxc:
Finding and Using Keytab Files
Keytabs contain the account's long-term key and can generate fresh tickets at any time: they do not expire like ccache files.
Common locations:
/etc/krb5.keytab: machine account keytab, readable by root/etc/security/*.keytab: service account keytabs/opt/*/conf/*.keytab: application service keytabs (Tomcat, Hadoop, Kafka)
Inspect a keytab:
Keytab name: FILE:/etc/krb5.keytab KVNO Principal 2 host/webserver.corp.local@CORP.LOCAL 2 HTTP/webserver.corp.local@CORP.LOCAL
Request a TGT using the keytab:
Once you have a TGT, use it with Impacket tools as shown above. The machine account keytab (host/) gives you a computer account TGT: useful for querying AD and accessing resources the computer account has rights to.
Pass the Ticket with Impacket
If you have a ccache file from a high-value account (a service account, domain admin, or DA), use it directly:
This dumps credentials from the domain controller using the stolen ticket. For the full pass-the-ticket and lateral movement workflow, see Pass the Hash and Pass the Ticket and AD Remote Execution.
Converting Ticket Formats
Windows tools (Rubeus, Mimikatz) export tickets in .kirbi format. Linux tools (Impacket, nxc) expect .ccache. When you exfiltrate a ticket from a Windows host or need to inject a Linux-obtained ticket into a Windows session, convert between formats with impacket-ticketConverter.
Convert .kirbi to .ccache (Windows ticket for use on Linux):
[*] Converting kirbi to ccache [+] Done
Convert .ccache to .kirbi (Linux ticket for use on Windows):
[*] Converting ccache to kirbi [+] Done
After conversion, set KRB5CCNAME to the .ccache path for Linux tools. On Windows, import the .kirbi with Rubeus.exe ptt /ticket:ticket.kirbi or kerberos::ptt ticket.kirbi in Mimikatz.
Extracting the Hash from a Keytab
The key material inside a keytab is the NT hash equivalent for the account. Extract it with:
The extracted NT hash can be used for pass-the-hash attacks against Windows services.
References
-
MIT Kerberos DocumentationLINK: MIT Kerberos Documentation, web.mit.edu/kerberos/krb5-latest/doc/user/tkt_mgmt.html (opens in new tab)
Ticket Management Reference for klist, kinit, and kdestroy operations.
-
GitHub Impacket toolkit: Python implementations of network protocols including Kerberos-authenticated SMB, MSSQL, and secretsdump.
-
GNU Shishi ManualDOCS: GNU Shishi Manual, www.gnu.org/software/shishi/manual/shishi.html (opens in new tab)
Background reference on Kerberos ccache file format and keytab structure.