Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista General

Vista - Is it possible for a service to start a user app running with admin privilege?

Reply
 
Old 02-15-2007   #1 (permalink)
Polaris


 
 

Is it possible for a service to start a user app running with admin privilege?

Hi Vista Experts:

I have an UI application which needs admin privilege to run on Vista. In
order for non-admin user to run it, can I create a service and then the
service calls CreateProcessAsUser with a duplicate token of the service
itself to start the UI application for the non-admin user to interact with?
If the UI App is started this way, will it have the same privilege as the
service (and thus be able to run with admin privilege)?

Thanks in advance.

Polaris



My System SpecsSystem Spec
Old 02-16-2007   #2 (permalink)
Chad Harris


 
 

Re: Is it possible for a service to start a user app running with admin privilege?

Polaris--

I'd sure like to know what the application is. You should be able to rt.
click the program and give them permissions using the security tab which is
going to list all the user's profiles>add>edit, but I wouldn't think your
user would need to. What app do you have that others can't get permission
to run?

I would think that you could go to :\Windows\Program Files and if you need
to right click the folders and give the users you want privileges at the
security tab if you have to. I don't think a service would come into play
here.

CH

The Mighty Cheney has struck out. Chutzpah enough to pardon? In a psychotic
world anything goes for Bushey and Cheney.
The lawyuhs are richer a few million dollars. The closing arguments for the
defense should be good for Comedy Central and Saturday Night Live. Fitz has
been gentle in this case--but if he ever had a chance to tear this
administration a new one--it's on Closing Argument Tuesday.


"Polaris" <etpolaris@hotmail.com> wrote in message
news:%23e%23WPCYUHHA.528@TK2MSFTNGP03.phx.gbl...
> Hi Vista Experts:
>
> I have an UI application which needs admin privilege to run on Vista. In
> order for non-admin user to run it, can I create a service and then the
> service calls CreateProcessAsUser with a duplicate token of the service
> itself to start the UI application for the non-admin user to interact
> with? If the UI App is started this way, will it have the same privilege
> as the service (and thus be able to run with admin privilege)?
>
> Thanks in advance.
>
> Polaris
>


My System SpecsSystem Spec
Old 02-16-2007   #3 (permalink)
Polaris


 
 

Re: Is it possible for a service to start a user app running with admin privilege?

Thanks. Like I said, my app is an app with UI and it needs admin privilege
to run, what I'm trying to do is to find a way so that non-admin user can
still run this application.

Polaris

"Chad Harris" <vistaneedsmuchowork.net> wrote in message
news:uPUoWwYUHHA.5060@TK2MSFTNGP06.phx.gbl...
> Polaris--
>
> I'd sure like to know what the application is. You should be able to rt.
> click the program and give them permissions using the security tab which
> is going to list all the user's profiles>add>edit, but I wouldn't think
> your user would need to. What app do you have that others can't get
> permission to run?
>
> I would think that you could go to :\Windows\Program Files and if you need
> to right click the folders and give the users you want privileges at the
> security tab if you have to. I don't think a service would come into play
> here.
>
> CH
>
> The Mighty Cheney has struck out. Chutzpah enough to pardon? In a
> psychotic world anything goes for Bushey and Cheney.
> The lawyuhs are richer a few million dollars. The closing arguments for
> the defense should be good for Comedy Central and Saturday Night Live.
> Fitz has been gentle in this case--but if he ever had a chance to tear
> this administration a new one--it's on Closing Argument Tuesday.
>
>
> "Polaris" <etpolaris@hotmail.com> wrote in message
> news:%23e%23WPCYUHHA.528@TK2MSFTNGP03.phx.gbl...
>> Hi Vista Experts:
>>
>> I have an UI application which needs admin privilege to run on Vista. In
>> order for non-admin user to run it, can I create a service and then the
>> service calls CreateProcessAsUser with a duplicate token of the service
>> itself to start the UI application for the non-admin user to interact
>> with? If the UI App is started this way, will it have the same privilege
>> as the service (and thus be able to run with admin privilege)?
>>
>> Thanks in advance.
>>
>> Polaris
>>

>



My System SpecsSystem Spec
Old 02-16-2007   #4 (permalink)
Chad Harris


 
 

Re: Is it possible for a service to start a user app running with admin privilege?

Assinging permissions by right clicking the program>properties>security tab
should allow the non-admin user to run the program. Just add the user using
the edit butt>by typing in user>check the privilegtes>close.

CH

"Polaris" <etpolaris@hotmail.com> wrote in message
news:%231BoJAZUHHA.600@TK2MSFTNGP05.phx.gbl...
> Thanks. Like I said, my app is an app with UI and it needs admin privilege
> to run, what I'm trying to do is to find a way so that non-admin user can
> still run this application.
>
> Polaris
>
> "Chad Harris" <vistaneedsmuchowork.net> wrote in message
> news:uPUoWwYUHHA.5060@TK2MSFTNGP06.phx.gbl...
>> Polaris--
>>
>> I'd sure like to know what the application is. You should be able to rt.
>> click the program and give them permissions using the security tab which
>> is going to list all the user's profiles>add>edit, but I wouldn't think
>> your user would need to. What app do you have that others can't get
>> permission to run?
>>
>> I would think that you could go to :\Windows\Program Files and if you
>> need to right click the folders and give the users you want privileges at
>> the security tab if you have to. I don't think a service would come into
>> play here.
>>
>> CH
>>
>> The Mighty Cheney has struck out. Chutzpah enough to pardon? In a
>> psychotic world anything goes for Bushey and Cheney.
>> The lawyuhs are richer a few million dollars. The closing arguments for
>> the defense should be good for Comedy Central and Saturday Night Live.
>> Fitz has been gentle in this case--but if he ever had a chance to tear
>> this administration a new one--it's on Closing Argument Tuesday.
>>
>>
>> "Polaris" <etpolaris@hotmail.com> wrote in message
>> news:%23e%23WPCYUHHA.528@TK2MSFTNGP03.phx.gbl...
>>> Hi Vista Experts:
>>>
>>> I have an UI application which needs admin privilege to run on Vista. In
>>> order for non-admin user to run it, can I create a service and then the
>>> service calls CreateProcessAsUser with a duplicate token of the service
>>> itself to start the UI application for the non-admin user to interact
>>> with? If the UI App is started this way, will it have the same privilege
>>> as the service (and thus be able to run with admin privilege)?
>>>
>>> Thanks in advance.
>>>
>>> Polaris
>>>

>>

>
>


My System SpecsSystem Spec
Old 02-16-2007   #5 (permalink)
Kerry Brown


 
 

Re: Is it possible for a service to start a user app running with admin privilege?

The whole point of the improved security in Vista is so that what you want
to do can't be done.

--
Kerry Brown
Microsoft MVP - Shell/User
http://www.vistahelp.ca


"Polaris" <etpolaris@hotmail.com> wrote in message
news:%231BoJAZUHHA.600@TK2MSFTNGP05.phx.gbl...
> Thanks. Like I said, my app is an app with UI and it needs admin privilege
> to run, what I'm trying to do is to find a way so that non-admin user can
> still run this application.
>
> Polaris
>
> "Chad Harris" <vistaneedsmuchowork.net> wrote in message
> news:uPUoWwYUHHA.5060@TK2MSFTNGP06.phx.gbl...
>> Polaris--
>>
>> I'd sure like to know what the application is. You should be able to rt.
>> click the program and give them permissions using the security tab which
>> is going to list all the user's profiles>add>edit, but I wouldn't think
>> your user would need to. What app do you have that others can't get
>> permission to run?
>>
>> I would think that you could go to :\Windows\Program Files and if you
>> need to right click the folders and give the users you want privileges at
>> the security tab if you have to. I don't think a service would come into
>> play here.
>>
>> CH
>>
>> The Mighty Cheney has struck out. Chutzpah enough to pardon? In a
>> psychotic world anything goes for Bushey and Cheney.
>> The lawyuhs are richer a few million dollars. The closing arguments for
>> the defense should be good for Comedy Central and Saturday Night Live.
>> Fitz has been gentle in this case--but if he ever had a chance to tear
>> this administration a new one--it's on Closing Argument Tuesday.
>>
>>
>> "Polaris" <etpolaris@hotmail.com> wrote in message
>> news:%23e%23WPCYUHHA.528@TK2MSFTNGP03.phx.gbl...
>>> Hi Vista Experts:
>>>
>>> I have an UI application which needs admin privilege to run on Vista. In
>>> order for non-admin user to run it, can I create a service and then the
>>> service calls CreateProcessAsUser with a duplicate token of the service
>>> itself to start the UI application for the non-admin user to interact
>>> with? If the UI App is started this way, will it have the same privilege
>>> as the service (and thus be able to run with admin privilege)?
>>>
>>> Thanks in advance.
>>>
>>> Polaris
>>>

>>

>
>


My System SpecsSystem Spec
Old 02-16-2007   #6 (permalink)
Jesper


 
 

Re: Is it possible for a service to start a user app running with

I think Polaris is trying to get at something else. Kerry summed it up: no.
Why does your app need admin privs? Can you factor out the components that do
and use COM Monikers to elevate those? If not, it is an administrative
applications and ordinary users should not run it in the first place.

"Chad Harris" wrote:

> Assinging permissions by right clicking the program>properties>security tab
> should allow the non-admin user to run the program. Just add the user using
> the edit butt>by typing in user>check the privilegtes>close.
>


My System SpecsSystem Spec
Old 02-16-2007   #7 (permalink)
B. Nice


 
 

Re: Is it possible for a service to start a user app running with admin privilege?

On Thu, 15 Feb 2007 23:11:03 -0800, "Kerry Brown"
<kerry@kdbNOSPAMsys-tems.c*a*m> wrote:

>The whole point of the improved security in Vista is so that what you want
>to do can't be done.


Good point :-)
My System SpecsSystem Spec
Old 02-16-2007   #8 (permalink)
David Hearn


 
 

Re: Is it possible for a service to start a user app running withadmin privilege?

Polaris wrote:
> Hi Vista Experts:
>
> I have an UI application which needs admin privilege to run on Vista. In
> order for non-admin user to run it, can I create a service and then the
> service calls CreateProcessAsUser with a duplicate token of the service
> itself to start the UI application for the non-admin user to interact with?
> If the UI App is started this way, will it have the same privilege as the
> service (and thus be able to run with admin privilege)?


Yes, I expect that a service can respond in some way to a user trigger
(eg. window message, comms on a particular port) and spawn a new process
with your application running with the service's privileges.

However - I understand that in Vista, services can no longer interact
with the standard desktop - in essence, you cannot have services which
have a GUI operating on the normal desktop. I suspect this means that
whilst your service could, in theory, start an application - the fact
you have a GUI on it means it wouldn't work as you expect. I'm not sure
how it would fail (whether app would start but you'd not see anything,
or wouldn't start at all). I guess they added this to stop services
being installed which would then be used to bypass UAC etc - just as you
thought.

There are some ways around this it seems, but they won't work as you
think. See
http://msdn2.microsoft.com/en-us/lib...ppcomp_topic10

Specifically it says:

"Quick solution:

* If the application's service uses a UI, a built-in mitigation in
Windows Vista allows the user to interact with the Session 0 UI in a
special desktop. This will make available the UI specific to the
application, instead of the entire Session 0 desktop."

Hope that helps

David
My System SpecsSystem Spec
Old 02-16-2007   #9 (permalink)
Dale


 
 

Re: Is it possible for a service to start a user app running with admin privilege?

There is a reason for the distinction between admin and non-admin users. If
your user needs admin access, then make him an administrator.

Dale

"Polaris" <etpolaris@hotmail.com> wrote in message
news:%231BoJAZUHHA.600@TK2MSFTNGP05.phx.gbl...
> Thanks. Like I said, my app is an app with UI and it needs admin privilege
> to run, what I'm trying to do is to find a way so that non-admin user can
> still run this application.
>
> Polaris
>
> "Chad Harris" <vistaneedsmuchowork.net> wrote in message
> news:uPUoWwYUHHA.5060@TK2MSFTNGP06.phx.gbl...
>> Polaris--
>>
>> I'd sure like to know what the application is. You should be able to rt.
>> click the program and give them permissions using the security tab which
>> is going to list all the user's profiles>add>edit, but I wouldn't think
>> your user would need to. What app do you have that others can't get
>> permission to run?
>>
>> I would think that you could go to :\Windows\Program Files and if you
>> need to right click the folders and give the users you want privileges at
>> the security tab if you have to. I don't think a service would come into
>> play here.
>>
>> CH
>>
>> The Mighty Cheney has struck out. Chutzpah enough to pardon? In a
>> psychotic world anything goes for Bushey and Cheney.
>> The lawyuhs are richer a few million dollars. The closing arguments for
>> the defense should be good for Comedy Central and Saturday Night Live.
>> Fitz has been gentle in this case--but if he ever had a chance to tear
>> this administration a new one--it's on Closing Argument Tuesday.
>>
>>
>> "Polaris" <etpolaris@hotmail.com> wrote in message
>> news:%23e%23WPCYUHHA.528@TK2MSFTNGP03.phx.gbl...
>>> Hi Vista Experts:
>>>
>>> I have an UI application which needs admin privilege to run on Vista. In
>>> order for non-admin user to run it, can I create a service and then the
>>> service calls CreateProcessAsUser with a duplicate token of the service
>>> itself to start the UI application for the non-admin user to interact
>>> with? If the UI App is started this way, will it have the same privilege
>>> as the service (and thus be able to run with admin privilege)?
>>>
>>> Thanks in advance.
>>>
>>> Polaris
>>>

>>

>
>


My System SpecsSystem Spec
Old 02-16-2007   #10 (permalink)
Dale


 
 

Re: Is it possible for a service to start a user app running with admin privilege?

Let alone the fact that it would take less than an hour to test the whole
thing if the OP knows anything about how to create a Windows service app.

Dale

"David Hearn" <david.hearn@newsgroup.nospam> wrote in message
news:ujM1k1aUHHA.3980@TK2MSFTNGP02.phx.gbl...
> Polaris wrote:
>> Hi Vista Experts:
>>
>> I have an UI application which needs admin privilege to run on Vista. In
>> order for non-admin user to run it, can I create a service and then the
>> service calls CreateProcessAsUser with a duplicate token of the service
>> itself to start the UI application for the non-admin user to interact
>> with? If the UI App is started this way, will it have the same privilege
>> as the service (and thus be able to run with admin privilege)?

>
> Yes, I expect that a service can respond in some way to a user trigger
> (eg. window message, comms on a particular port) and spawn a new process
> with your application running with the service's privileges.
>
> However - I understand that in Vista, services can no longer interact with
> the standard desktop - in essence, you cannot have services which have a
> GUI operating on the normal desktop. I suspect this means that whilst
> your service could, in theory, start an application - the fact you have a
> GUI on it means it wouldn't work as you expect. I'm not sure how it would
> fail (whether app would start but you'd not see anything, or wouldn't
> start at all). I guess they added this to stop services being installed
> which would then be used to bypass UAC etc - just as you thought.
>
> There are some ways around this it seems, but they won't work as you
> think. See
> http://msdn2.microsoft.com/en-us/lib...ppcomp_topic10
>
> Specifically it says:
>
> "Quick solution:
>
> * If the application's service uses a UI, a built-in mitigation in
> Windows Vista allows the user to interact with the Session 0 UI in a
> special desktop. This will make available the UI specific to the
> application, instead of the entire Session 0 desktop."
>
> Hope that helps
>
> David


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
How can I run scipts with Admin privilege? PowerShell
Solved Lost Admin Privilege! Please Help Me! General Discussion
admin privilege Vista account administration
Detect admin privilege due to elevation? Vista security
Is it possible for a service to start a user app running with admin privilege? Vista security


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46