Run program with different credentials?
Run program with different credentials?
Okay, I know all about runas.exe and running applications with a different set of credentials.
Here's my quandary... Application needs to run on one of my Windows 2000 PC's; Application needs at least Power User priveleges to start necessary hardware drivers.
This PC controls a print-head, and is constantly being used by different people. Any of those people needs to be able to step up to the PC, run the application (needs to have 2 networks drives mapped when they login, so needs to be a domain account). All these people have their own domain logins, but none of them are power users on any PCs.
The problem is, if I create a generic network login for this PC, then everyone who knows it will be able to login to the PC as a power user and do what they want (uninstall virus software if they chose).
The Application is kicked off with a bat file, btw. Bat file just does a 'net start' for each of the drivers it needs to run, and 'net stop' to close them.
Is there a way (besides writing a Windows Service) to either have the app components run under the local system account, or to specify a local/network username and password that it will run under, without the user having to know the password?
To add an extra twist, the software is written in such a (non-compliant, crappy) way that it will only run under the username it's installed under. If you install it under one account, it will not run under any other.
So I need to find a way for this app to run as (at least) a power user, but without the PC being logged in as an account with power user priveleges all the time. If it sits logged in as a power user, then anyone who walks up to it will be able to do whatever they want.
Sorry if I'm rambling a little - I'm fucking exhausted, or I probably would have found a way to do this already.
Here's my quandary... Application needs to run on one of my Windows 2000 PC's; Application needs at least Power User priveleges to start necessary hardware drivers.
This PC controls a print-head, and is constantly being used by different people. Any of those people needs to be able to step up to the PC, run the application (needs to have 2 networks drives mapped when they login, so needs to be a domain account). All these people have their own domain logins, but none of them are power users on any PCs.
The problem is, if I create a generic network login for this PC, then everyone who knows it will be able to login to the PC as a power user and do what they want (uninstall virus software if they chose).
The Application is kicked off with a bat file, btw. Bat file just does a 'net start' for each of the drivers it needs to run, and 'net stop' to close them.
Is there a way (besides writing a Windows Service) to either have the app components run under the local system account, or to specify a local/network username and password that it will run under, without the user having to know the password?
To add an extra twist, the software is written in such a (non-compliant, crappy) way that it will only run under the username it's installed under. If you install it under one account, it will not run under any other.
So I need to find a way for this app to run as (at least) a power user, but without the PC being logged in as an account with power user priveleges all the time. If it sits logged in as a power user, then anyone who walks up to it will be able to do whatever they want.
Sorry if I'm rambling a little - I'm fucking exhausted, or I probably would have found a way to do this already.
-
Underpants?
- Posts: 4755
- Joined: Mon Oct 22, 2001 7:00 am
-
Tormentius
- Posts: 4108
- Joined: Sat Dec 14, 2002 8:00 am
Re: Run program with different credentials?
T&T :icon10:R00k wrote:
Sorry if I'm rambling a little - I'm fucking exhausted, or I probably would have found a way to do this already.
I'd recommend creating an OU, placing this computer in it, and creating a GPO which will add Everyone to the Power Users group. You can use the Restricted Users section of the Computer Configuration/Security Policy to do this. As long as the kiosk machine is the only one in the OU then its the only station that this policy will apply to.
-
Tormentius
- Posts: 4108
- Joined: Sat Dec 14, 2002 8:00 am
Underpants? wrote:local policy can be different than domain policy, that way you can allow these users to be power users of this one machine only.
That would work easier than what I first suggested actually. You could manually add Domain Users to the local Power Users group on that machine. How can you tell that I've been fucking about with GPOs all day....
Last edited by Tormentius on Thu Jan 19, 2006 10:53 pm, edited 1 time in total.
-
Underpants?
- Posts: 4755
- Joined: Mon Oct 22, 2001 7:00 am
-
Tormentius
- Posts: 4108
- Joined: Sat Dec 14, 2002 8:00 am
RunAs can't save the password of the alternate user. I really hope they'll add that feature in a future version though.riddla wrote:this page could possibly set you in the right direction or give you some ideas for a bat file that will 'run as' with a power user account:
http://www.petri.co.il/run_ad_tools_as_another_user.htm
-
Underpants?
- Posts: 4755
- Joined: Mon Oct 22, 2001 7:00 am
GPO was the first thing I thought of too, then I remembered how goddamned lazy I amTormentius wrote:Underpants? wrote:local policy can be different than domain policy, that way you can allow these users to be power users of this one machine only.
That would work easier than what I first suggested actually. You could manually add Domain Users to the local Power Users group on that machine. How can you tell taht I've been fucking about with GPOs all day....![]()
-
Tormentius
- Posts: 4108
- Joined: Sat Dec 14, 2002 8:00 am
Deny internet access via local policy on the machine by setting firewall proxies to 0.0.0.0... domain shit will still work, but you can't get email and web virii that way. software will have to be installed by people who bring the CD. So make your people power users on the box and cut off the web access
-
Tormentius
- Posts: 4108
- Joined: Sat Dec 14, 2002 8:00 am
Okay, sorry guys, the entire situation has changed. Yes, I know, I should have posted this in T&T. :icon32:
Anyway, here's the new deal...
It is an XP box, not 2000 as I thought - I just went down and worked on it a little.
The application has 3 components that make it run:
1) The application files, which are in a directory right on the root of the C: drive (C:\Prism).
2) Two hardware devices that are started right before the application is started. These are listed in device manager, but are listed in the registry as services (HKLM\Software\MS\Windows\CurrentVersion\CurrentControlSet\Services).
3) The software only runs under the user it was installed for. However, this can be overcome by running a .reg file - it enters a key with 5 values under the HKEY_CURRENT_USER hive (HKCU\Software\Prism\WebController).
I am shooting to get this to run under any normal network login, if possible.
Setting permissions on the C:\Prism folder is easy, obviously. That's done.
I know there is a way to set permissions on the two services, so they can be run by a normal user, but haven't had any luck doing it yet. I tried using regedt32, and setting the Permissions on the two services listed under [HKLM\Software\MS\Windows\CurrentVersion\CurrentControlSet\Services]
so that all authenticated users have Modify access, but for some reason that still won't allow a normal user to start the device drivers.
I also know there is a way to enter information into a user's registry hive the first time they login. But the HKCU hive is different from the others, because it is different depending on who is logged in. How can I have make it so that Windows adds a certain key to the HKCU hive, only the first time a user logs in?
I tried adding the key to the HKCU\.DEFAULT tree, but that didn't do anything.
Any ideas?
Anyway, here's the new deal...
It is an XP box, not 2000 as I thought - I just went down and worked on it a little.
The application has 3 components that make it run:
1) The application files, which are in a directory right on the root of the C: drive (C:\Prism).
2) Two hardware devices that are started right before the application is started. These are listed in device manager, but are listed in the registry as services (HKLM\Software\MS\Windows\CurrentVersion\CurrentControlSet\Services).
3) The software only runs under the user it was installed for. However, this can be overcome by running a .reg file - it enters a key with 5 values under the HKEY_CURRENT_USER hive (HKCU\Software\Prism\WebController).
I am shooting to get this to run under any normal network login, if possible.
Setting permissions on the C:\Prism folder is easy, obviously. That's done.
I know there is a way to set permissions on the two services, so they can be run by a normal user, but haven't had any luck doing it yet. I tried using regedt32, and setting the Permissions on the two services listed under [HKLM\Software\MS\Windows\CurrentVersion\CurrentControlSet\Services]
so that all authenticated users have Modify access, but for some reason that still won't allow a normal user to start the device drivers.
I also know there is a way to enter information into a user's registry hive the first time they login. But the HKCU hive is different from the others, because it is different depending on who is logged in. How can I have make it so that Windows adds a certain key to the HKCU hive, only the first time a user logs in?
I tried adding the key to the HKCU\.DEFAULT tree, but that didn't do anything.
Any ideas?
I used this page ages ago to create a hidden Quake 3 server @ work which worked well.
Basically, in the link below tells you how to make a Windows Service out of anything you want. I've done it with batch scripts several times as well with standard applications. Once it is a service, you can set the account you want it to run as and if you want it to be shown on the desktop (as a running application) you can check the "Allow service to interact with desktop." box. Hope this helps.
http://www.raw-one.com/q3w/exe_as_service.mht
Basically, in the link below tells you how to make a Windows Service out of anything you want. I've done it with batch scripts several times as well with standard applications. Once it is a service, you can set the account you want it to run as and if you want it to be shown on the desktop (as a running application) you can check the "Allow service to interact with desktop." box. Hope this helps.
http://www.raw-one.com/q3w/exe_as_service.mht
-
Underpants?
- Posts: 4755
- Joined: Mon Oct 22, 2001 7:00 am
Sound like a nice job there man, I wish I still got to play with all that stuff. Are they hiring?raw wrote:I have no idea what I'm going to be doing in April. I started this new job recently and we just started our big project which entails re-designing an existing WAN from the ground up which includes a Distaster Recovery (DR) solution.
Anyway I'll let you know a little closer to April if/when we're coming and all that and see if you're busy.
May be a silly question, but have you had any problems running this on XP?raw wrote:I used this page ages ago to create a hidden Quake 3 server @ work which worked well.
Basically, in the link below tells you how to make a Windows Service out of anything you want. I've done it with batch scripts several times as well with standard applications. Once it is a service, you can set the account you want it to run as and if you want it to be shown on the desktop (as a running application) you can check the "Allow service to interact with desktop." box. Hope this helps.
http://www.raw-one.com/q3w/exe_as_service.mht
Would you mind sharing those?riddla wrote:If you need the srvany files I have them handy. I also run hidden services from work machines muahaha.
I d/l'ed the ResKit programs from MS's ftp, but they're useless when I extract them. I don't have the ResKit CD handy anywhere, so I can't use the installer to extract them properly.
Do you have the files already extracted and useable?
Thanks.
-
Underpants?
- Posts: 4755
- Joined: Mon Oct 22, 2001 7:00 am