gettgt.py

Kerberos ticket granting ticket requester

TLDR

Get a TGT with a password
$ getTGT.py [domain]/[username]:[password] -dc-ip [dc_ip]
Get a TGT using an NTLM hash
$ getTGT.py [domain]/[username] -hashes :[nthash] -dc-ip [dc_ip]
Get a TGT using an AES key
$ getTGT.py [domain]/[username] -aesKey [aes_key] -dc-ip [dc_ip]
Prompt for the password instead of passing it inline
$ getTGT.py [domain]/[username] -dc-ip [dc_ip]

SYNOPSIS

getTGT.py domain/user[:password] [options]

DESCRIPTION

getTGT.py is an Impacket example script that requests a Kerberos Ticket Granting Ticket (TGT) from an Active Directory domain controller, given a password, an NTLM hash, or an AES key. The official description reads: "Given a password, hash or aesKey, it will request a TGT and save it as ccache."The resulting ticket is written to a ccache file named after the principal (for example `username.ccache`). Set the KRB5CCNAME environment variable to that file and other Impacket tools, or native utilities, can reuse the ticket for pass-the-ticket authentication.There is no dedicated output flag: the ccache filename is derived from the username automatically.

PARAMETERS

DOMAIN/USER[:PASSWORD]

Target identity. The password is optional and is prompted for if omitted.
-dc-ip IP
IP address of the domain controller. Defaults to the domain FQDN if omitted.
-hashes LMHASH:NTHASH
NTLM hashes to authenticate with. The LM half may be left empty (`:NTHASH`).
-aesKey KEY
AES key (128 or 256 bit) for Kerberos authentication.
-k
Use Kerberos credentials from the ccache file (KRB5CCNAME), falling back to the supplied credentials.
-no-pass
Do not prompt for a password, useful together with -k.
-debug
Turn on DEBUG output.
-ts
Add a timestamp to each log line.

CAVEATS

Authorized testing only. Requires valid credentials and clock sync with the domain controller, since large time skew breaks Kerberos. Tickets have a limited lifetime.

HISTORY

getTGT.py is part of Impacket, the Python network protocol toolkit for Active Directory security testing, originally by Core Security and now maintained by Fortra.

SEE ALSO

getuserspns.py(1), kerberos(7), kinit(1)