Advertisement
Guest User

Untitled

a guest
Nov 18th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. proc.StartInfo.UseShellExecute = true;
  2. proc.StartInfo.Verb = "runas";
  3.  
  4. Exec '"$WINDIRexplorer.exe" "$TEMPMyUnElevatedProcess.exe"'
  5.  
  6. Exec '"$WINDIRexplorer.exe" "$TEMPMyUnElevatedProcess.exe"'
  7.  
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. var psi = new ProcessStartInfo(@"c:windowssystem32whoami.exe");
  13. var password = new SecureString();
  14. password.AppendChar('s');
  15. password.AppendChar('e');
  16. password.AppendChar('c');
  17. password.AppendChar('r');
  18. password.AppendChar('e');
  19. password.AppendChar('t');
  20. psi.Password = password;
  21. psi.UserName = "username";
  22. psi.UseShellExecute = false;
  23. psi.RedirectStandardOutput = true;
  24.  
  25. var p = new Process();
  26. p.StartInfo = psi;
  27. p.Start();
  28. p.WaitForExit();
  29.  
  30. Console.WriteLine(p.StandardOutput.ReadToEnd());
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement