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
Windows Secrets Dump: Enable inline credentials dump #19048
Conversation
e3b5442
to
cf7092b
Compare
66ce346
to
4f6e2bc
Compare
Thanks @smcintyre-r7 for your review. I believe I answered to all your comments and made the requested changes. |
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 just finished testing the latest changes and everything appears to be working correctly. I checked running the module with the INLINE option both enabled and disabled. Each time, I confirmed with process monitor that the temporary file was online written when INLINE=false.
I think this is ready to go.
- This will bring in the GetKeySecurity and SetKeySecurity MS-RRP structures
a98554a
Release NotesThis updates the windows_secrets_dump module to enable accessing the necessary registry data without writing it to disk first. |
This improves the Windows Secrets Dump module by retrieving the credentials without touching the disk. This is based on this Impacket PR.
This technique takes advantage of the
WriteDACL
privileges held by local administrators to set temporary read permissions on theSAM
andSECURITY
registry hives. With this, it is not necessary to write these hives to disk and parse them, like it was with the original implementation.This technique is enabled by default and can be disable by setting the
INLINE
option tofalse
.The logic has been delegated to a new class
Msf::Util::WindowsRegistry::RemoteRegistry
, which takes care of setting the registry key security descriptor (DACL) to give enough permission to read it. It also takes care of restoring the original security descriptor immediately after the read operation. It also takes care of backing it up to a local file in case the restoring operation fails for some reason. The user will be able to restore it manually using a separate module, which will be added soon.These changes need this RubySMB related PR to be landed to work.
Verification
List the steps needed to make sure this thing works
msfconsole
use auxiliary/gather/windows_secrets_dump
run rhost=<remote host> smbuser=<username> smbpass=<user's password> verbose=true
inline=false