[Solved] Hijacking registry permissions / locations to grant permissions in .cmd

Discussion in 'Scripting' started by RemixPL1994, May 16, 2021.

  1. RemixPL1994

    RemixPL1994 MDL Novice

    Jul 16, 2017
    20
    3
    0
    Hello, I am looking for and trying to find a way to take over a given location / registry key to grant permissions and to prevent the display of access denied, but instead of doing it manually and using programs that are immune to it, I would like to do it in some way built into the system without additional needed the software you need to download.

    Example:

    REG ADD "HKEY_CLASSES_ROOT\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" /v System.IsPinnedToNameSpaceTree /t REG_DWORD /d "0" /f

    REG ADD "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" /v System.IsPinnedToNameSpaceTree /t REG_DWORD /d "0" /f

    REG ADD "HKEY_CLASSES_ROOT\CLSID\{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}" /v System.IsPinnedToNameSpaceTree /t REG_DWORD /d "0" /f

    REG ADD "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{B4FB3F98-C1EA-428d-A78A-D1F5659CBA93}" /v System.IsPinnedToNameSpaceTree /t REG_DWORD /d "0" /f


    I searched the internet for general information on this subject and found TAKEOWN and ICACLS, but I quickly read that it only works for system files / folders, not for registry entries and the registry itself. Then, after further reading, I found something like REGINI:

    https://ss64.com/nt/regini.html

    And:

    https://blogs.msdn.microsoft.com/al...egistry-permissions-with-regini-exe-vbscript/

    https://docs.microsoft.com/pl-pl/ar...registry-permissions-with-regini-exe-vbscript

    Unfortunately, I am not able to understand how to use it and how to construct .cmd code in batch so that the permissions hijacking and the access denied prevention work automatically. So far I have managed to take over permissions and prevent access being denied only by additional external programs that work on processes and grant permissions. But maybe it can be done automatically using a script without external software for specific entered locations and values?

    Best regards.
     
  2. use setacl by helge klien to take full cureent user access of the reg key you want to tweak.
     
  3. RemixPL1994

    RemixPL1994 MDL Novice

    Jul 16, 2017
    20
    3
    0
    @mdl052020

    Can you show me what the whole code should look like from start to finish to get full permissions and prevent access denied and take over this key and give us the value I mean?


    REG ADD "HKEY_CLASSES_ROOT\CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" /v System.IsPinnedToNameSpaceTree /t REG_DWORD /d "0" /f


    What should it look like?
     
  4. pl go to win10 tweaking scripts thread & see turn of defender permanently . there you can see how to use setacl commandline switches to take full user access of reg key you want to tweak .
    or
    just as an example :

    SetACL -on "HKLM\SOFTWARE\Microsoft\Windows Defender" -ot reg -actn setowner -ownr "n:Administrators"
    SetACL -on "HKLM\SOFTWARE\Microsoft\Windows Defender" -ot reg -actn ace -ace "n:Administrators;p:full"
     
  5. RemixPL1994

    RemixPL1994 MDL Novice

    Jul 16, 2017
    20
    3
    0
    I think I understand. For this you need external software, i.e. SetACL by helge klein and powerrun. I thought it could be done somehow without the use of additional external software and executable .exe files that need to be downloaded.
     
  6. yes you understood it correctly brother . you can use only one thrid party app which you trust most.
    either powerrun by sordum or setacl by helge klien.
    both will gain full curent user accesa of whole reg key you want to tweak.

    i hope you query is resolved by this . please set your current thread title to Solved : then goes your current title name so that any other user who has the same query will not ask the same next time .
    i hope you can understand my pov aaking you to change the title of your thread to Success :
     
  7. RemixPL1994

    RemixPL1994 MDL Novice

    Jul 16, 2017
    20
    3
    0
  8. RemixPL1994

    RemixPL1994 MDL Novice

    Jul 16, 2017
    20
    3
    0
    #9 RemixPL1994, Jul 17, 2021
    Last edited: Aug 6, 2021
    (OP)
    -DEL