[RESOLVED] ShellLExec a program with normal privileges ?
Hello,
I have a program which runs elevated as an Admin. Now this needs to shell another program, but it's doing that elevated too, since its own process runs elevated!
How do you shell so that the shelled program runs normally with its own manifest ?
Re: ShellLExec a program with normal privileges ?
This is an unusual requirement and there isn't any clear-cut way to do it.
See Launch a Process as Standard User from an Elevated Process for one discussion of the issues involved. It gets complicated, because even with UAC users should not be logging in as members of the Administrators group. Pay attention to OTS Elevation, since that's what should be used instead and will be except on casual home users' systems where desperately trying to pretend we still live in a Win9x world is common.
Re: ShellLExec a program with normal privileges ?
Quote:
Originally Posted by
dilettante
This is an unusual requirement and there isn't any clear-cut way to do it.
C++ :/
Then again, is it worth the hassle?
Enable the SeIncreaseQuotaPrivilege in your current token (sample)
Get an HWND representing the desktop shell (GetShellWindow)
Get the Process ID (PID) of the process associated with that window (GetWindowThreadProcessId)
Open that process (OpenProcess)
Get the access token from that process (OpenProcessToken)
Make a primary token with that token (DuplicateTokenEx)
Start the new process with that primary token (CreateProcessWithTokenW)
Perhaps if I find a solution to this Get WinKey without Admin Rights ? then I won't need any of this ?
EDIT:
Just found a solution which means yes I don't need the hassle of user rights :)
Re: [RESOLVED] ShellLExec a program with normal privileges ?