LinuxCommandLibrary

impacket-getadusers

queries Active Directory via LDAP to enumerate user accounts and their

TLDR

Enumerate all domain users with their details
$ impacket-getadusers -all '[domain]/[user]:[password]'
copy
Query users specifying the domain controller IP
$ impacket-getadusers -all -dc-ip [192.168.1.100] '[domain]/[user]:[password]'
copy
Get users using NTLM hash authentication
$ impacket-getadusers -all -hashes ':[nthash]' '[domain]/[user]'
copy
Enumerate users via Kerberos authentication
$ impacket-getadusers -all -k -no-pass '[domain]/[user]'
copy
Output user information in a specific format
$ impacket-getadusers -all -dc-ip [192.168.1.100] '[domain]/[user]:[password]' 2>/dev/null
copy

SYNOPSIS

impacket-getadusers [-h] [-user USERNAME] [-all] [-dc-ip IP] [-dc-host HOSTNAME] [-hashes LMHASH:NTHASH] [-no-pass] [-k] [-aesKey KEY] target

DESCRIPTION

impacket-getadusers queries Active Directory via LDAP to enumerate user accounts and their attributes. It retrieves information such as usernames, last logon times, password last set dates, and account status flags.
The tool is useful for reconnaissance during penetration tests to identify potential targets, find accounts with old passwords, or discover service accounts. Output includes the SAM account name, badPwdCount, and other relevant security attributes.

PARAMETERS

-all

Return all users in the domain
-user USERNAME
Query information for a specific user only
-dc-ip IP
IP address of the domain controller
-dc-host HOSTNAME
Hostname of the domain controller (used for Kerberos)
-hashes LMHASH:NTHASH
Use NTLM hashes for authentication instead of password
-no-pass
Don't ask for password (useful with -k or -hashes)
-k
Use Kerberos authentication from ccache file
-aesKey KEY
AES key to use for Kerberos authentication

CAVEATS

Requires valid domain credentials. Output may be verbose; consider redirecting stderr to /dev/null for cleaner output. The -all flag is typically required to see results for more than just the authenticated user.

HISTORY

Part of the Impacket library developed by SecureAuth. The tool leverages LDAP queries against Active Directory, implementing Microsoft's directory service protocols in Python for cross-platform compatibility.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard