I have a windows service running as local system. I would like the service to spawn a process as “NT AUTHORITY/Network Service”. However, I do not have the credentials for this account. How can I spawn the process as the “Network Service” user, using c++.
Share
I’m not in front of my win32 dev box, so I can’t confirm, but I’ll offer two possible approaches:
OpenProcess()to get the handle of an existing NETWORK SERVICE processOpenProcessToken()using that handle to get the security token from his processCreateProcessAsUser()with the token to create a process as NETWORK SERVICEAlternatively, you could:
CreateService()usingNT AUTHORITY\NetworkServiceinlpServiceStartNameStartService()to launch the process