Skip to content

Commit 532199e

Browse files
committed
bugfix in checking UAC limitation on Unlock logon types
1 parent bde1eb6 commit 532199e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

RunasCs.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ public string RunAs(string username, string password, string cmd, string domainN
605605
}
606606
else
607607
{
608-
if (logonType == LOGON32_LOGON_INTERACTIVE || logonType == 11 /*CachedInteractive*/)
608+
if (logonType == LOGON32_LOGON_INTERACTIVE || logonType == 7 /*Unlock*/ || logonType == 11 /*CachedInteractive*/)
609609
{ // only these logon types are filtered by UAC
610610
Console.Out.WriteLine(String.Format("[*] Warning: Token retrieved for user '{0}' is limited by UAC. Use the flag -b to try a UAC bypass or use the NetworkCleartext (8) in --logon-type.", username));
611611
}
@@ -1906,12 +1906,12 @@ static void Main(string[] args)
19061906
argsTest[0] = "temp2";
19071907
argsTest[1] = "pwd";
19081908
argsTest[2] = "C:\\Windows\\system32\\whoami /all";
1909-
//argsTest[2] = "cmd /c C:\\Windows\\system32\\ping.exe -n 120 127.0.0.1";
1909+
//argsTest[2] = "C:\\Windows\\system32\\ping.exe -n 120 127.0.0.1";
19101910
//argsTest[2] = "cmd.exe /c echo i was here && ping.exe -n 30 127.0.0.1 > C:\\Windows\\mediumil.txt";
19111911
argsTest[3] = "--function";
19121912
argsTest[4] = "0";
19131913
argsTest[5] = "--logon-type";
1914-
argsTest[6] = "4";
1914+
argsTest[6] = "7";
19151915
//argsTest[7] = "--remote-impersonation";
19161916
//argsTest[7] = "--create-profile";
19171917
//argsTest[7] = "--bypass-uac";

0 commit comments

Comments
 (0)