Kerb tool provides Kerberos authentication operations: requesting TGTs and service tickets, changing and setting passwords, renewing tickets, generating string-to-key protocol keys, and inspecting or converting ticket files.
Subcommands
| Command | Description |
|---|---|
| asreq | Request a TGT from the KDC |
| getasinfo | Get server time and encryption types for a user account |
| tgsreq | Request a service ticket from the KDC |
| renew | Renew a ticket |
| select | Select and display tickets from a file |
| changepw | Change an account password |
| setpw | Set the password of another account |
| s2k | Generate a protocol key from a string such as a password |
For help on any subcommand, run
Kerb <subcommand> -h.If the
KRB5CCNAME environment variable is set, commands that accept -TicketCache will use it automatically when no explicit ticket source is provided.asreq
Sends an AS-REQ to the KDC to request a ticket-granting ticket (TGT). You must supply credentials — a password, NTLM hash, AES key, or DES key — used for pre-authentication and to decrypt the response. You may also use PKINIT with a certificate and key file. The encryption type of the response depends on which credential you provide. Use-EncTypes to restrict which encryption types the KDC can use.
If you don’t specify any ticket options, Kerb asreq uses defaults: a ticket expiring 10 hours from now with the Canonicalize, RenewableOk, Renewable, and Forwardable options. Specifying any option disables these defaults.
Parameters
Parameters
Kerberos options
Kerberos options
Encryption types to request in the response. Possible values:
DesCbcMd5, DesCbcCrc, Rc4Hmac, Rc4HmacExp, Aes128CtsHmacSha1_96, Aes256CtsHmacSha1_96.Password for pre-authentication.
NTLM hash (hex-encoded, no colons). Specify only the NTLM portion.
AES-128 or AES-256 key (hex-encoded).
DES key (hex-encoded).
Name of the realm (domain).
Name of the client workstation.
Request a forwardable ticket.
Request a renewable ticket.
Request a ticket renewable until this time (implies
-Renewable).Requested ticket expiry time.
Request a post-dated ticket with this start date.
Accept a renewable ticket if the requested end time exceeds the KDC limit.
Path to the user certificate file (for PKINIT).
Path to the user key file (for PKINIT).
Password to decrypt the user key file (for PKINIT).
Name of the ticket cache file to write the TGT to.
SPNs to request tickets for.
Output
Output
File to write the ticket to.
Overwrite the output file if it exists.
Append to the output file if it exists.
Output format:
Freeform, Raw, Table, List, Csv, Tsv, Json.Comment to associate with the ticket.
Print verbose messages.
Examples
getasinfo
Sends an AS-REQ without credentials and inspects the KDC error response. Typically the KDC responds withKDC_ERR_PREAUTH_REQUIRED and includes its current time and the valid encryption types and salts for the account.
Use this command to:
- Verify that a user name exists in a domain
- Determine which encryption types an account supports
- Retrieve the correct salt before generating an AES key with
Kerb s2k - Check whether an account requires pre-authentication (required for AS-REP roasting)
Kerb asreq to capture and analyze the ticket.
Parameters
Parameters
Options
Options
Name of the realm (domain).
Fields to display. Possible values:
EType, SaltText, SaltHex.Output format:
Freeform, Raw, Table, List, Csv, Tsv, Json.Network address(es) of the server.
SOCKS5 proxy endpoint.
Examples
tgsreq
Sends a TGS-REQ to the KDC to request a service ticket. You may specify the target as a service principal name (<class>/<instance>) or as the account name itself (the $ is optional for machine accounts — LUMON-FS1, LUMON-FS1$, and host/LUMON-FS1 all work).
Service tickets retrieved with RC4-HMAC encryption produce Kerberoastable hashes. Use -OutputFields TgsrepHashcatMethod, TicketHash to extract the hash for offline cracking.
Parameters
Parameters
Kerberos options
Kerberos options
Path to a TGT file (.kirbi or ccache).
Ticket cache file to use as the TGT source.
Encryption types to request. Possible values:
Rc4Hmac, Aes128CtsHmacSha1_96, Aes256CtsHmacSha1_96, and others.User to impersonate with S4U2self.
Service account to proxy through with S4U2proxy.
Path to a U2U ticket file.
Encryption key from the AS-REP, used to decrypt the NTLM hash from authorization data.
Password for the service account (for decrypting authorization data).
Salt for the service account (for decrypting authorization data).
Request a forwardable ticket.
Request a forwarded ticket.
Request a renewable ticket.
Requested ticket expiry time.
Realm of the KDC.
Output
Output
File to write the ticket to.
Overwrite the output file if it exists.
Append to the output file if it exists.
Fields to display. Include
TgsrepHashcatMethod and TicketHash to extract Kerberoastable hashes.Comment to associate with the ticket.
SOCKS5 proxy endpoint.
Examples
renew
Sends a renewal request to the TGS for the specified ticket. The ticket must have been issued as renewable. You may supply the source ticket via-Ticket (a file) or -TicketCache. When using -TicketCache, you must specify -TargetSpn to identify which ticket to renew. When using -Ticket, -TargetSpn is optional and filters which tickets to renew.
Parameters
Parameters
Options
Options
Path to a ticket file (.kirbi or ccache).
Ticket cache file.
New expiry time for the renewed ticket.
Request a forwardable ticket.
Request a renewable ticket.
Request a ticket renewable until this time.
File to write the renewed ticket to.
Overwrite the output file if it exists.
Append to the output file if it exists.
SOCKS5 proxy endpoint.
Examples
select
Reads tickets from one or more.kirbi or .ccache files, optionally filters them, and optionally writes the results to a new file. Use this command to inspect, convert, combine, or filter ticket files.
If the KRB5CCNAME environment variable is set and you don’t specify -From, Kerb select reads from the ticket cache it points to. Specifying -From explicitly bypasses KRB5CCNAME.
Parameters
Parameters
File names or glob patterns to read tickets from. Accepts multiple values and wildcards.
Ticket source
Ticket source
Ticket cache file. Ignored if
-From is specified.Output
Output
Target file to write selected tickets to.
Overwrite the target file if it exists.
Print ticket authorization data (if decrypted).
Fields to display. Available:
SourceFileName, SeqNbr, Comment, ClientName, ClientRealm, TicketRealm, TargetSpn, ServiceClass, ServiceInstance, ServiceRealm, KdcOptions, EndTime, StartTime, RenewTill, AsrepKeyText, TicketKeyText, SessionEType, SessionKeyText, TicketEType, TgsrepHashcatMethod, TicketHash, IsCurrent, SecurityGroups, NtlmHashText.Output format:
Freeform, Raw, Table, List, Csv, Tsv, Json.Ticket filter
Ticket filter
Select only currently-valid tickets.
Regex patterns to match ticket SPNs.
Regex patterns to match the client name.
Filter for ticket encryption type.
Filter for session key encryption type.
Sequence number or range (e.g.
1, 3-5, 7-*).Invert the filter — select tickets that don’t match.
Examples
changepw
Changes the password of the authenticating user using the Kerberos Change Password protocol. This command can only change the password of the account being used to authenticate — not another account’s password. To set another account’s password, usesetpw.
This protocol requires an initial ticket from an AS-REQ/AS-REP exchange, so credentials are required and a pre-existing ticket cannot be passed as input.
Parameters
Parameters
Examples
setpw
Sets the password of a user account using the Windows 2000 Kerberos Change Password protocol (RFC 3244). Unlikechangepw, this command can set the password of a different account and does not require an initial ticket.
Parameters
Parameters
Account whose password you want to set (e.g.
[email protected]).New password to set.
Authentication
Authentication
User name to authenticate with.
Password to authenticate with.
NTLM hash for NTLM authentication.
KDC endpoint.
Path to a TGT file (.kirbi or ccache).
Ticket cache file.
AES key (128 or 256).
SOCKS5 proxy endpoint.
Network address(es) of the server.
Examples
s2k
Generates Kerberos protocol keys from a string (such as a password) using the string-to-key function defined for each encryption type. For Windows domains, the salt for a user account is the FQDN of the domain in uppercase followed by the account name, computed at the time of the last password change. If the account has been renamed, the salt retains the old name until the password changes again. UseKerb getasinfo to retrieve the correct salt for an account.
Parameters
Parameters
The string to derive keys from (e.g. a password).
Salt as a string. For Windows users, typically the domain FQDN concatenated with the account name.
Encryption types to generate keys for. Possible values:
Rc4Hmac, Aes128CtsHmacSha1_96, Aes256CtsHmacSha1_96, and others. Defaults to all supported types.Examples
The domain name in the salt must be the FQDN (e.g.
LUMON.IND), not the shorter NetBIOS name.