Skip to content

Refactor add-computer : use impacket CRUD#1098

Merged
NeffIsBack merged 14 commits intoPennyw0rth:mainfrom
azoxlpf:feat/add-ldaps-addccomputer
Mar 18, 2026
Merged

Refactor add-computer : use impacket CRUD#1098
NeffIsBack merged 14 commits intoPennyw0rth:mainfrom
azoxlpf:feat/add-ldaps-addccomputer

Conversation

@azoxlpf
Copy link
Copy Markdown
Contributor

@azoxlpf azoxlpf commented Feb 6, 2026

Description

This PR refactors the add-computer module to support both SAMR and LDAPS and to use impacket’s LDAP CRUD operations instead of ldap3.

Previously, the module used a fallback to LDAPS when SAMR failed. It’s now clearer and more predictable to let the user choose the method via the protocol and options : nxc smb uses SAMR, and nxc ldap --port 636 uses LDAPS. The module supports both protocols.

Type of change

Insert an "x" inside the brackets for relevant items (do not delete options)

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Deprecation of feature or functionality
  • This change requires a documentation update
  • This requires a third party update (such as Impacket, Dploot, lsassy, etc)

Screenshots (if appropriate):

SMB :

image

LDAPS :

image

Checklist:

Insert an "x" inside the brackets for completed and relevant items (do not delete options)

  • I have ran Ruff against my changes (via poetry: poetry run python -m ruff check . --preview, use --fix to automatically fix what it can)
  • I have added or updated the tests/e2e_commands.txt file if necessary (new modules or features are required to be added to the e2e tests)
  • New and existing e2e tests pass locally with my changes
  • If reliant on changes of third party dependencies, such as Impacket, dploot, lsassy, etc, I have linked the relevant PRs in those projects
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (PR here: https://github.com/Pennyw0rth/NetExec-Wiki)

@azoxlpf
Copy link
Copy Markdown
Contributor Author

azoxlpf commented Feb 6, 2026

For the module to work, this PR needs to be merged first : #2112

@NeffIsBack
Copy link
Copy Markdown
Member

Thanks for the PR!

@NeffIsBack
Copy link
Copy Markdown
Member

@azoxlpf could you resolve the merge conflicts?

NeffIsBack
NeffIsBack previously approved these changes Mar 18, 2026
Copy link
Copy Markdown
Member

@NeffIsBack NeffIsBack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm, LGTM:
Image

Copy link
Copy Markdown
Member

@NeffIsBack NeffIsBack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also added the Exception handling fix from #1081 with which otherwise the module crashes:
Image

@NeffIsBack NeffIsBack merged commit 170ce53 into Pennyw0rth:main Mar 18, 2026
5 checks passed
@NeffIsBack NeffIsBack mentioned this pull request Mar 19, 2026
7 tasks
@azoxlpf azoxlpf deleted the feat/add-ldaps-addccomputer branch March 19, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants