Skip to content

Create QueryUserTokens.cpp #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

rthxr
Copy link

@rthxr rthxr commented Feb 28, 2024

A functionality for extracting user tokens; For impersonation and other techniques

OpenProcessToken(hprocess, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken);
GetTokenInformation(hToken, TokenIntegrityLevel, NULL, 0, &cbSize);

PTOKEN_MANDATORY_LABEL pTIL = (PTOKEN_MANDATORY_LABEL)LocalAlloc(0, cbSize);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is pTIL leaking in the heap if not cleared with LocalFree?


if(integrity_level < SECURITY_MANDATORY_HIGH_RID)
{
printf("Low privilege error!!1!\n");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

relatively new to malware development, instead of cut access to the program, isn't it possible to escalate privilege through a child process ?

If the integrity_level < SECURITY_MANDATORY_HIGH_RID then
program attempt with a UAC Bypass to overload a existing kernel driver with a valid signature.
Then rexecute itself from the driver to escalate privileges?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants