Skip to content

Impacket describeTicket.py

Back to the Category Index / Back to the Command Index

Reads tickets in ccache or kirbi format and, when a key is available, decrypts and displays the encrypted parts and PAC.

ItemDetails
Implementationexamples/describeTicket.py
CategoryKerberos / Ticket Handling
Size771 lines
DistributionInstalled as a script through scripts=examples/*.py in setup.py

Check python examples/describeTicket.py -h for the current option definitions.

ArgumentDescription
ticketPath to ticket.ccache.
-debugEnable debug logging.
-tsAdd timestamps to log output.
-p / --passwordPlaintext password of the service account.
-hp / --hex-passwordHex-encoded password of the service account.
-u / --userService account name.
-d / --domainFully qualified domain name.
-s / --saltSalt for key derivation (DOMAIN.LOCALSomeuser for users; DOMAIN.LOCALhostsomemachine.domain.local for machines).
--rc4RC4 key (for example, an NT hash).
--aesAES-128 or AES-256 key.
--asrep-keyAS reply key for decrypting PAC credentials.

The command detects the input format, reads the ticket and metadata, and derives candidate keys from a password, hex password, RC4/AES key, or AS-REP key. After decrypting the ticket’s encrypted part, it parses PAC buffers by type and displays SIDs, groups, flags, checksums, and times. It can also produce Kerberoast output from a ccache.

A ticket file contains an encrypted ticket and the session key and principal metadata needed to use it. For a ccache, the command reads the ticket, client and server principals, and session key from credential entries. For kirbi/KRB-CRED, it decodes the enc-part and normalizes the equivalent information. Detecting the container format is the first parsing stage.

Reading the ticket’s enc-part requires the service principal’s long-term key. The command can derive keys from a password with the domain/user salt, accept RC4 or AES keys directly, or use an AS-REP key. It tries only candidate keys matching the ticket’s enctype and key usage. A checksum failure means the key, salt, or principal information does not match; it is not a parsing failure.

After decryption, the command displays EncTicketPart flags, times, and authorization data. If a PAC is present, it traverses the buffer directory to expand group memberships, SIDs, UPN/DNS data, client and device claims, device information, checksums, and more. It parses uncompressed claims and reports that unsupported compressed formats cannot be decoded. It converts PAC FILETIME values, NDR pointers, and flags for display while keeping raw values traceable for investigating unknown extensions.

SymbolLocationEntry Point for Tracing Behavior
User_Flags46Structure and constant definitions
SE_GROUP_Attributes51Structure and constant definitions
USER_ACCOUNT_Codes57Structure and constant definitions
UF_FLAG_Codes82Structure and constant definitions
Upn_Dns_Flags109Structure and constant definitions
Attributes_Flags114Structure and constant definitions
parse_ccache()220Module function
parse_pac()355Module function
kerberoast_from_ccache()670Module function
parse_args()713Module function
main()758Module function
ModuleMain Names Used
impacketversion
impacket.dcerpc.v5.dtypesFILETIME, PRPC_SID
impacket.dcerpc.v5.rpcrtTypeSerialization1
impacket.exampleslogger
impacket.krb5constants, pac
impacket.krb5.asn1AD_IF_RELEVANT, EncTicketPart, TGS_REP
impacket.krb5.ccacheCCache
impacket.krb5.constantsChecksumTypes
impacket.krb5.cryptoInvalidChecksum, Key, _enctype_table, generate_kerberos_keys
impacket.ldap.ldaptypesLDAP_SID
Import NameDistribution PackageUsage / Declaration Status
CryptodomepycryptodomexImported directly; declared dependency
pyasn1pyasn1Imported directly; declared dependency

Output, Side Effects, and Required Privileges

Section titled “Output, Side Effects, and Required Privileges”
  • The main operation parses a local file. Treat input as untrusted: validate offsets, lengths, and format identifiers before accessing data.
  • On failure, use protocol status to determine whether name resolution, connection, authentication, service state, or permissions stopped the operation.

This command depends on krb5.ccache / asn1 / crypto / pac, pyasn1, Cryptodome.Hash.MD4, and the LDAP SID helper. parse_ccache() and parse_pac() are the format boundaries.