-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Can't add REG_MULTI_SZ registry values using reg.py #1720
Comments
Hey just noticed this from the other issue I was tagged in. An example command would look like: This will be a list like: ['First', 'Second' 'Multi Space', 'Fourth'] which you can then concat together with NULL strings inbetween and an empty string at the end (going off of the documentation that's what it wants). |
Really like this format. @Marshall-Hallenbeck 👍 |
For clarity I would have used this format: python reg.py "<domain>/<user>@<target>" add -keyName "<whatever>" -v "<whatever>" -vt "REG_MULTI_SZ" -vd "First" -vd "Second" -vd "Multi Space" -vd "Fourth" In my opinion this would be clearer in the command line syntax. We could use the parseargs Lines 562 to 563 in 269ce69
Would become: add_parser.add_argument('-vd', action='append', metavar="VALUEDATA", required=False, help='Specifies the registry '
'value data that is to be set.', default=['']) What do you think? |
Implemented in #1785 |
Configuration
impacket version: 0.11.0
Python version: N/A
Target OS: Windows
There's no way to add multi string keys in the registry using reg.py example.
According to MS documentation https://learn.microsoft.com/en-us/windows/win32/sysinfo/registry-value-types value should be
Here it can be seen how winreg is handling it -> https://github.com/python/cpython/blob/main/PC/winreg.c#L660
I guess we should define a syntax on how different strings will be passed to the script.
Additional context
As a side note, reading MULTI_SZ keys is ommiting the separation. For example
The text was updated successfully, but these errors were encountered: