-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Ldap Change Password module #19671
Ldap Change Password module #19671
Conversation
facd93f
to
ae61d0a
Compare
5de68a5
to
75a334c
Compare
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.
I pushed up a commit fixing a super minor typo that was throwing off msftidy. I then completed my testing by authenticating with Kerberos and resetting the password for an account and checking an invalid account. Everything is looking good to me so if the tests pass, I'll get this landed.
Thanks a lot for your work on this!
Testing Output
metasploit-framework.pr (S:0 J:0) auxiliary(admin/ldap/change_password) > run
[*] Running module against 192.168.159.10
[-] Auxiliary aborted due to failure: bad-config: The LDAP::Rhostname option is required when using Kerberos authentication.
[*] Auxiliary module execution completed
metasploit-framework.pr (S:0 J:0) auxiliary(admin/ldap/change_password) > set LDAP::Rhostname dc.msflab.local
LDAP::Rhostname => dc.msflab.local
metasploit-framework.pr (S:0 J:0) auxiliary(admin/ldap/change_password) > run
[*] Running module against 192.168.159.10
[+] 192.168.159.10:88 - Received a valid TGT-Response
[*] 192.168.159.10:389 - TGT MIT Credential Cache ticket saved to /home/smcintyre/.msf4/loot/20241206164448_default_192.168.159.10_mit.kerberos.cca_407813.bin
[+] 192.168.159.10:88 - Received a valid TGS-Response
[*] 192.168.159.10:389 - TGS MIT Credential Cache ticket saved to /home/smcintyre/.msf4/loot/20241206164448_default_192.168.159.10_mit.kerberos.cca_408381.bin
[+] 192.168.159.10:88 - Received a valid delegation TGS-Response
[+] 192.168.159.10:88 - Received AP-REQ. Extracting session key...
[+] Successfully bound to the LDAP server!
[*] Discovering base DN automatically
[*] 192.168.159.10:389 Discovered base DN: DC=msflab,DC=local
[+] Successfully reset password for mhatter.
[*] Auxiliary module execution completed
metasploit-framework.pr (S:0 J:0) auxiliary(admin/ldap/change_password) > set NEW_PASSWORD ItsBeer30!
NEW_PASSWORD => ItsBeer30!
metasploit-framework.pr (S:0 J:0) auxiliary(admin/ldap/change_password) > run
[*] Running module against 192.168.159.10
[*] Using cached credential for ldap/[email protected] [email protected]
[+] 192.168.159.10:88 - Received AP-REQ. Extracting session key...
[+] Successfully bound to the LDAP server!
[*] Discovering base DN automatically
[*] 192.168.159.10:389 Discovered base DN: DC=msflab,DC=local
[+] Successfully reset password for mhatter.
[*] Auxiliary module execution completed
metasploit-framework.pr (S:0 J:0) auxiliary(admin/ldap/change_password) > set TARGET_USER doesnotexist
TARGET_USER => doesnotexist
metasploit-framework.pr (S:0 J:0) auxiliary(admin/ldap/change_password) > run
[*] Running module against 192.168.159.10
[*] Using cached credential for ldap/[email protected] [email protected]
[+] 192.168.159.10:88 - Received AP-REQ. Extracting session key...
[+] Successfully bound to the LDAP server!
[*] Discovering base DN automatically
[*] 192.168.159.10:389 Discovered base DN: DC=msflab,DC=local
[-] Auxiliary aborted due to failure: not-found: Failed to find sAMAccountName: doesnotexist
[*] Auxiliary module execution completed
metasploit-framework.pr (S:0 J:0) auxiliary(admin/ldap/change_password) >
</details>
Release NotesThis adds a module that is able to change a user's password knowing the current value or reset a user's password given the necessary permissions using LDAP. |
This adds a module,
auxiliary/admin/ldap/change_password
, for changing/resetting AD passwords over the LDAP protocol.Actions:
CHANGE
: Changing an existing (known password).RESET
: Forcing a password reset by having privileges over the target account.Works on both standard 389 and SSL-encrypted on 636 (since we use GSS-API encryption)
Verification
Do the test cases below with:
Main use cases: