
Uma ferramenta de enumeração de utilizadores e grupos do Active Directory baseada em LDAP
ad-ldap-enum é um script em Python desenvolvido para coletar usuários/computadores e suas associações a grupos do Active Directory. Em ambientes grandes de Active Directory, ferramentas como NBTEnum não eram rápidas o suficiente. Ao executar consultas LDAP contra um controlador de domínio, o ad-ldap-enum é capaz de mirar atributos específicos do Active Directory e construir rapidamente a associação a grupos.
Domain_Group_Membership.csvExtended_Domain_User_Information.csvExtended_Domain_Computer_Information.csv-x/--excel é usadoEsta ferramenta foi construída e testada com Python 3.10+ no Windows e Linux. Ela utiliza o pacote Python msldap para conexões e consultas LDAP. Para instalar o ad-ldap-enum como uma ferramenta de linha de comando com uv:
uv tool install git+https://github.com/CroweCybersecurity/ad-ldap-enum
Após a instalação, execute o ad-ldap-enum com:
ad-ldap-enum --help
Alternativamente ao uv, você pode instalar/atualizar as dependências com o pip tradicional:
git clone https://github.com/CroweCybersecurity/ad-ldap-enum && cd ./ad-ldap-enum
python -m pip install -r 'requirements.txt'
usage: ad-ldap-enum [-h] (-n | -u USERNAME | -dn DISTINGUISHED_NAME) [-k] [-p PASSWORD] [-P] [--ccache CCACHE_FILE]
[--kirbi KIRBI_FILE] [--method {ldap,ldaps}] [--channel-binding {none,tls-server-end-point,tls-unique}]
[-t TIMEOUT] [-ql QUERY_LIMIT] [--debug] [--legacy]
[-x] [-o FILENAME_PREPEND] [--delay DELAY] [--jitter JITTER] [--page-size PAGE_SIZE]
-l LDAP_SERVER [--port PORT] -d DOMAIN [-a ALT_DOMAIN] [-e] [-4] [-6]
Active Directory LDAP Enumerator
optional arguments:
-h, --help show this help message and exit
-n, --null Use anonymous/null authentication
-u USERNAME, --username USERNAME
Username for authentication
-dn DISTINGUISHED_NAME, --distinguished_name DISTINGUISHED_NAME
Distinguished name for simple bind authentication
-k, --kerberos Use Kerberos authentication
-p PASSWORD, --password PASSWORD
Password, "LM:NT" hash, AES-128 key (32 hex), or AES-256 key (64 hex)
-P, --prompt Prompt for password
--ccache CCACHE_FILE Path to Kerberos credential cache file (.ccache)
--kirbi KIRBI_FILE Path to Kerberos ticket file (.kirbi)
--method {ldap,ldaps}
Connection method: ldap (port 389) or ldaps (port 636)
--channel-binding {none,tls-server-end-point,tls-unique}
Channel binding for secure connections (default: tls-server-end-point)
-t TIMEOUT, --timeout TIMEOUT
Connection timeout in seconds (default: 10)
-ql QUERY_LIMIT, --query_limit QUERY_LIMIT
Query timeout in seconds (default: 30)
--debug Enable debug logging (shows detailed msldap internal operations)
--legacy Use legacy TSV format (fewer attributes)
-x, --excel Output Excel file with all worksheets
-o FILENAME_PREPEND, --prepend FILENAME_PREPEND
Prepend string to output filenames (default: ad-ldap-enum_)
OPSEC Parameters:
--delay DELAY Delay in seconds between LDAP queries (default: 0.0)
--jitter JITTER Random jitter percentage for delays (0.0-1.0, e.g., 0.3 = ±30%)
--page-size PAGE_SIZE
LDAP page size (default: 1000)
Server Parameters:
-l LDAP_SERVER, --server LDAP_SERVER
LDAP server FQDN or IP address
--port PORT Custom TCP port
-d DOMAIN, --domain DOMAIN
Domain name (also used as Base DN)
-a ALT_DOMAIN, --alt-domain ALT_DOMAIN
Alternative Base DN for LDAP searches
-e, --nested Expand nested groups
-4, --inet Use IPv4 only
-6, --inet6 Use IPv6 only
Exemplos rápidos:
# NTLM with inline password
ad-ldap-enum domain.tld/username:[email protected]
# NTLM with password prompt (omit password, do not use -no-pass)
ad-ldap-enum domain.tld/[email protected] -p 'Password123!'
# Kerberos with password
ad-ldap-enum domain.tld/username:[email protected] -k
# Kerberos with NT hash (LM:NT)
ad-ldap-enum domain.tld/[email protected] -k -hashes aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0
# LDAPS + channel binding
ad-ldap-enum domain.tld/username:[email protected] --method ldaps --channel-binding tls-server-end-point
-k, -hashes e -aesKey--delay para introduzir pausas entre consultas LDAP--jitter para adicionar aleatoriedade aos padrões de temporização--page-size para controlar o agrupamento de resultados LDAP