Have a service running as SYSTEM account. A client application calls OpenProcess (PROCESS_DUP_HANDLE | SYNCHRONIZE,x,x)
The client is running as administrator, and on Server 2008+ is running elevated. On Windows Server 2003 this works fine.
On Server 2008 R2 and Server 2016 if the service is running as SYSTEM the client running as local administrator, elevated, the client gets ACCESS DENIED opening the process running as system. If we change service to run as local administrator account, the OpenProcess from client works.
What we can see in Process Explorer - Properties - Security Tab - Permissions on the service process that can't be opened - in Server 2003 everyone has "Full control". In 2008 R2 and later no permissions have been added to the process.
If we enable SeDebugPrivilege in the client on Server 2008 R2+ then OpenProcess succeeds, even if service is running as system.
Unfortunately the code for client is no longer available, is there any system configuration that can allow this to work without SeDebugPrivilege in 2008 R2 and later?
I understand this would be blocked if the service was a protected process, but I don't think this is a protected process.
On Server 2003 if I run service exe as console (which it supports), as system account using psexec -sid I can't OpenProcess it even on 2003. the "Everyone" Doesn't get added with full control. So it seems like something specifc to the service configuration is being done differently.
I checked service ACLs with cmd sc sdshow on server 2003 and server 2008 R2 and the permissions are exactly the same.
Currently I'm resolving issue by launching process suspended, enabling SeDebugPrivilege then resuming the process, but interested if there is any other OS config options for resolving the problem.