Skip to content

Back to the Category Index / Back to the Command Index

Uses an RODC number and key to send Kerberos Key List requests for the long-term keys of specified or enumerated accounts.

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

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

ArgumentDescription
target[[domain/]username[:password]@]<KDC HostName or IP address>. Use these low-privilege credentials to authenticate over SMB and list domain users, or use LIST to parse a target file.
-rodcNoRODC krbtgt account number.
-rodcKeyRead-only domain controller AES key.
-fullRun against all domain users. This is noisy and may cause more TGS requests to be rejected.
-debugEnable debug logging.
-tsAdd timestamps to log output.
-domainFully qualified domain name (LIST mode only).
-kdcKDC hostname or FQDN (LIST mode only).
-tTarget only the specified username (LIST mode only).
-tfFile listing target usernames (LIST mode only).
-domain-sidDomain SID to put in the PAC in LIST mode. Recommended for domain controllers that strictly validate PACs.
-hashesUse NTLM hashes to authenticate over SMB and list domain users.
-no-passSkip the password prompt (useful with -k).
-kUse Kerberos over SMB to list domain users. Read credentials from the ccache (KRB5CCNAME) based on the target; fall back to command-line credentials if none are valid.
-aesKey128- or 256-bit AES key for Kerberos authentication.
-dc-ipDomain controller IP address. Defaults to the domain (FQDN) in target.
-target-ipTarget machine IP address. Defaults to target; useful when the target is a NetBIOS name that cannot be resolved.

Related technology: KERB_KEY_LIST_REQ in Kerberos and KeyListSecrets in DPAPI / SAM / LSA / NTDS.

The command validates the credentials and RODC information, enumerates domain users through LDAP/DRS if needed, sends a key-list request to the KDC for each target user, and displays decrypted key material. -t / -tf and -full change how targets are selected.

In LIST mode, the command does not automatically obtain the domain SID from SAMR; specify -domain-sid if PAC validation causes the request to be rejected.

An RODC can limit which account secrets it holds. Kerberos Key List requests return a list of account keys under the conditions of an RODC ticket and the required privileges. The command uses the RODC number and krbtgt key to build the required Kerberos material and requests a key list for each target principal.

Targets come from one username, a file, or a domain user list obtained with -full. Enumeration and KDC requests are separate paths, so failure to enumerate through LDAP/DRS does not invalidate explicitly supplied targets. Requests involve the RODC identity, ticket, nonce, and supported enctypes; the encrypted response part is decrypted with the established key and correct key usage.

Returned keys differ in meaning by account, enctype, and key version. Distinguish receiving one response from retrieving every requested key for every requested account. Diagnose separately an uncached RODC secret, a replication-policy denial, and a mismatched KVNO or RODC number.

SymbolLocationEntry Point for Tracing Behavior
KeyListDump49__init__(), connect(), run(), getAllDomainUsers()
ModuleMain Names Used
impacket.exampleslogger
impacket.examples.secretsdumpKeyListSecrets, RemoteOperations
impacket.examples.utilsparse_target
impacket.krb5constants
impacket.krb5.typesPrincipal
impacket.smbconnectionSMBConnection
impacketversion
Import NameDistribution PackageUsage / Declaration Status
pyasn1pyasn1Imported directly; declared dependency

Output, Side Effects, and Required Privileges

Section titled “Output, Side Effects, and Required Privileges”
  • Primarily queries and authentication attempts. Repeated runs can affect audit logs, account lockouts, and target load.
  • Depending on options, creates or updates a local file. Check how existing files are handled and the permissions on output containing secrets.
  • On failure, use protocol status to determine whether name resolution, connection, authentication, service state, or permissions stopped the operation.

This command depends on Kerberos ASN.1/crypto, LDAP/DRS, and SMB/RPC helpers. KeyListDump.connect(), getAllDomainUsers(), and run() are the main boundaries. Preserve the relationship between the RODC key version and enctype.