Skip to content
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

Do not allow audit mode if running as high integrity (returns almost only false positives) #11

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions SharpUp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1023,32 +1023,30 @@ public static void PrivescChecks(bool auditMode)
{
bool isHighIntegrity = IsHighIntegrity();
bool isLocalAdmin = IsLocalAdmin();
bool shouldQuit = false;

if (isHighIntegrity)
{
Console.WriteLine("\r\n[*] Already in high integrity, no need to privesc!");
shouldQuit = true;
if (auditMode)
{
Console.WriteLine("\r\n[X] Cannot run audit mode within an high integrity process.");
}
Console.WriteLine("\r\n[*] To run all checks anyway (audit mode), re-run as medium integrity, and with the \"audit\" argument.");
return;
}
else if (!isHighIntegrity && isLocalAdmin)
{
Console.WriteLine("\r\n[*] In medium integrity but user is a local administrator- UAC can be bypassed.");
shouldQuit = true;
}

// if already admin we can quit without running all checks
if (shouldQuit)
{
if (!auditMode)
if(!auditMode)
{
Console.WriteLine("\r\n[*] Quitting now, re-run with \"audit\" argument to run all checks anyway (audit mode).");
Console.WriteLine("\r\n[*] To run all checks anyway (audit mode), re-run with the \"audit\" argument.");
return;
}
else
{
// except if auditMode has explictly been asked
Console.WriteLine("\r\n[*] Audit mode: running all checks anyway.");
}
}

if (auditMode)
{
Console.WriteLine("\r\n[*] Audit mode: running all checks anyway.");
}

GetModifiableServices();
Expand Down