Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. changing process access levels/rights

changing process access levels/rights

Scheduled Pinned Locked Moved C / C++ / MFC
json
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Luke Murray
    wrote on last edited by
    #1

    Hey, I'm trying to find some good information (articles, samples, whatever) on changing the access rights of a process. I believe the API methods include, OpenProcess, GetKernelObjectSecurity, GetSecurityDescriptorDacl, GetAclInformation, SetKernelObjectSecurity, etc. I am trying to disable some rights in a process like PROCESS_TERMINATE though I am having trouble finding some good information. Thanks all Luke

    _ 1 Reply Last reply
    0
    • L Luke Murray

      Hey, I'm trying to find some good information (articles, samples, whatever) on changing the access rights of a process. I believe the API methods include, OpenProcess, GetKernelObjectSecurity, GetSecurityDescriptorDacl, GetAclInformation, SetKernelObjectSecurity, etc. I am trying to disable some rights in a process like PROCESS_TERMINATE though I am having trouble finding some good information. Thanks all Luke

      _ Offline
      _ Offline
      __yb
      wrote on last edited by
      #2

      After u OpenProcess, u should OpenProcessToken and AdjustTokenPriviliges. In addition, u'd probably wanna use LookupPriviligeValue. For some more info and examples search for how to shutdown the syste HTH Yakov

      L 1 Reply Last reply
      0
      • _ __yb

        After u OpenProcess, u should OpenProcessToken and AdjustTokenPriviliges. In addition, u'd probably wanna use LookupPriviligeValue. For some more info and examples search for how to shutdown the syste HTH Yakov

        L Offline
        L Offline
        Luke Murray
        wrote on last edited by
        #3

        Cool, what privilege name do you use in LookupPrivilegeValue as I can not find something that seems to disable the right to terminate the process. I had found some things pointing to using Dacl's etc whihc is really annoying, to disable PROCESS_TERMINATE. Thanks

        _ 1 Reply Last reply
        0
        • L Luke Murray

          Cool, what privilege name do you use in LookupPrivilegeValue as I can not find something that seems to disable the right to terminate the process. I had found some things pointing to using Dacl's etc whihc is really annoying, to disable PROCESS_TERMINATE. Thanks

          _ Offline
          _ Offline
          __yb
          wrote on last edited by
          #4

          First, here's the privilege list: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/authorization_constants.asp[^] I believe u need SE_DEBUG_NAME to terminate processes. Look here: http://www.alexfedotov.com/articles/killproc.asp[^]

          L 1 Reply Last reply
          0
          • _ __yb

            First, here's the privilege list: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/authorization_constants.asp[^] I believe u need SE_DEBUG_NAME to terminate processes. Look here: http://www.alexfedotov.com/articles/killproc.asp[^]

            L Offline
            L Offline
            Luke Murray
            wrote on last edited by
            #5

            Thanks for the reply. What I am trying to do is disable the user from killing the app in task manager. first the program enabled SE_SYSTEM_NAME and then open the current process with ACCESS_SYSTEM_ALL (or something, dont have the code infront of me). Then I use GetKernelObjectSecurity to get the Dacl of the process and I adjust that by adding a AddAccessDeniedAce for the PROCESS_TERMINATE mask. and apply that to the Security descriptor and use SetKernelObjectSecurity to set it. Now this work for Windows NT. the task manager gets a 'access denied' when trying to kill the app. But in Win XP the Task manager gives itself the SE_DEBUG_NAME rights and can kill the app. How do I get around this? other programs acheive this, like some firewall apps still return access denied when trying to kill the task in Win XP. I understand using the kill cmd line tool from one of the SDK will always force the app to die. but I want to be able to stop the task manager form end task the app. Any ideas? Thanks Luke

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups