LDAPWordlistHarvester
A tool to generate a wordlist from the information present in LDAP, in order to crack non-random passwords of domain accounts.
Features
The bigger the domain is, the better the wordlist will be.
- Creates a wordlist based on the following information found in the LDAP:
- User: name and sAMAccountName
- Computer: name and sAMAccountName
- Groups: name
- Organizational Units: name
- Active Directory Sites: name and descriptions
- All LDAP objects: descriptions
- Choose a wordlist output file name with an option –outputfile
Install
git clone https://github.com/p0dalirius/LDAPWordlistHarvester.git
cd LDAPWordlistHarvester
pip install -r requirements.txt
Use
[pastacode lang=”markup” message=”” highlight=”” provider=”manual” manual=”%24%20.%2FLDAPWordlistHarvester.py%20-h%0ALDAPWordlistHarvester.py%20v1.1%20-%20by%20%40podalirius_%0A%0Ausage%3A%20LDAPWordlistHarvester.py%20%5B-h%5D%20%5B-v%5D%20%5B-o%20OUTPUTFILE%5D%20–dc-ip%20ip%20address%20%5B-d%20DOMAIN%5D%20%5B-u%20USER%5D%20%5B–no-pass%20%7C%20-p%20PASSWORD%20%7C%20-H%20%5BLMHASH%3A%5DNTHASH%20%7C%20–aes-key%20hex%20key%5D%20%5B-k%5D%0A%0Aoptions%3A%0A%20%20-h%2C%20–help%20%20%20%20%20%20%20%20%20%20%20%20show%20this%20help%20message%20and%20exit%0A%20%20-v%2C%20–verbose%20%20%20%20%20%20%20%20%20Verbose%20mode.%20(default%3A%20False)%0A%20%20-o%20OUTPUTFILE%2C%20–outputfile%20OUTPUTFILE%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Path%20to%20output%20file%20of%20wordlist.%0A%0AAuthentication%20%26%20connection%3A%0A%20%20–dc-ip%20ip%20address%20%20%20%20IP%20Address%20of%20the%20domain%20controller%20or%20KDC%20(Key%20Distribution%20Center)%20for%20Kerberos.%20If%20omitted%20it%20will%20use%20the%20domain%20part%20(FQDN)%20specified%20in%20the%20identity%20parameter%0A%20%20-d%20DOMAIN%2C%20–domain%20DOMAIN%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(FQDN)%20domain%20to%20authenticate%20to%0A%20%20-u%20USER%2C%20–user%20USER%20%20user%20to%20authenticate%20with%0A%0ACredentials%3A%0A%20%20–no-pass%20%20%20%20%20%20%20%20%20%20%20%20%20Don’t%20ask%20for%20password%20(useful%20for%20-k)%0A%20%20-p%20PASSWORD%2C%20–password%20PASSWORD%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Password%20to%20authenticate%20with%0A%20%20-H%20%5BLMHASH%3A%5DNTHASH%2C%20–hashes%20%5BLMHASH%3A%5DNTHASH%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20NT%2FLM%20hashes%2C%20format%20is%20LMhash%3ANThash%0A%20%20–aes-key%20hex%20key%20%20%20%20%20AES%20key%20to%20use%20for%20Kerberos%20Authentication%20(128%20or%20256%20bits)%0A%20%20-k%2C%20–kerberos%20%20%20%20%20%20%20%20Use%20Kerberos%20authentication.%20Grabs%20credentials%20from%20.ccache%20file%20(KRB5CCNAME)%20based%20on%20target%20parameters.%20If%20valid%20credentials%20cannot%20be%20found%2C%20it%20will%20use%20the%20ones%20specified%20in%20the%20command%20line”/]
Demonstration
To generate a wordlist from the LDAP of the domain domain.local you can use this command:
You will get the following output if using the Python version:

You will get the following output if using the Powershell version:

Cracking passwords
Once you have this wordlist, you should crack your NTDS using hashcat, –loopback, and the rule clem9669_large.rule.
Source: https://github.com/p0dalirius/