-
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
DCSync using Kerberos #18419
DCSync using Kerberos #18419
Conversation
I gave this a quick test and confirmed it's working with PTT as intended now. I was able to follow the steps I outlined in my original ticket and it's working. I still need to test some other modules but over all this is looking pretty good. |
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.
Thanks @smashery, this is awesome! I tested in my environment and it works great. I just left a few comments for you to review when you get a chance.
lib/msf/core/exploit/remote/kerberos/service_authenticator/base.rb
Outdated
Show resolved
Hide resolved
return false | ||
end | ||
set_decrypted_packet(dcerpc_response, result) | ||
end |
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 I understand this correctly, self.krb_encryptor.decrypt_and_verify
should only verify if the decrypted data is correct (checksum, sequence number, etc.). I believe the signature in the DCERPC response is not verified. This method is supposed to also verify the signature and return a boolean.
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.
decrypt_and_verify
passes off to the respective Kerberos encryption routines to do the decryption+verification. These throw exceptions if it's invalid (error message will be "HMAC integrity error". So the rescue
above will catch that and return false
. But good catch - function needs to return true
if it passes through without error.
Tested one last time and everything looks good to me now. I'll get this landed in a moment. Testing Output
In this output we can see the module obtains, stores and then reuses a kerberos ticket. With a cached ticket and no password, the module now works as intended. |
Release NotesThis updates the |
This PR enables the use of Kerberos authentication with the
windows_secret_dump
module (DCSync).It relies on a corresponding PR in the https://github.com/rapid7/ruby_smb repository (rapid7/ruby_smb#253). Make sure you include those changes when testing.
Verification
msfconsole
use windows_secrets_dump
run rhosts=<IP> smbdomain=<domain> smbuser=<admin> smb::rhostname=<hostname> domaincontrollerrhost=<ip> smbpass=<password> smb::auth=kerberos action=domain
gpupdate /force
, and purging the MSF kerberos ticket cache (klist -d
)smb::auth=ntlm
)winrm_cmd
andpsexec
modules)