#7 Windows NT service start/stop as non-privileged user

open
nobody
None
5
2012-12-11
2005-08-25
No

I need to be able to start/stop the JSW Windows NT
service as a non-administrator user. However, as it
seems tricky to change the security descriptor of a
particular service, I preferred to investigate the access
rights asked when invoking the OpenSCManager and
OpenService methods in source file src/c/wrapper_win.c.
Thus I lowered drastically these access rights in both
start and stop methods, tested it and it works fine.
That's why I submit this minor update:
- SC_MANAGER_ALL_ACCESS changed to
SC_MANAGER_CONNECT +
STANDARD_RIGHTS_READ
- SERVICE_ALL_ACCESS changed to
SERVICE_QUERY_STATUS + SERVICE_START or
_STOP
Hope it will help.

Discussion

  •  
    Attachments
  • svachery
    svachery
    2005-10-06

    Logged In: YES
    user_id=1357672

    Windows allow "Power Users" to start/stop services.
    By checking for SC_MANAGER_ALL_ACCESS even "Power Users" are
    not allowed to start/stop services with the wrapper executable.