Skip to content

Commit

Permalink
enable access to HKEY_USERS trough reg.py
Browse files Browse the repository at this point in the history
  • Loading branch information
dadevel committed Nov 2, 2023
1 parent 4fdddb4 commit 56a7484
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions examples/reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,10 @@ def __strip_root_key(self, dce, keyName):
raise Exception('Error parsing keyName %s' % keyName)
if rootKey.upper() == 'HKLM':
ans = rrp.hOpenLocalMachine(dce)
elif rootKey.upper() == 'HKU':
elif rootKey.upper() == 'HKCU':
ans = rrp.hOpenCurrentUser(dce)
elif rootKey.upper() == 'HKU':
ans = rrp.hOpenUsers(dce)
elif rootKey.upper() == 'HKCR':
ans = rrp.hOpenClassesRoot(dce)
else:
Expand Down Expand Up @@ -532,7 +534,7 @@ def __parse_lp_data(valueType, valueData):
query_parser.add_argument('-keyName', action='store', required=True,
help='Specifies the full path of the subkey. The '
'keyName must include a valid root key. Valid root keys for the local computer are: HKLM,'
' HKU, HKCR.')
' HKU, HKCU, HKCR.')
query_parser.add_argument('-v', action='store', metavar="VALUENAME", required=False, help='Specifies the registry '
'value name that is to be queried. If omitted, all value names for keyName are returned. ')
query_parser.add_argument('-ve', action='store_true', default=False, required=False, help='Queries for the default '
Expand All @@ -545,7 +547,7 @@ def __parse_lp_data(valueType, valueData):
add_parser.add_argument('-keyName', action='store', required=True,
help='Specifies the full path of the subkey. The '
'keyName must include a valid root key. Valid root keys for the local computer are: HKLM,'
' HKU, HKCR.')
' HKU, HKCU, HKCR.')
add_parser.add_argument('-v', action='store', metavar="VALUENAME", required=False, help='Specifies the registry '
'value name that is to be set.')
add_parser.add_argument('-vt', action='store', metavar="VALUETYPE", required=False, help='Specifies the registry '
Expand All @@ -560,7 +562,7 @@ def __parse_lp_data(valueType, valueData):
delete_parser.add_argument('-keyName', action='store', required=True,
help='Specifies the full path of the subkey. The '
'keyName must include a valid root key. Valid root keys for the local computer are: HKLM,'
' HKU, HKCR.')
' HKU, HKCU, HKCR.')
delete_parser.add_argument('-v', action='store', metavar="VALUENAME", required=False, help='Specifies the registry '
'value name that is to be deleted.')
delete_parser.add_argument('-va', action='store_true', required=False, help='Delete all values under this key.')
Expand All @@ -576,7 +578,7 @@ def __parse_lp_data(valueType, valueData):
save_parser.add_argument('-keyName', action='store', required=True,
help='Specifies the full path of the subkey. The '
'keyName must include a valid root key. Valid root keys for the local computer are: HKLM,'
' HKU, HKCR.')
' HKU, HKCU, HKCR.')
save_parser.add_argument('-o', dest='outputPath', action='store', metavar='\\\\192.168.0.2\share', required=True, help='Output UNC path the target system must export the registry saves to')

# A special backup command to save HKLM\SAM, HKLM\SYSTEM and HKLM\SECURITY
Expand Down

0 comments on commit 56a7484

Please sign in to comment.