#ifndef _NTSEAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
NtImpersonateAnonymousToken(
_In_ HANDLE ThreadHandle
);
View code on GitHub
#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwImpersonateAnonymousToken(
_In_ HANDLE ThreadHandle
);
View code on GitHub
Impersonates the anonymous logon token on the specified thread.
ThreadHandle
- a handle to the thread. The handle must grant THREAD_IMPERSONATE
access.Depending on the EveryoneIncludesAnonymous
LSA setting, the anonymous logon token either has untrusted integrity with no group membership or low integrity with Everyone membership.
To reset impersonation, use NtSetInformationThread
with ThreadImpersonationToken
info class and a NULL
token handle.