Hashcat OpenLDAP MD5 passwords

Submitted by cliff on Mon, 09/03/2020 - 16:07

OpenLDAP has the ability to still use MD5 hashed passwords without a salt. 

In the userPassword field these will look like {MD5}CguNWKsfq1tWI1V95R4sag==. (Which is actually 'thisisnotarealpassword')

When exporting them using slapcat they will be base64 encoded and look like: e01ENX1DZ3VOV0tzZnExdFdJMVY5NVI0c2FnPT0K

To use them in hashcat do the following:

echo -e "e01ENX1DZ3VOV0tzZnExdFdJMVY5NVI0c2FnPT0K" | base64 --decode | sed -e 's/{MD5}//' | base64 --decode | xxd -c -p20

0a0b8d58ab1fab5b5623557de51e2c6a

This hash can be fed to hashcat using the default md5 mode (mode 0).