
Uno strumento di enumerazione di utenti e gruppi di Active Directory basato su LDAP
ad-ldap-enum è uno script Python sviluppato per raccogliere utenti, computer e le loro appartenenze ai gruppi da Active Directory. In ambienti Active Directory di grandi dimensioni, strumenti come NBTEnum non erano abbastanza veloci. Eseguendo query LDAP su un controller di dominio, ad-ldap-enum è in grado di colpire attributi specifici di Active Directory e costruire rapidamente le appartenenze ai gruppi.
Domain_Group_Membership.csvExtended_Domain_User_Information.csvExtended_Domain_Computer_Information.csv-x/--excelQuesto strumento è stato sviluppato e testato con Python 3.10+ su Windows e Linux. Utilizza il pacchetto Python msldap per le connessioni e le query LDAP. Per installare ad-ldap-enum come strumento a riga di comando con uv:
uv tool install git+https://github.com/CroweCybersecurity/ad-ldap-enum
Dopo l'installazione, esegui ad-ldap-enum con:
ad-ldap-enum --help
In alternativa a uv, puoi installare/aggiornare i requisiti con il tradizionale pip:
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
Esempi rapidi:
# 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 per introdurre pause tra le query LDAP--jitter per aggiungere casualità ai modelli temporali--page-size per controllare il raggruppamento dei risultati LDAP