
Un outil d'énumération des utilisateurs et des groupes d'Active Directory basé sur LDAP
ad-ldap-enum est un script Python développé pour collecter les utilisateurs/ordinateurs et leur appartenance aux groupes depuis Active Directory. Dans les grands environnements Active Directory, des outils comme NBTEnum n'étaient pas assez rapides. En exécutant des requêtes LDAP contre un contrôleur de domaine, ad-ldap-enum peut cibler des attributs Active Directory spécifiques et construire rapidement l'appartenance aux groupes.
Domain_Group_Membership.csvExtended_Domain_User_Information.csvExtended_Domain_Computer_Information.csv-x/--excel est utiliséCet outil a été développé et testé avec Python 3.10+ sur Windows et Linux. Il utilise le package Python msldap pour les connexions et requêtes LDAP. Pour installer ad-ldap-enum en tant qu'outil en ligne de commande avec uv :
uv tool install git+https://github.com/CroweCybersecurity/ad-ldap-enum
Après installation, exécutez ad-ldap-enum avec :
ad-ldap-enum --help
Alternativement à uv, vous pouvez installer/mettre à jour les dépendances avec pip traditionnel :
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
Exemples rapides :
# 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 et -aesKey--delay pour introduire des pauses entre les requêtes LDAP--jitter pour ajouter de l'aléatoire aux schémas de temporisation--page-size pour contrôler le regroupement des résultats LDAP