Skip to content

Conversation

@NeffIsBack
Copy link
Contributor

@NeffIsBack NeffIsBack commented Dec 22, 2025

Until now for all modification operations ldap3 must be used, due to the lack of CRUD methods in ldap (yeah R=read exists, but w/e).

This is now supported!
The implementation is very close to the syntax of the corresponding ldap3 calls in order to be a drop-in-place. Therefore, all existing calls should be able to be replaced by simply switching to impackets ldap. Keep in mind that ldap3 returns False together with populating connection.last_error, while impackets implementation raises an error. Therefore, error handling must be adjusted. If there are issues (now or in the future) where impackets ldap does not behave similar to ldap3 please hit me up.

Subsequently, all existing ldap3 adaptations inside of impacket and NetExec can gradually be replaced by impackets ldap implementation.
Example of adding, modifying and deleting a computer object from NetExec:
image

Note that i have not tested the modify_dn() function because i had no proper use-case (at least that worked). Since it is pretty simple, i don't think i have messed it up.

@Dfte
Copy link
Contributor

Dfte commented Dec 22, 2025

So great :D!!

@mpgn
Copy link
Contributor

mpgn commented Dec 22, 2025

Nice one 🎉

@anadrianmanrique anadrianmanrique self-assigned this Jan 6, 2026
@anadrianmanrique anadrianmanrique added the in review This issue or pull request is being analyzed label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in review This issue or pull request is being analyzed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants