LDAPire is a comprehensive LDAP enumeration tool designed for Active Directory environments. It performs detailed enumeration of domain objects, including users, groups, and computers, with advanced handling of binary attributes and service account detection.
- SSL/TLS support with fallback to non-SSL
- Anonymous and authenticated bind support
- Secure credential handling
- Complete enumeration of:
- Users
- Groups
- Computers
- All domain objects
- Binary attribute conversion:
- Security Identifiers (SIDs)
- GUIDs
- Exchange attributes
- Other binary data
Users.txt
: User SAM account namesGroups.txt
: Group SAM account namesComputers.txt
: Computer SAM account namesObjects.txt
: All object SAM account names
UsersDetailed.txt
: Comprehensive user attributesGroupsDetailed.txt
: Comprehensive group attributesComputersDetailed.txt
: Comprehensive computer attributesObjectsDetailedLdap.txt
: All domain object details
AllObjectDescriptions.txt
: Consolidated descriptions from all objectsServiceAccounts.txt
: Potential service accounts identified
The tool provides a clear, organized console output showing progress:
============================================================
LDAP Information Retrieval
Domain Enumeration
============================================================
------------------------------------------------------------
Processing Users
------------------------------------------------------------
✓ Basic user names → Users.txt
✓ Detailed user info → UsersDetailed.txt
------------------------------------------------------------
Processing Groups
------------------------------------------------------------
✓ Basic group names → Groups.txt
✓ Detailed group info → GroupsDetailed.txt
------------------------------------------------------------
Processing Computers
------------------------------------------------------------
✓ Basic computer names → Computers.txt
✓ Detailed computer info → ComputersDetailed.txt
------------------------------------------------------------
Processing All Objects
------------------------------------------------------------
✓ Basic object names → Objects.txt
✓ Detailed object info → ObjectsDetailedLdap.txt
------------------------------------------------------------
Processing Descriptions
------------------------------------------------------------
✓ All object descriptions → AllObjectDescriptions.txt
------------------------------------------------------------
Searching for Service Accounts
------------------------------------------------------------
🔍 Searching Users.txt
✓ Found matches in Users.txt
🔍 Searching UsersDetailed.txt
✓ Found matches in UsersDetailed.txt
🔍 Searching Groups.txt
- No matches in Groups.txt
✓ Service account findings written to ServiceAccounts.txt
✓ Found 5 potential matches
============================================================
Enumeration Complete!
============================================================
- Python 3.x
- ldap3 library
- Install Python 3.x
- Install required library:
pip3 install ldap3
Basic syntax:
python3 ldapire.py [DC_IP] [-u USERNAME] [-p PASSWORD]
Arguments:
DC_IP
: Domain Controller IP (required)-u USERNAME
: Authentication username (optional)-p PASSWORD
: Authentication password (optional)
Examples:
# Authenticated enumeration
python3 ldapire.py 192.168.1.1 -u "DOMAIN\\username" -p "password"
# Anonymous enumeration
python3 ldapire.py 192.168.1.1
Contains one entry per line:
user1
user2
user3
Contains comprehensive attribute information:
DN: CN=User1,CN=Users,DC=domain,DC=local
objectSid: S-1-5-21-xxxxxxxxx
objectGUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
...
Contains formatted object descriptions:
DN: CN=Object1,DC=domain,DC=local
Name: Object1
Object Class: user
Description: This is a description
Contains potential service account findings with context:
=== Potential Service Accounts Found ===
--- Found in UsersDetailed.txt around line 45 ---
DN: CN=svc_backup,CN=Users,DC=domain,DC=local
...
The tool automatically checks and reports if anonymous bind is enabled:
------------------------------------------------------------
Security Check
------------------------------------------------------------
⚠️ WARNING: Anonymous Bind is ENABLED
⚠️ This is a security risk and should be disabled
- Searches through all output files for potential service accounts
- Looks for common patterns: 'svc', 'service', 'srvc', 'svc_', 'service_'
- Provides context around matches for better analysis
- Consolidates findings in ServiceAccounts.txt
The tool properly formats various binary attributes:
- Security Identifiers (SIDs)
- GUIDs
- Exchange-specific attributes
- Other binary data types
- Graceful handling of connection failures
- Proper handling of binary data conversion
- Fallback mechanisms for SSL/TLS connections
- Informative error messages for troubleshooting
- Always use authenticated access when possible
- Run with minimal privileges necessary
- Be mindful of network bandwidth and server load
- Review output files for sensitive information
- Avoid storing credentials in scripts
- Use secure channels for transferring output files
- Clean up output files after analysis
- Monitor and log tool usage in sensitive environments
Common issues and solutions:
-
Connection failures
- Verify DC IP address
- Check network connectivity
- Ensure LDAP/LDAPS ports are accessible
-
Authentication issues
- Verify username format (DOMAIN\username)
- Check credential validity
- Ensure user has appropriate permissions
-
Output issues
- Check write permissions in output directory
- Verify disk space availability
- Ensure no file locks from other processes
Planned features for future releases:
- Additional binary attribute handling
- Enhanced service account detection patterns
- Output in multiple formats (JSON, CSV)
- Integration with other security tools
- Custom attribute filtering options
This tool should only be used with proper authorization. Unauthorized LDAP enumeration may violate security policies or laws.
Contributions welcome! Please submit issues and pull requests via GitHub.
MIT License
Bloodstiller
- 2.0: Added comprehensive binary attribute handling, service account detection, and expanded output options
- 1.0: Initial release with basic LDAP enumeration