Windows Impersonation from C#

It’s possible, although it requires you to do a lot of code. See NtCreateToken and CreateToken. You need SeCreateTokenPrivilege, although that won’t be a problem since you’re running under NT AUTHORITY\SYSTEM. You can then use the created token to impersonate inside a thread.

Leave a Comment