sc config TrustedInstaller binPath= “cmd.exe /C del path/to/file”
sc config TrustedInstaller binPath= “C:\Windows\servicing\TrustedInstaller.exe”

SeDebugPrivilege

PS Set-NtTokenPrivilege SeDebugPrivilege
PS Start-Service TrustedInstaller
PS $p = Get-NtProcess -Name TrustedInstaller.exe
PS $t = $p.OpenToken()
PS $t.Groups | Where-Object {$_.Sid.Name -match “TrustedInstaller”}

PS Install-Module -Name NtObjectManager -RequiredVersion 1.1.32
PS Import NtObjectManager
PS $proc = $p = New-Win32Process cmd.exe -CreationFlags NewConsole -ParentProcess $p
PS $proc.Process.User

On new console, try whoami /groups

PS Restart-Service TrustedInstaller
PS $p = Get-NtProcess -Name TrustedInstaller.exe
PS $p
PS $th = $p.GetFirstThread()
PS $th
PS $current = Get-NtThread -Current PseudoHandle
PS $imp = $current.ImpersonateThread($th)
PS $imp_token = Get-NtToken -Impersonation
PS $imp_token
PS $imp_token.Groups

Leave a Reply

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny