All commands within Titanis that authenticate over the network accept a uniform set of authentication parameters that supports a variety of authentication scenarios. When building an authentication context, Titanis attempts to build a context for both NTLM and Kerberos. If both contexts are available, Titanis wraps them in an SP-Nego context. If only one context is available, Titanis does not wrap it in SP-Nego unless the application protocol requires it (such as SMB2).
Other than the system clock, Titanis uses only the information in the command
line and certain environment variables for authentication; it does not use any
information from your current session, such as the name of your user account
or the name of your workstation. Use -Workstation to specify the name to
report as your workstation during authentication (NTLM and Kerberos).
- Commands have built-in support for Kerberos; you do not need to request tickets prior to running a command.
- All commands accept tickets as either a .kirbi or .ccache file. No conversion necessary is necessary.
- The
-TicketCacheparameter may be specified either explicitly on the command line or taken from theKRB5CCNAMEenvironment variable.- Titanis commands work best if you maintain a ticket cache per user and set
KRB5CCNAMEto this file. - Tickets are requested as necessary and added to the ticket file and reused in subsequent commands.
- If a ticket file contains tickets for multiple users, use
-UserNameto filter which tickets are used. - Titanis skips tickets that are outside their validity period.
- Titanis commands work best if you maintain a ticket cache per user and set
- Ticket files specified with
-Tgtor-Ticketare never modified.- If a file contains both a TGT and a service ticket, you may specify the same file for both parameters.
- If you specify a ticket file (
-Tgt,-Ticket, or-TicketCache) without specifying a user name or realm, Titanis searches for the first usable ticket. 1. - Ticket files specified with
-TicketCacheare updated to include any tickets requested during authentication.- If the file doesn't exist, it is created. If the extension is
.ccacheit is created as a ccache file; otherwise as a kirbi file. - If it does exist, Titanis detects and retains the format of the file regardless of the extension.
- If the file is modified outside of the Titanis command (detected by last modified time) while the Titanis command is running, Titanis does NOT overwrite the file.
- If the file doesn't exist, it is created. If the extension is
- If a command requires multiple tickets, it will use the tickets in the specified ticket files and request missing tickets from the KDC (if specified).
- Titanis automatically handles inter-realm referrals.
- It determines the KDC of the next realm by resolving the realm name using DNS; it does not query for the SRV record.
- When a certificate is specified, the certificate may be in either
.pfxor.pemformat. If the.pemfile does not contain the key, there is a corresponding -XxKey argument (e.g.-UserCertand-UserKey).
| If you have... | then use... | Supports | Notes |
|---|---|---|---|
| Nothing | -Anonymous |
NTLM | Use with -vv to get the domain and computer name of a server. |
| User name with... | -UserName <username> |
The domain is inferred from the NTLM_CHALLENGE message. | |
| ...password | -Password <password> |
NTLM | Be sure to escape special characters as required by your shell. |
| ...NTLM hash | -NtlmHash <hex-encoded hash> |
NTLM | Use just the NTLM hash; no colons |
| User name and domain with... | -UserName <domain>\<username> |
You may need to escape the backslash depending on your shell. The domain name may be either the NetBIOS name or FQDN. | |
-UserName <username>@<domain> |
|||
-UserName <username> -UserDomain <domain> |
|||
| ...password | -Password <password> |
NTLM, Kerberos | Be sure to escape special characters as required by your shell. |
| ...NTLM hash | -NtlmHash <hex-encoded hash> |
NTLM, Kerberos (RC4 HMAC only) | Use just the NTLM hash; no colons. |
| ...AES 128 key | -AesKey <hex-encoded hash> |
Kerberos (AES128) | AES 128 and AES 256 are distinguished by the size of the key. |
| ...AES 256 key | -AesKey <hex-encoded hash> |
Kerberos (AES256) | |
| Ticket-granting ticket and KDC | -Tgt <TGT file name> -Kdc <endpoint> |
Kerberos | Titanis requests the necessary service tickets from the KDC. |
-TicketCache <TGT file name> -Kdc <endpoint> |
Kerberos | Titanis requests the necessary service tickets from the KDC. | |
| Service ticket | -Ticket <ticket file name> |
Kerberos | The SPN of the ticket must match what the command requires. |
-TicketCache <ticket file name> |
Kerberos | The SPN of the ticket must match what the command requires. | |
| Certificate file as a ... | |||
| ... .pfx with certificate and key | -UserCert <.pfx file> -UserKeyPassword <passphrase> |
Kerberos | -UserKeyPassword is used to decrypt the file and is only required if the file is encrypted. |
| ... .pem with certificate and key | -UserCert <.pem file> -UserKeyPassword <passphrase> |
Kerberos | -UserKeyPassword is used to decrypt the file and is only required if the file is encrypted. |
| ... .pem with certificate and separate .key | -UserCert <.pem file> -UserKey <.key file> -UserKeyPassword <passphrase> |
Kerberos | -UserKeyPassword is used to decrypt the file and is only required if the file is encrypted. |
The Authentication parameter group defines parameters that specify how the tool is to authenticate with the target. Most protocols exchange security tokens to build a security context to authenticate the user and provide message security services, such as signing and sealing. The parameters specify how to build this security context. Titanis supports the following security protocols:
- NTLM
- Kerberos
- SPNEGO
Some protocols require a specific security protocol. For example, SMB2 requires SPNEGO, which itself may enclose both NTLM and Kerberos. Some protocols, such as RPC, will accept a number of security protocols along with a field in the header that specifies how to interpret the tokens. Titanis will use the provided parameters to build the appropriate type of security context. If the parameters support multiple security protocols and the application protocol supports SPNEGO, Titanis prepares a security context for each supported security protocol and wraps them in an SPNEGO context.
In general, to use Kerberos, you must specify the KDC address with -Kdc. If no ticket is in the cache, Titanis will attempt to contact the KDC to request a ticket.
| Parameter | Description |
|---|---|
-Workstation <name> |
Name of the workstation to send along with the authentication request. Windows uses this to evaluate logon restrictions and usually includes it in the event log record for the authentication request. |
-NtlmVersion <m.n.b.r> |
Version number to send in NTLM |
Titanis commands integrate support for Service-for-user-to-self (S4U2self) and Service-for-user-to-proxy (S4U2proxy) scenarios. S4U allows you to use a service account to obtain a service ticket for and impersonate a user account when you don't have credentials for that user account.
| Parameter | Description | Note |
|---|---|---|
-S4UserName <user name> |
Name of user to impersonate | If the user name does not include the domain, then the domain of the service is assumed. |
-S4UserCert <certificate file name> |
X.509 certificate identifying user to impersonate | |
-S4ProxyService <service account> |
Name of service account to proxy through | May be specified as <class>/<host> or <account name> |
- Only one of
-S4UserNameor-S4UserCertare required for S4U.- If both are specified, they must agree.
- The presence of
-S4ProxyServiceindicates S4U2proxy.- Otherwise, S4U2self is used.
- S4U may be combined with any Kerberos authentication scenario above.
- The provided credentials must be for the service account, not the user to impersonate.
- At each step in the sequence, Titanis checks the ticket files provided by
-Tgt,-Ticket, and-TicketCachefor the desired ticket. - If the desired ticket is found, it is used, and the KDC is not contacted for that step.
To test S4U (or any authentication scenario), consider using Lsa whoami. This
command prints name of the user that authenticates to it. It accepts the usual
authentication parameters.
The full S4U2self sequence is as follows:
- Request TGT for
-UserNameusing credential specified by-Password,-NtlmHash, or-AesKey. - Use TGT to request a service ticket to the service required by the command.
- Use S4U2self to request a ticket for the user specified by
-S4User*to the service required by the command.
The full S4U2proxy sequence is as follows:
- Request TGT for
-UserNameusing credential specified by-Password,-NtlmHash, or-AesKey. - Use TGT to request a service ticket to the service specified by
-S4ProxyService. - Use S4U2self to request a ticket for the user specified by
-S4User*to the service specified by-S4ProxyService. - Use S4U2proxy to request a ticket for the user specified by
-S4User*to the service required by the command.
Let's say you have a TGT for COBEL-WKS$ and wish to impersonate user milchick.
Smb2Client ls \\LUMON-FS1\C$ -UserName allentown@LUMON -Password password -Kdc 10.66.0.11 -S4UserName milchick -S4ProxyService host/allentown
This command:
- Requests a TGT for user
allentown(or retrieves one from the cache) - Requests a service ticket for user
milchickto the proxy servicehost/allentownusing S4U2self. - Using the S4U2self ticket from above, requests a service ticket for user
milchicktocifs/LUMON-FS1.
- You may specify one or both of the
-S4User*parameters. If you specify both-S4UserNameand-S4UserCert, they must match; otherwise, the KDC will likely fail the request. - During testing, when specifying
-S4UserCert, the DC takes considerably longer to respond (around 10 seconds). - The name supplied to
-S4ProxyServicemay be of the form<class>/<instance>or simply the service account name.