Re: Authenticate user



Hi,

No, i mean that i'm logged in as a user (User privilege) and i want to start
a process as Administrator or impersonate Administrator user to modify
registry key of HKEY_LOCAL_MACHINE.
The function LogonUser is working fine for Windows XP or above, but with
Windows 2000 this function require SE_TCB_NAME privilege enable for the
user.

Any other ways that i can log on as an Administrator and modify registry key
of HKEY_LOCAL_MACHINE (as when you logged on as a user, and go to User
Management in Control Panel, and there'll open a dialog for you enter user
name and password of an Administrator, and then it'll start the User
Management with Administrator privilege)

Thanks

Hieu Le


"Kellie Fitton" <KELLIEFITTON@xxxxxxxxx> wrote in message
news:1136072723.280516.41800@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> Well, if you want your process to impersonate the loggedOn user,
> then you need the token handle that represents that user, and if
> you obtain this token handle by using the following API's:
>
> GetCurrentProcess()
> OpenProcessToken()
>
> then that token will only represent the current process and its
> privileges, however, the proper approach of obtaining a token
> handle that represents the loggedOn user, and launching your own
> executable program under the user's security context privileges,
> is by simply using the following API's:
>
> LogonUserEx()
> ImpersonateLoggedOnUser()
> CreateEnvironmentBlock()
> GetUserProfileDirectory()
> LoadUserProfile()
> CreateProcessAsUser()
>
> Then,
>
> DestroyEnvironmentBlock()
> UnloadUserProfile()
> RevertToSelf()
> CloseHandle()
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthn/security/logonuserex.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/impersonateloggedonuser.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/policy/policy/createenvironmentblock.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/policy/policy/getuserprofiledirectory.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/policy/policy/loaduserprofile.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocessasuser.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/policy/policy/destroyenvironmentblock.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/policy/policy/unloaduserprofile.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/reverttoself.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/closehandle.asp
>
> Hope these information helps,
>
> Kellie.
>


.



Relevant Pages

  • Re: Authenticate user
    ... I think you need to use CreateProcessWithLogonW to do this. ... > start a process as Administrator or impersonate Administrator user to ... > Windows 2000 this function require SE_TCB_NAME privilege enable for the ... >> Well, if you want your process to impersonate the loggedOn user, ...
    (microsoft.public.platformsdk.security)
  • RE: Question regarding su.exe
    ... Many so called "administrator" applications do ... For instance, loading a driver should require admin rights, ... If you use su.exe to elevate the privilege ... Rather than using su or giving admin access, have you looked at what the app ...
    (Focus-Microsoft)
  • Re: Access is denied
    ... Primary User Name: Administrator ... Primary Domain: MICRON ... Client User Name: - ... > Event Category: Privilege Use ...
    (microsoft.public.windowsxp.general)
  • Re: Implementing a privileged IOCTL
    ... Even if the privilege is not enabled by default, any app can turn it on. ... The best way to do what you are doing is to sign your IOCTL request using a key that both the driver and app agrees on. ... None of the standard NT privileges describe my "loading firmware into a device" privilege quite precisely. ... on Windows 2003 I've noticed the Administrator doesn't ...
    (microsoft.public.development.device.drivers)
  • Re: SE_ASSIGNPRIMARYTOKEN_NAME
    ... |>instead install a service or perhaps create another administrator account ... admin account to do this, just leave it as "local service" should work, since by default, "local service" and "network ... service" does have this privilege granted. ...
    (microsoft.public.platformsdk.security)