Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Windows MFC Services
Hello, Everybody.
 
I'm writing a service which runs javascript file with cscript.
 
I have two apps - client.exe and service.exe. Client sends the service a request to run cscript.exe with parameters.
 
The javascript file is for installing software - wpkg.js
I tried to create service to run as each type of LocalService, LocalSystem and NetworkService.
 
Would anyone help me understand LocalSystem's privilleges and what it can do exactly?
I'm concerned about if LocalSystem service can read all of registry keys.
 

Thanks,
Paul.
Posted 18-Mar-13 2:57am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

From what Microsoft say[^] it looks like LocalSystem will have all the privilleges and access you will ever need.
However if you can run successfully as LocalService[^] then that may be considered a lower security risk and you may not need to audit every line of your code depending on your customer requirements.
  Permalink  
Comments
Paul Zheng at 18-Mar-13 8:28am
   
Hi Matthew, I appreciate your first reply.
 
But when I tried to read registry key from service, it failed, while reading registry key from ordinary application succeeds. Have you got any idea what could be the cause of this problem?
 
Thanks,
Paul.
Matthew Faithfull at 18-Mar-13 8:39am
   
From the look of things this is going to be a specific issue with a particular Registry Key right not just a total failure to read any Registry Key?
If so then you'll need to examine the error you get back from the access attempt that fails, and you might want to try and retrieve and examine the ACL applicable to the key from the application that can access it. This should at least allow you to work out any privillege you need and don't have.
If you then add the details you've found to your question it will help others to help you.
Paul Zheng at 20-Mar-13 8:51am
   
Thanks for your recommendation. Here is another question.

If I get environment variable from the service I'm running as LocalSystem account, which varible will be fetched, User Variable or System Variable?
Matthew Faithfull at 20-Mar-13 9:05am
   
That's a good question and one I don't know the answer to. It should be straight forward enough to find out by experiment. I would expect you'll get the System Variable as LocalSystem isn't a real account but I wouldn't gaurantee it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 515
1 Maciej Los 340
2 Richard MacCutchan 265
3 BillWoodruff 225
4 Mathew Soji 155
0 OriginalGriff 8,804
1 Sergey Alexandrovich Kryukov 7,457
2 DamithSL 5,689
3 Maciej Los 5,279
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411028.1 | Last Updated 20 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100