Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc.StartInfo.UseShellExecute = true;
- proc.StartInfo.Verb = "runas";
- Exec '"$WINDIRexplorer.exe" "$TEMPMyUnElevatedProcess.exe"'
- Exec '"$WINDIRexplorer.exe" "$TEMPMyUnElevatedProcess.exe"'
- class Program
- {
- static void Main(string[] args)
- {
- var psi = new ProcessStartInfo(@"c:windowssystem32whoami.exe");
- var password = new SecureString();
- password.AppendChar('s');
- password.AppendChar('e');
- password.AppendChar('c');
- password.AppendChar('r');
- password.AppendChar('e');
- password.AppendChar('t');
- psi.Password = password;
- psi.UserName = "username";
- psi.UseShellExecute = false;
- psi.RedirectStandardOutput = true;
- var p = new Process();
- p.StartInfo = psi;
- p.Start();
- p.WaitForExit();
- Console.WriteLine(p.StandardOutput.ReadToEnd());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement