Repository navigation
Fix --user and --enabled filtering for NTDS dump - #1521
CobblePot59 wants to merge 4 commits into
Conversation
The VSS method ignores justUser in impacket and dumps every account, so filter by username directly in the add_hash callback for every method. Also rewrite the .ntds output file with the kept lines, since impacket writes all accounts regardless of --user/--enabled.
|
It looks like the PR template may not have been filled out. The following sections appear to be missing:
Please edit your PR description to include them. The template helps reviewers understand and test your changes. Thanks! |
mpgn
left a comment
There was a problem hiding this comment.
Thanks for the PR! Two points on the output file 👍
Co-authored-by: mpgn <5891788+mpgn@users.noreply.github.com> Signed-off-by: CobblePot59 <38343920+CobblePot59@users.noreply.github.com>
Co-authored-by: mpgn <5891788+mpgn@users.noreply.github.com> Signed-off-by: CobblePot59 <38343920+CobblePot59@users.noreply.github.com>
|
Thanks for the PR, but these sounds like bugs in impacket and should be fixed there and not in NetExec |
It's a Monkey Patch 🙈. I thought it would be easier to implement it here ^^' |
Naa if we find bugs in the nxc+impacket combination they should rather be fixed at the source :D |
I'm trying to look at that |
|
I don't think |
No, that’s not in Impacket; I’m just going to look into the part about targeting a specific user, and I’ll provide the link to the Impacket PR. |
It's done. |
Description
Please include a summary of the change and which issue is fixed, or what the enhancement does.
List any dependencies that are required for this change.
Fix NTDS account filtering across extraction methods:
add_hashcallback for all methods, since VSS ignoresjustUserand dumps every account..ntdsoutput file to retain only the filtered accounts, as Impacket otherwise writes all accounts regardless of--useror--enabled.grep -iv disabledextraction instructions, as they are now redundant with the--enabledfilter.No new dependency.
AI Assistance
If you have used AI in any form, please state the tool you used (e.g. Claude Code, Cursor, Amp) along with the extent that the work was AI-assisted.
Note that if you have used AI, you:
No AI.
Type of change
Insert an "x" inside the brackets for relevant items
Setup guide for the review
Please provide guidance on what setup is needed to test the introduced changes, such as the target(s) you tested against or software versions.
In particular:
Test against a Windows DC.
Screenshots (if appropriate):
Screenshots are always nice to have and can give a visual representation of the change.
If appropriate, include before and after screenshot(s) to show which results are to be expected.
Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run ruff check ., use--fixto automatically fix what it can)tests/e2e_commands.txtfile if necessary (new modules or features are required to be added to the e2e tests)