feat(smb): add generic --export flag for enumeration commands#1101
feat(smb): add generic --export flag for enumeration commands#1101H1DroZz wants to merge 3 commits intoPennyw0rth:mainfrom
Conversation
- Add --rid-users-export argument in proto_args.py - Implement rid_users_export() method in smb.py - Filter and export only SidTypeUser entries - Add E2E test
|
Hi and thanks for the PR. I don't think we should add even more |
|
@H1DroZz do you have the time to implement that change? |
Add --export FILE argument to SMB protocol that works alongside --rid-brute and --users, replacing the need for command-specific export flags. Filters SidTypeUser entries (excluding machine accounts) when exporting from --rid-brute.
Hello, it's done. Following your feedback, I replaced --rid-users-export with a generic --export flag that works alongside both --rid-brute and --users. While implementing this, I noticed --users-export follows the same pattern you pointed out. Would you like me to deprecate it in favor of --export as well, or would you prefer to keep it for backward compatibility? Have a nice day |
Yes please, we should deprecate the Thanks you too :) |
|
Hello @NeffIsBack I've implemented the deprecation of Let me know if this approach looks good to you or if you'd like any adjustments! Have a nice day |
Description
This PR implements a generic
--exportFILE flag for the SMB protocol, addressing the feedback from #1101 where a command-specific--rid-users-exportargument was rejected in favor of a more extensible approach.The
--exportflag can be combined with any supported enumeration command to write results to a file, without adding new --x-export arguments for each command.Currently supported commands:
--rid-brute --exportexports SidTypeUser entries (machine accounts excluded, sorted alphabetically)--users --exportenumerated domain usersDeprecation:
--users-exportis now deprecated in favor of--users --exportfor consistency--users-exportstill works but displays a deprecation warningThis PR was created with the assistance of Claude Code (claude-sonnet-4-6). The AI assisted with code implementation, reviewing existing patterns in the codebase, and structuring the changes. All code was tested, reviewed and validated manually.
Type of change
Setup guide for the review
Python: 3.10+
OS: Linux
Target: Windows Domain Controller
Testing the new option:
Expected output:
File content (only SidTypeUser, sorted):
Screenshots (if appropriate):
Users
Rid-Brute
Checklist:
Insert an "x" inside the brackets for completed and relevant items (do not delete options)
poetry run python -m ruff check . --preview, 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)