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. Change process security context

Change process security context

Scheduled Pinned Locked Moved C / C++ / MFC
databasesysadminsecurityquestion
4 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.
  • D Offline
    D Offline
    Don Miguel
    wrote on last edited by
    #1

    I have a ISAPI extension, which I suppose run in security account of IUSR_MACHINENAME. For accessing a database located on another server, I must change the user to an account which has rights in database. Is this possible? I know is possible to "create a process as user" but I don't know about changing the user during process running. If I'm on a wrong way of thinking, which are the possibilities? Regards, Don

    D 1 Reply Last reply
    0
    • D Don Miguel

      I have a ISAPI extension, which I suppose run in security account of IUSR_MACHINENAME. For accessing a database located on another server, I must change the user to an account which has rights in database. Is this possible? I know is possible to "create a process as user" but I don't know about changing the user during process running. If I'm on a wrong way of thinking, which are the possibilities? Regards, Don

      D Offline
      D Offline
      Daniel Lohmann
      wrote on last edited by
      #2

      It is not possible to change the security context of a running process. However, you could use impersonation to change the context of your current thread, which is actually what you want to do :-) For this you have to get a proper impersonation token from somewhere. You can get such a token via some IPC mechanisms (like NamedPipes, RPC, DCOM) or by calling LogonUser(). However, I doubt that IUSR_MACHINENAME has the necessary privileges to call LogonUser(). -- Daniel Lohmann http://www.losoft.de

      D 1 Reply Last reply
      0
      • D Daniel Lohmann

        It is not possible to change the security context of a running process. However, you could use impersonation to change the context of your current thread, which is actually what you want to do :-) For this you have to get a proper impersonation token from somewhere. You can get such a token via some IPC mechanisms (like NamedPipes, RPC, DCOM) or by calling LogonUser(). However, I doubt that IUSR_MACHINENAME has the necessary privileges to call LogonUser(). -- Daniel Lohmann http://www.losoft.de

        D Offline
        D Offline
        Don Miguel
        wrote on last edited by
        #3

        Thanks Daniel, You give me some good ideeas, with LogonUser(). If IUSR_... has not enough ritghts, I'll include it in Administrators group, and maybe will work. The other ideea, to Daniel Lohmann wrote: get such a token via some IPC mechanisms I simply don't understand: from where to request the token?? With who shall I communicate via IPC? ... and what is this "Impersonation" means??? Thanks again.

        D 1 Reply Last reply
        0
        • D Don Miguel

          Thanks Daniel, You give me some good ideeas, with LogonUser(). If IUSR_... has not enough ritghts, I'll include it in Administrators group, and maybe will work. The other ideea, to Daniel Lohmann wrote: get such a token via some IPC mechanisms I simply don't understand: from where to request the token?? With who shall I communicate via IPC? ... and what is this "Impersonation" means??? Thanks again.

          D Offline
          D Offline
          Daniel Lohmann
          wrote on last edited by
          #4

          Don Miguel wrote: You give me some good ideeas, with LogonUser(). If IUSR_... has not enough ritghts, I'll include it in Administrators group, and maybe will work. Uh, oh - I would double think about that. It's the sense of special IUSR_xxx accounts that they are low privileged and therefore your Inet apps do open a big security hole. I don't have much knowledge about all this IIS stuff, but maybe you could configure it to run your ISAPI in another user context than IUSR_xxx. That would be much better, because no other extensions are affected. -- Daniel Lohmann http://www.losoft.de

          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