-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor smb_enumusers #19095
Refactor smb_enumusers #19095
Conversation
b66eaa5
to
4f7eafc
Compare
4484316
to
d3b5041
Compare
d3b5041
to
a3e3eb9
Compare
Works as expected vs. port 445 & 139 on Docker & Windows Server 2022 VM, when targetting a session and rhost. Testing
|
This pulls in the changes from rapid7/ruby_smb#266 which adds SamrQueryInformationDomain support.
Release NotesUpdates the smb_enumusers module to use an updated SMB implementation from RubySMB which fixes an issue where the module could sometimes time out or return an unexpected error when targeting Samba. |
This updates the existing auxiliary/scanner/smb/smb_enumusers. This should fix #19053 by using the RubySMB DCERPC methods. The output between the new and old versions should be identical, though the new one has some additional information printed as it connects to the SAMR interface as provided by the mixin. This requires the changes from rapid7/ruby_smb#266 to include the new SAMR methods for fetching the domain information for the password length and lockout policy.
There's also some overlap with #19072. Now that issue didn't request the ability to control the port in this module, but the technical limitations are the same between
smb_enumusers
andsmb_version
. With the changes in this PR landed, the pattern can be used as a precedence and copied to the other modules as necessary, starting with smb_version. The gist is that 139 and 445 are both tried with SMBDirect set as appropriate but if the user sets RPORT, only that port will be tried along with the SMBDirect setting provided through the datastore option. This is what I recommended here.Verification
List the steps needed to make sure this thing works
auxiliary/admin/dcerpc/samr_computer
module to see it still worksThis also fixes an issue where the module would fail to return results from hosts that have lots of accounts registered such as a domain controller. Now when run against a domain controller, instead of no accounts being returned, they are all returned on a single line. Neither of these outcomes are particularly great but that's probably a problem to solve in another PR.
Demo