Reg tool connects to the Windows Remote Registry service over RPC and lets you browse registry keys, save hives, dump the SAM database, retrieve LSA secrets, read the system key, and get or set security descriptors — all without requiring an interactive session on the target.
Subcommands
| Command | Description |
|---|---|
| list | List the contents of a registry key |
| set | Set one or more values in a registry key |
| save | Save a registry key hive to a file |
| keyinfo | Get metadata about a registry key |
| syskey | Retrieve the system key (syskey/bootkey) |
| dumpsam | Dump the SAM database |
| dumplsasecrets | Dump LSA secrets |
| getsd | Get the security descriptor of a registry key |
| setsd | Set the security descriptor of a registry key |
| getdcomapp | Get information about a DCOM application |
For help on any subcommand, run
Reg <subcommand> -h.list
Lists the subkeys and values of a registry key.Parameters
Parameters
List options
List options
Include subkey names in the output.
Include value names in the output.
Include the data stored in each value.
Open the key using backup semantics (requires
SeBackupPrivilege).Output fields
Output fields
Possible
-OutputFields values: Name, ItemType, ValueType, ClassName, Value, BytesAsHexString.Examples
set
Sets one or more registry values across one or more keys in a single invocation.Parameters
Parameters
Item specification
Item specification
Keys are specified as
Default encodings per type:
<root>\<key> or <root>/<key>. Values follow the pattern:| Encoding | Description | Example |
|---|---|---|
C | UTF-16 with C-style escapes | hello\n |
Cz | UTF-16 with C-style escapes, null-terminated | hello\n |
Hex | Hex-encoded bytes | 0123b5 |
Dword | Decimal, hex (0x), or binary (0b) | 42 / 0x2A |
DwordBE | Same as Dword but big-endian | 42 |
File | Load data from file as-is | ./data.bin |
Sddl | SDDL string converted to binary security descriptor | |
Utf16 | UTF-16 string with C escapes | Test\r\n |
Utf16z | UTF-16 string with C escapes, null-terminated | Test\r\n |
| Value type | Default encoding |
|---|---|
BINARY | Hex |
DWORD | Dword |
DWORD_BIG_ENDIAN | DwordBE |
EXPAND_SZ | Utf16z |
MULTI_SZ | Utf16 |
QWORD | Qword |
SZ | Utf16z |
Set options
Set options
Open keys using backup semantics.
Examples
save
Saves a registry key and its entire subtree to a file on the remote server’s filesystem.Parameters
Parameters
keyinfo
Retrieves metadata about a registry key: subkey count, value count, last write time, and security descriptor size.Parameters
Parameters
Output fields
Output fields
Possible
-OutputFields values: ClassName, SubkeyCount, MaxSubkeyLength, MaxClassLength, ValueCount, MaxValueNameLength, MaxValueDataLength, SecurityDescriptorLength, LastWriteTime.Key info options
Key info options
Open the key using backup semantics.
syskey
Retrieves the system key (also called the boot key or syskey) from a remote system. The system key is used to encrypt sensitive data in the SAM and LSA hives.Parameters
Parameters
Name or address of the RPC server.
Syskey options
Syskey options
Open registry hives using backup semantics (required when running as Backup Operator).
Output fields
Output fields
Possible
-OutputFields values: Chars, Length.Example
dumpsam
Dumps the Security Account Manager (SAM) database from a remote system, extracting local account names and NTLM password hashes.Parameters
Parameters
Name or address of the RPC server.
Dump options
Dump options
Open registry hives using backup semantics. Use this when authenticating as a Backup Operator instead of a full administrator.
Output fields
Output fields
Possible
-OutputFields values: AccountName, FullName, Rid, NtlmHashText.Example
dumplsasecrets
Dumps LSA secrets from a remote system. LSA secrets can contain cached service account credentials, machine account passwords, and other sensitive data stored by the Local Security Authority.Parameters
Parameters
Name or address of the RPC server.
Dump options
Dump options
Open registry hives using backup semantics.
Output fields
Output fields
Possible
-OutputFields values: Name, CurrentValueHex, OldValueHex, CurrentUpdateTime, OldUpdateTime, SecurityDescriptorSddl.Example
getsd
Retrieves the security descriptor of a registry key, including the DACL, owner, group, and optionally the SACL.Parameters
Parameters
Security descriptor options
Security descriptor options
Request the discretionary ACL.
Request the owner SID.
Request the group SID.
Request the system ACL (requires
SeSecurityPrivilege).Open the key using backup semantics.
By default,
getsd requests the DACL, owner, and group. If you specify any of the -Include* flags explicitly, only the components you list are requested.Examples
setsd
Sets the security descriptor of a registry key using an SDDL string.Parameters
Parameters
Set options
Set options
Open the key using backup semantics.
Example
getdcomapp
Reads DCOM application configuration from the registry, including launch and access permissions.Parameters
Parameters
Output fields
Output fields
Possible
-OutputFields values: AppId, Title, LaunchPermissions, AccessPermissions, IsDllSurrogate, LocalService, ServiceParameters, RunAs, PreferredServerBitness, AuthenticationLevel.Get options
Get options
Open registry keys using backup semantics.
Common options
AllReg subcommands accept these shared RPC and SMB connection options.
RPC transport
RPC transport
| Option | Description |
|---|---|
-Spnego | Use SPNEGO for authentication |
-AuthEpm | Authenticate EP mapper requests |
-EncryptEpm | Encrypt EP mapper requests |
-EncryptRpc | Encrypt RPC messages |
-PreferSmb | Use named pipes over SMB instead of TCP when available |
SMB connection
SMB connection
| Option | Description |
|---|---|
-Dialects | SMB2 dialects to negotiate: Smb2_0_2, Smb2_1, Smb3_0, Smb3_0_2, Smb3_1_1 |
-RequireSigning (-signreq) | Require SMB packet signing |
-RequireSecureNegotiate | Require authenticated negotiation |
-EncryptSmb | Require an encrypted SMB connection |
-FollowDfs (-F) | Follow DFS referrals (default: true) |
Authentication
Authentication
| Option | Description |
|---|---|
-UserName (-u) | User name (without domain) |
-UserDomain (-ud) | User domain |
-Password (-p) | Password |
-NtlmHash | NTLM hash for pass-the-hash |
-AesKey | AES-128 or AES-256 Kerberos key |
-Tgt | TGT file path (.kirbi or ccache) |
-Kdc (-K) | KDC endpoint |
Connection
Connection
| Option | Description |
|---|---|
-HostAddress (-ha) | Override network address |
-UseTcp6Only (-6) | Force IPv6 |
-UseTcp4Only (-4) | Force IPv4 |
-Socks5 | SOCKS5 proxy endpoint |
Related tools
Sddl
Parse and describe security descriptors returned by
getsd.Dcom
Invoke methods on DCOM objects whose configuration you read with
getdcomapp.