- Joined
- Oct 13, 2016
- Messages
- 6
- Reaction score
- 0
setacl.exe -on "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{F72671A9-012C-4725-9D2F-2A4D32D65169}" -ot reg -actn list
SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{C2F03A33-21F5-47FA-B4BB-156362A2F239}" -ot reg -actn setowner -ownr "n:NT SERVICE\TrustedInstaller"
Hi Dale,
Welcome to the Forum.
I'll attempt to address your questions in the order asked, one post at a time as the answers while hopefully straightforward to follow, are not short.
First, you were wondering how I knew what owned the Registry Key prior to taking ownership of it to perform the necessary editing of the DistributedCOM.
There are a number of ways to do this, the easiest of which would be to open the Registry Editor and check permissions there first before changing ownership of the specific key.
For example:
- Press Windows key and R key together to open the Run dialog
- In the Run dialog type regedit then click OK
- When the User Account Control appears click Yes
- You'll now see the Registry Editor window appear. In its left pane click and expand to the key you wish to take ownership of. For example if we go to the AppID from article we would expand like so:
HKEY_LOCAL_MACHINENow that is quite a lot of clicking and scrolling to locate the key you wish to identify owner of. A simpler way would be to do the following.
— SOFTWARENow obviously there may be many other keys above the one we wish to change as can be seen in example image:
— Classes
— AppID
{F72671A9-012C-4725-9D2F-2A4D32D65169}
View attachment 4319
Right-click on the key in the left pane and select Permissions to open this window:
View attachment 4320
Click the Advanced button in the window to view the following:
View attachment 4322
And now you can see in this example the owner is TrustedInstaller
- Right-click on Start
- Left-click on Command Prompt (Admin)
- When the User Account Control appears click Yes
- Now in the Administrator: Command Prompt window type the following command:
Code:setacl.exe -on "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{F72671A9-012C-4725-9D2F-2A4D32D65169}" -ot reg -actn list
Press Enter key to execute
Sample image
View attachment 4323
You see the list command provides us the Owner which is in this example TrustedInstaller
Obviously, you would change path and key name to the one you want information on, but the four commands otherwise remain the same:
setacl.exe is needed first
-on is the command for the object name in the above example that name is the key name: {F72671A9-012C-4725-9D2F-2A4D32D65169} but you must include the FULL PATH to the object name, and this should be enclosed inside speech marks "FULL PATH to object\Object Name"
-ot is the command used to identify what the object type is. In this example the Object is a Registry key so its type is reg
-actn is the command for what action to perform on the object. In this example we chose list which provides the permission details of the reg object {F72671A9-012C-4725-9D2F-2A4D32D65169}
Finally, another giant clue is in the original Event Viewer error message:
View attachment 4325
In the red boxes you see it tells you the CLSID which is attempting to access the AppID's DistrubtedCOM has a User named System and also NT Authority\SYSYEM
The SID (S-1-5-18) is also a clue as this is unique to the SYSTEM and thus the owner must be SYSTEM for the CLSID key
In the green box we see the container's SID is unavailable. This is a clue in that generally when you see this it will be owned by the TrustedInstaller.
As this is the container SID we can also deduce this will be the owner for the AppID as the CLSID is attempting to access the DistributedCOM via its container.
You have the setacl.exe command above to confirm the owner of the AppID key.
Regards,
Regedit32
I get this back do you think it has the wrong owner?
I have tried setting ownership as descirbed
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>setacl.exe -on "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{F72671A9-012C-4725-9D2F-2A4D32D65169}" -ot reg -actn list
machine\SOFTWARE\Classes\AppID\{F72671A9-012C-4725-9D2F-2A4D32D65169}
DACL(protected+auto_inherited):
Administrators full allow container_inherit
TrustedInstaller full allow no_inheritance
TrustedInstaller full allow container_inherit+inherit_only
SYSTEM read allow no_inheritance
SYSTEM read allow container_inherit+inherit_only
Users read allow no_inheritance
Users read allow container_inherit+inherit_only
ALL APPLICATION PACKAGES read allow no_inheritance
ALL APPLICATION PACKAGES read allow container_inherit+inherit_only
S-1-15-3-1024-1065365936-1281604716-3511738428-1654721687-432734479-3232135806-4053264122-3456934681 read allow no_inheritance
S-1-15-3-1024-1065365936-1281604716-3511738428-1654721687-432734479-3232135806-4053264122-3456934681 read allow container_inherit+inherit_only
SetACL finished successfully.
C:\WINDOWS\system32>
C:\WINDOWS\system32>setacl.exe -on "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{C2F03A33-21F5-47FA-B4BB-156362A2F239}" -ot reg -actn list
machine\SOFTWARE\Classes\CLSID\{C2F03A33-21F5-47FA-B4BB-156362A2F239}
DACL(protected+auto_inherited):
Administrators full allow container_inherit
TrustedInstaller full allow no_inheritance
TrustedInstaller full allow container_inherit+inherit_only
SYSTEM read allow no_inheritance
SYSTEM read allow container_inherit+inherit_only
Users read allow no_inheritance
Users read allow container_inherit+inherit_only
ALL APPLICATION PACKAGES read allow no_inheritance
ALL APPLICATION PACKAGES read allow container_inherit+inherit_only
S-1-15-3-1024-1065365936-1281604716-3511738428-1654721687-432734479-3232135806-4053264122-3456934681 read allow no_inheritance
S-1-15-3-1024-1065365936-1281604716-3511738428-1654721687-432734479-3232135806-4053264122-3456934681 read allow container_inherit+inherit_only
SetACL finished successfully.
You can check by opening Registry Editor and checking Permissions > Advanced as earlier explained, or by using that List with setacl.exe command to confirm the principals with full control.
In your case it is correct based on your previous post.
Sorry for the delay in updating things.
I was trying to replicate your scenario to work out a resolution for you.
Attached is a zipped folder named: Take or Restore Ownership Scripts.zip
Inside this folder are two command scripts:
- TakeOwnership.cmd
- RestoreOwnership.cmd
Download the zipped folder, then run a quick virus scan. Extract folder and when you are logged in with a username that belongs to the Administrative Group, right-click on the TakeOwnership.cmd script and select Run as administrator which ought to take ownership for you of the two keys I mentioned in the article.
After that make the changes you need to make with the DCOMs, then when ready you can right-click on the RestoreOwnership.cmd script and select Run as administrator to restore ownership to defaults.
Regards,
Regedit32
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.