Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/documentation/modules/auxiliary/admin/registry_security_descriptor.md
Views: 11783
Vulnerable Application
This module reads or writes a Windows registry security descriptor remotely.
In READ mode, the FILE
option can be set to specify where the security descriptor should be written to.
The following format is used:
In WRITE mode, the FILE
option can be used to specify the information needed to write the security descriptor to the remote registry. The file must follow the same format as described above.
Verification Steps
Start msfconsole
Do:
use auxiliary/admin/registry_security_descriptor
Do:
run verbose=true rhost=<host> smbuser=<username> smbpass=<password> key=<registry key>
Verify the registry key security descriptor is displayed
Do:
run verbose=true rhost=<host> smbuser=<username> smbpass=<password> key=<registry key> file=<file path>
Verify the registry key security descriptor is saved to the file
Do:
run verbose=true rhost=<host> smbuser=<username> smbpass=<password> key=<registry key> action=write sd=<security descriptor as a hex string>
Verify the security descriptor is correctly set on the given registry key
Do:
run verbose=true rhost=<host> smbuser=<username> smbpass=<password> file=<file path>
Verify the security descriptor taken from the file is correctly set on the given registry key
Options
KEY
Registry key to read or write.
SD
Security Descriptor to write as a hex string.
SECURITY_INFORMATION
Security Information to read or write (see https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/23e75ca3-98fd-4396-84e5-86cd9d40d343 (default: OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION).
FILE
File path to store the security descriptor when reading or source file path used to write the security descriptor when writing
Scenarios
Read against Windows Server 2019
Write against Windows Server 2019
Note that the information security has been set to 4 (DACL_SECURITY_INFORMATION) to avoid an access denied error.