Created
November 8, 2023 12:45
-
-
Save rbmm/652d5d9015aadb9c600d7c60f7acecc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OBJECT_ATTRIBUTES oa = { sizeof(oa) }; | |
LSA_HANDLE PolicyHandle; | |
if (0 <= LsaOpenPolicy(0, &oa, POLICY_LOOKUP_NAMES, &PolicyHandle)) | |
{ | |
ULONG CountOfRights; | |
static SID EveryOne = { SID_REVISION, 1, SECURITY_WORLD_SID_AUTHORITY, { SECURITY_WORLD_RID } }; | |
PLSA_UNICODE_STRING UserRights; | |
if (0 <= LsaEnumerateAccountRights(PolicyHandle, &EveryOne, &UserRights, &CountOfRights)) | |
{ | |
if (CountOfRights) | |
{ | |
UserRights += CountOfRights; | |
do | |
{ | |
DbgPrint("\"%wZ\"\n", --UserRights); | |
} while (--CountOfRights); | |
} | |
LsaFreeMemory(UserRights); | |
} | |
LsaClose(PolicyHandle); | |
} | |
////////////////////////////////////////// | |
"SeNetworkLogonRight" | |
"SeLockMemoryPrivilege" | |
"SeChangeNotifyPrivilege" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment