Pass the Ticket from Linux
π― Overview
Pass the Ticket from Linux extends Kerberos abuse techniques to Linux environments integrated with Active Directory. Unlike Windows-only attacks, Linux machines can also participate in AD domains and store Kerberos tickets that can be stolen and abused for lateral movement.
Key Concepts
Linux AD Integration - Domain-joined Linux machines using SSSD, Winbind, or similar
ccache Files - Credential cache files storing Kerberos tickets (usually in
/tmp)Keytab Files - Files containing Kerberos principals and encrypted keys for authentication
Cross-Platform Attacks - Using Linux tools to attack Windows AD infrastructure
π§ Linux Active Directory Integration
Common Integration Methods
# Authentication services
β
SSSD (System Security Services Daemon)
β
Winbind (Samba component)
β
FreeIPA with AD trust
β
Direct Kerberos configurationIdentifying Domain-Joined Linux Machines
Method 1: Using realm command
Method 2: Process inspection
Method 3: Configuration files
π Keytab Files
What are Keytab Files?
Keytab files contain pairs of Kerberos principals and encrypted keys, allowing authentication without interactive password entry. They're commonly used for:
Automated scripts requiring Kerberos authentication
Service accounts for unattended access
Computer accounts for domain communication
Finding Keytab Files
Search by filename pattern
Search in automated scripts
Keytab File Analysis
Reading keytab information
Using keytab for authentication
Extracting Secrets from Keytab Files
KeyTabExtract Tool
Hash Cracking
πΎ ccache Files (Credential Cache)
Understanding ccache Files
ccache files are temporary credential caches that store active Kerberos tickets. They remain valid during user sessions and are automatically created upon domain authentication.
Finding ccache Files
Environment variable check
Search /tmp directory
Abusing ccache Files
Root privilege requirement
Importing ccache files
π οΈ Essential Linux Kerberos Tools
kinit - Request tickets
klist - List tickets
kdestroy - Remove tickets
π Using Linux Attack Tools with Kerberos
Requirements for Remote Attacks
Network connectivity to KDC/Domain Controller
DNS resolution for domain names
Proper /etc/hosts entries if DNS unavailable
Proxychains setup if attacking through pivot
Setting up Attack Environment
/etc/hosts configuration
Proxychains configuration
Chisel tunnel setup
Impacket with Kerberos
Basic usage
Example session
Evil-WinRM with Kerberos
Prerequisites installation
Configuration file
Usage example
π Ticket Conversion (ccache β kirbi)
impacket-ticketConverter
ccache to kirbi (Linux β Windows)
kirbi to ccache (Windows β Linux)
Using converted tickets
On Windows:
On Linux:
π Advanced Tool: Linikatz
Overview
Linikatz is a Linux equivalent of Mimikatz, designed to extract credentials from various Linux AD integration systems including FreeIPA, SSSD, Samba, and Vintella.
Installation and usage
What Linikatz extracts
Kerberos tickets from multiple implementations
Cached credentials from SSSD
Machine secrets from Samba
Various ticket formats (ccache, keytab)
Example output
π― HTB Academy Lab Exercises
Lab Environment
Target: Linux machine accessible via SSH port 2222
Initial Access: david@inlanefreight.htb : Password2
Connection:
ssh david@inlanefreight.htb@TARGET_IP -p 2222
Exercise 1: Initial Access
Question: "Connect to the target machine using SSH to the port TCP/2222 and the provided credentials. Read the flag in David's home directory."
Exercise 2: Group Identification
Question: "Which group can connect to LINUX01?"
Answer: Linux Admins
Exercise 3: Keytab Discovery
Question: "Look for a keytab file that you have read and write access. Submit the file name as a response."
Answer: carlos.keytab
Exercise 4: Keytab Hash Extraction
Question: "Extract the hashes from the keytab file you found, crack the password, log in as the user and submit the flag in the user's home directory."
Exercise 5: Service Account Discovery
Question: "Check Carlos' crontab, and look for keytabs to which Carlos has access. Try to get the credentials of the user svc_workstations and use them to authenticate via SSH. Submit the flag.txt in svc_workstations' home directory."
Answer: Password4 β SSH access β flag in home directory
Exercise 6: Privilege Escalation
Question: "Check the sudo privileges of the svc_workstations user and get access as root. Submit the flag in /root/flag.txt directory as the response."
Answer: Ro0t_Pwn_K3yT4b
Exercise 7: ccache File Abuse
Question: "Check the /tmp directory and find Julio's Kerberos ticket (ccache file). Import the ticket and read the contents of julio.txt from the domain share folder \DC01\julio."
Answer: JuL1()_SH@re_fl@g
Exercise 8: Computer Account Ticket
Question: "Use the LINUX01$ Kerberos ticket to read the flag found in \DC01\linux01. Submit the contents as your response (the flag starts with Us1nG_)."
Answer: Us1nG_KeyTab_Like_@_PRO
Key Lab Details
Exact File Locations
Hash Values and Passwords
ccache File Patterns
Computer Account Authentication
Flag Answers Summary
Exercise 1: Flag in david's home directory
Exercise 2: Linux Admins
Exercise 3: carlos.keytab
Exercise 4: C@rl0s_1$_H3r3
Exercise 5: Flag in svc_workstations home
Exercise 6: Ro0t_Pwn_K3yT4b
Exercise 7: JuL1()_SH@re_fl@g
Exercise 8: Us1nG_KeyTab_Like_@_PRO
Success Validation
Optional Exercises
Proxychains + Evil-WinRM Setup
Cross-Platform Ticket Conversion
π‘οΈ Detection and Defense
Detection Indicators
Defensive Measures
π Related Techniques
Attack Chain Summary
Tool Comparison
kinit
Request tickets
Valid credentials
ccache
klist
List tickets
Read access
Text output
KeyTabExtract
Extract hashes
Keytab file
NTLM/AES hashes
Linikatz
Full extraction
Root access
Multiple formats
impacket-ticketConverter
Convert tickets
Ticket file
ccache/kirbi
π References
HTB Academy: Password Attacks - Pass the Ticket from Linux
KeyTabExtract: Tool for extracting secrets from keytab files
Linikatz: Linux credential extraction tool by Cisco
Impacket: Python library for network protocol attacks
Evil-WinRM: PowerShell remoting tool with Kerberos support
Last updated