Add LAPSv1 and LAPSv2 LDAP Module #20017
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates and moves the existing
ldap_hashdump
module toldap_passwords
and extends the attributes it searches for to process those used by LAPSv1 and LAPSv2 (both encrypted and unencrypted). The originalldap_hashdump
module would search for hashes and passwords from misc LDAP server implementations. The original seemed to have been inspired by CVE-2020-3952, for which there is still a dedicated module. The changers herein effectively add techniques specific to Active Directory LDAP servers. I think it makes a lot of sense to combine the functionality because:I'm open to suggestions on better names for the module. Perhaps
ldap_secrets_dump
would be more intuitive given everything it looks for.In addition to the module updates, the
ldap_spec
tests have been updated for this module. The target LDAP server that the tests use is Samba as an Active Directory Domain Controller, so it makes sense to add the new password data that is applicable in AD environments. To support that, the tests were updated to add test accounts with both LAPSv1 and LAPSv2 passwords in use. Only plaintext LAPSv2 can be used, because the encrypted variant requires the GKDI service that Samba does not support.Closes #19838
Verification
Testing requires changes from rapid7/ruby_smb#286 and rapid7/ruby_smb#284. The last commit points to a temporary branch to make testing easier. The temporary branch includes changes from both PRs.
git clone https://github.com/HynekPetrak/bitnami-docker-openldap.git
cd bitnami-docker-openldap && docker-compose up -d
ms-mcs-admpwd
attributemslaps-encryptedpassword
ormslaps-password
attribute depending on if encryption was enabledDemo