Skip to content

Instantly share code, notes, and snippets.

@dxflatline
Created August 28, 2017 21:03
Show Gist options
  • Save dxflatline/acd7df0053bb1ae543616b1f294f0ce7 to your computer and use it in GitHub Desktop.
Save dxflatline/acd7df0053bb1ae543616b1f294f0ce7 to your computer and use it in GitHub Desktop.
Impersonate TrustedInstaller.exe token
Slightly different version from tyranidlair, other functions used from NtObjectManager
Uninstall-Module NtObjectManager
Install-Module -Name NtObjectManager
Stop-Service TrustedInstaller
Start-Service TrustedInstaller
$tipid = get-process TrustedInstaller | select -expand id
$token = Get-NtTokenFromProcess -ProcessId $tipid
$current = Get-NtThread -Current -PseudoHandle
$imp = $current.Impersonate($token)
$imp_token = Get-NtToken -Impersonation
$imp_token.Groups
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment