RE: 'Access denied.' on OpenProcess() for NT Service under LocalSy
- From: Paul <vhr@xxxxxxxxxxxxxxxxx>
- Date: Thu, 10 Apr 2008 01:36:01 -0700
Thank you, Jeffrey.
Paul
""Jeffrey Tan[MSFT]"" wrote:
Hi Paul,.
Glad to see you got your problem resolved.
Yes, the MSDN documentation for AdjustTokenPrivileges states that:
"If the PreviousState parameter is not NULL, the handle must also have
TOKEN_QUERY access"
So if you do not need the previous privileges list of the token, you may
just pass NULL for the PreviousState parameter. Then, there is no need to
ask for TOKEN_QUERY permission in the code.
Ok, get back to your question. If you do not have any control over the
target process running account, enabling SE_DEBUG_NAME is essential. Withou
SE_DEBUG_NAME, even your service runs under Administrator or LocalSystem
account, you are not guaranteed with success. The DACL on the target
process object is free to remove allow ACE for Administrators and
LocalSystem.
Since a lot of system Administrators tools need to OpenProcess to any
process object, Windows created SE_DEBUG_NAME privilege as a back door for
the Administrators. This cool privilege just bypasses the security checks
on the process object. So SE_DEBUG_NAME is essential for system
Administration tools.(Administrators group has this privilege by default)
Please note that there is no such security back door for OpenProcessToken
API, so the code runs under Administrators count may even fail while
calling OpenProcessToken. I once wrote a security tool to query all the
token information for all the processes in system, I find it
OpenProcessToken will fail for some services.(These service tokens do not
grant access to Administrators). Some kernel developers argue and believe
that we should add a similiar SE_DEBUG_NAME privilege for OpenProcessToken
API.
Hope this helps.
Best regards,
Jeffrey Tan
- Follow-Ups:
- RE: 'Access denied.' on OpenProcess() for NT Service under LocalSy
- From: "Jeffrey Tan[MSFT]"
- RE: 'Access denied.' on OpenProcess() for NT Service under LocalSy
- References:
- Prev by Date: credential provider and SetSelected
- Next by Date: RE: 'Access denied.' on OpenProcess() for NT Service under LocalSy
- Previous by thread: RE: 'Access denied.' on OpenProcess() for NT Service under LocalSystem
- Next by thread: RE: 'Access denied.' on OpenProcess() for NT Service under LocalSy
- Index(es):
Relevant Pages
|