feat(ldap): add set-password-auth BOF — token-based password reset via LDAPS#148
Open
0xGunrunner wants to merge 1 commit into
Open
feat(ldap): add set-password-auth BOF — token-based password reset via LDAPS#1480xGunrunner wants to merge 1 commit into
0xGunrunner wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The original
add-computerBOF depends onldap_common.cvia#include "ldap_common.c"which pulls in the shared helper infrastructure. In practice this caused silent failures during connection setup due to howldap_set_optionwas called forLDAP_OPT_SIGNandLDAP_OPT_ENCRYPT— the original passed a pointer-to-pointer instead of a pointer to aULONG, meaning the channel was never actually sealed. This leads toLDAP_UNWILLING_TO_PERFORMor a failedunicodePwdwrite since AD requires a sealed channel for password operations.This fix rewrites
add-computeras a standalone BOF with inlined LDAP types and imports, matching the same pattern used in the fixedadd-rbcd. The connection setup is corrected to pass&on_val(ULONG*) for sign/seal options. Password memory is also zeroed before free on the cleanup path (memset(pw_bv->bv_val, 0, pw_bv->bv_len)) which the original skipped. Error reporting is expanded to distinguish betweenLDAP_CONSTRAINT_VIOLATION(password policy rejection),LDAP_UNWILLING_TO_PERFORM(unsealed channel), andLDAP_INSUFFICIENT_RIGHTS(MAQ exhausted or no CreateChild on container).The
ldap_common.hheader change adds thel_timeval/LDAP_TIMEVALstruct definition which was missing, causing implicit struct warnings for any BOF that callsldap_connectwith a timeout parameter. A trailing newline is also added to the file.