Process Hacker and Windows discussion

 
User avatar
MagicAndre1981
Member
Posts: 230
OS: Windows 8Pro(x64) with Win7 UI

Run cmd.exe as trustedinstaller

13 Jun 2015, 10:19

What do I have to enter under "Run As" to run cmd.exe as TrustedInstaller?

I need it to extract files from WinSxS to move them again into a .CAB file. This script only works when I run it as trustedinstaller. I used DevxExec, but in Win8.x it fails to run the tool as trustedinstaller (error 0xc0000142). I found a workaround by running DevxExec under Depends.exe (Tracing mode with F7), but this is annoying.
 
User avatar
wj32
Founder
Posts: 948
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

14 Jun 2015, 08:59

If you can get something else to run as TrustedInstaller, right-click that process and choose Miscellaneous > Run As This User.
 
User avatar
MagicAndre1981
Member
Posts: 230
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

14 Jun 2015, 18:14

I don't understand what you mean. Here I can launch a program with system rights easily when I select a service, but I need trustedinstaller.
 
User avatar
wj32
Founder
Posts: 948
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

14 Jun 2015, 23:47

Rather than selecting a service, select a process that is running as TrustedInstaller. Usually there are no such processes, so you'll have to make one appear by running Windows Update or installing a msi.
 
User avatar
MagicAndre1981
Member
Posts: 230
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

15 Jun 2015, 04:21

nope, this launches the programs as SYSTEM, not TrsutedInstaller.
 
User avatar
wj32
Founder
Posts: 948
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

15 Jun 2015, 04:33

Are you sure you selected "Run As This User", not "Run As"? The user name field should be disabled. Did you make sure the TrustedInstaller process was still running by the time PH tried to start cmd? You can try suspending it.
 
User avatar
MagicAndre1981
Member
Posts: 230
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

15 Jun 2015, 17:20

yes, I'm sure. TrustedInstaller.exe/TiWorker.exe run as SYSTEM, so using "Run As This User" runs the program as system and not trustedinstaller.
 
User avatar
wj32
Founder
Posts: 948
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

15 Jun 2015, 21:01

No, I didn't mean TrustedInstaller.exe. I meant a process that is running under the TrustedInstaller user account.
 
User avatar
MagicAndre1981
Member
Posts: 230
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

16 Jun 2015, 04:27

there is no other process running as TrustedInstaller
 
User avatar
wj32
Founder
Posts: 948
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

16 Jun 2015, 05:56

That's why you need to start one somehow.
 
User avatar
MagicAndre1981
Member
Posts: 230
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

17 Jun 2015, 04:09

yeah, but this is what I want to achieve with ProcessHacker ...
 
User avatar
wj32
Founder
Posts: 948
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

17 Jun 2015, 04:48

In Windows 8 is TrustedInstaller a user, or does it just need to appear in the process token in order to achieve what you want? Maybe you could modify PH's code to call NtCreateToken and use that when starting the process.
 
User avatar
MagicAndre1981
Member
Posts: 230
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

20 Jun 2015, 08:38

ok, got it. Your thought was correct. I have to use "Run as this user" and select the TiWorker/TrustedInstaller.exe. Here I get what I need for the cmd.exe: "NT SERVICE\TrustedInstaller, Owner (Default Enabled)" .


So, can you please add trustedinstaller as item to the RunAs dialog which does this:

1- look if Trustedinstaller is running and if not start the trusted installer service
2- call Run As this user and use the TiWorker/TrustedInstaller.exe
3- if TrustedInstaller was not running stop it again otherwise leave it running
 
User avatar
wj32
Founder
Posts: 948
OS: Windows
Location: Australia
Contact:

Re: Run cmd.exe as trustedinstaller

20 Jun 2015, 09:14

I think it might be even better to have a custom token creation dialog where you can choose which groups you want to add to the token :P
 
User avatar
MagicAndre1981
Member
Posts: 230
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

31 Jan 2016, 08:45

wj32 wrote:
I think it might be even better to have a custom token creation dialog where you can choose which groups you want to add to the token :P
if you have the time to add it, this would be awesome
 
viddkideo

Re: Run cmd.exe as trustedinstaller

18 Jul 2016, 14:08

You lost me at Miscellaneous > Run As This User
and find TiWorker/trustedinstaller.exe

what context menu has that available? what do I edit to add those options?
 
User avatar
viksoftru
Member
Posts: 616
OS: Win7 (Live! DVD), BSD
Location: Russia

Re: Run cmd.exe as trustedinstaller

19 Jul 2016, 12:33

I see. :) Just press Apps button on selected process and see screen:
2.png
v3.0.0.144
 
User avatar
dmex
Admin
Posts: 1500
Location: Australia

Re: Run cmd.exe as trustedinstaller

12 Aug 2016, 16:56

Trusted Installer Plugin:
viewtopic.php?t=2407

Image
 
User avatar
MagicAndre1981
Member
Posts: 230
OS: Windows 8Pro(x64) with Win7 UI

Re: Run cmd.exe as trustedinstaller

13 Aug 2016, 18:47

awesome, it works fine. thanks :)