-
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
Add user module #19696
Add user module #19696
Conversation
Also added extra error handling for when password is wrong or expired
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're renaming the module you'll want to add additional moved_from
metadata iirc
include Msf::Exploit::Deprecated
moved_from 'auxiliary/admin/dcerpc/samr_computer'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's nice! Thanks for the heads up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good to me here. I'm just going to push a tweak to the documentation for the ADD_USER
action before I land this.
Testing Output
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) > run
[*] Running module against 192.168.159.10
[*] 192.168.159.10:445 - Adding computer
[*] 192.168.159.10:445 - Connecting to Security Account Manager (SAM) Remote Protocol
[*] 192.168.159.10:445 - Binding to \samr...
[+] 192.168.159.10:445 - Bound to \samr
[+] 192.168.159.10:445 - Successfully created msflab.local\DESKTOP-QCOK1YN4$
[+] 192.168.159.10:445 - Password: a1xHGSb7uTBaLkn1Y0EF3RTJBpr9eFLf
[+] 192.168.159.10:445 - SID: S-1-5-21-3978004297-3499718965-4169012971-4202
[*] Auxiliary module execution completed
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) > set ACCOUNT_NAME
ACCOUNT_NAME =>
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) > set ACCOUNT_NAME SullivanCGoal
ACCOUNT_NAME => SullivanCGoal
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) > set ACTION ADD_USER
ACTION => ADD_USER
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) > run
[*] Running module against 192.168.159.10
[*] 192.168.159.10:445 - Adding user
[*] 192.168.159.10:445 - Connecting to Security Account Manager (SAM) Remote Protocol
[*] 192.168.159.10:445 - Binding to \samr...
[+] 192.168.159.10:445 - Bound to \samr
[+] 192.168.159.10:445 - Successfully created msflab.local\SullivanCGoal
[+] 192.168.159.10:445 - Password: psZXxliWjuESCUeXPSKoYA1gbFqBf3oT
[+] 192.168.159.10:445 - SID: S-1-5-21-3978004297-3499718965-4169012971-4203
[*] Auxiliary module execution completed
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) > lookup_account
[*] Running module against 192.168.159.10
[*] 192.168.159.10:445 - Connecting to Security Account Manager (SAM) Remote Protocol
[*] 192.168.159.10:445 - Binding to \samr...
[+] 192.168.159.10:445 - Bound to \samr
[+] 192.168.159.10:445 - Found msflab.local\SullivanCGoal (SID: S-1-5-21-3978004297-3499718965-4169012971-4203)
[*] Auxiliary module execution completed
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) > lookup_account ACCOUNT_NAME=DESKTOP-QCOK1YN4$
[*] Running module against 192.168.159.10
[*] 192.168.159.10:445 - Connecting to Security Account Manager (SAM) Remote Protocol
[*] 192.168.159.10:445 - Binding to \samr...
[+] 192.168.159.10:445 - Bound to \samr
[+] 192.168.159.10:445 - Found msflab.local\DESKTOP-QCOK1YN4$ (SID: S-1-5-21-3978004297-3499718965-4169012971-4202)
[*] Auxiliary module execution completed
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) > delete_account
[*] Running module against 192.168.159.10
[*] 192.168.159.10:445 - Connecting to Security Account Manager (SAM) Remote Protocol
[*] 192.168.159.10:445 - Binding to \samr...
[+] 192.168.159.10:445 - Bound to \samr
[+] 192.168.159.10:445 - The specified account has been deleted.
[*] Auxiliary module execution completed
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) > lookup_account
[*] Running module against 192.168.159.10
[*] 192.168.159.10:445 - Connecting to Security Account Manager (SAM) Remote Protocol
[*] 192.168.159.10:445 - Binding to \samr...
[+] 192.168.159.10:445 - Bound to \samr
[-] 192.168.159.10:445 - Auxiliary aborted due to failure: not-found: The account was not found.
[*] Auxiliary module execution completed
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) > unset ACCOUNT_NAME
Unsetting ACCOUNT_NAME...
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) > add_user
[*] Running module against 192.168.159.10
[-] 192.168.159.10:445 - Auxiliary aborted due to failure: bad-config: This action requires ACCOUNT_NAME to be specified.
[*] Auxiliary module execution completed
metasploit-framework.pr (S:0 J:0) auxiliary(admin/dcerpc/samr_account) >
Release NotesThis updates replaces the existing |
This modifies the existing
samr_computer
account to enable adding user accounts as well.Verification
List the steps needed to make sure this thing works
msfconsole
use auxiliary/scanner/smb/smb_login
set action ADD_USER
set account_name new.user
account_password
run
lookup_account
anddelete_account
actionsDemo