Advertisement
LiamBogur

SystemExecute | Run batch files as SYSTEM

Dec 27th, 2019
476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.41 KB | None | 0 0
  1. @echo off
  2. title System executor.
  3. net session 2>nul >nul || call :elevate
  4. echo Do you want to continue? Press any key to continue.
  5. pause>nul
  6. set /p File="Batch File to execute: "
  7. copy "%File%" "C:\SYSTEMEXPLOITFILE.bat" 2>nul >nul
  8. echo @echo off>C:\SYSTEMEXPLOIT.bat
  9. echo reg add HKLM\SYSTEM\Setup /v OOBEInProgress /t REG_DWORD /d 0 /f>>C:\SYSTEMEXPLOIT.bat
  10. echo reg add HKLM\SYSTEM\Setup /v SetupPhase /t REG_DWORD /d 0 /f>>C:\SYSTEMEXPLOIT.bat
  11. echo reg add HKLM\SYSTEM\Setup /v SetupType /t REG_DWORD /d 0 /f>>C:\SYSTEMEXPLOIT.bat
  12. echo reg add HKLM\SYSTEM\Setup /v CmdLine /t REG_SZ /d "" /f>>C:\SYSTEMEXPLOIT.bat
  13. echo cmd /c C:\SYSTEMEXPLOITFILE.bat>>C:\SYSTEMEXPLOIT.bat
  14. echo del C:\SYSTEMEXPLOITFILE.bat>>C:\SYSTEMEXPLOIT.bat
  15. echo shutdown /r /t 1 >>C:\SYSTEMEXPLOIT.bat
  16. echo echo Changes complete, restarting now...>>C:\SYSTEMEXPLOIT.bat
  17. echo del C:\SYSTEMEXPLOIT.bat>>C:\SYSTEMEXPLOIT.bat
  18. reg add HKLM\SYSTEM\Setup /v OOBEInProgress /t REG_DWORD /d 1 /f>nul
  19. reg add HKLM\SYSTEM\Setup /v SetupPhase /t REG_DWORD /d 4 /f>nul
  20. reg add HKLM\SYSTEM\Setup /v SetupType /t REG_DWORD /d 2 /f>nul
  21. reg add HKLM\SYSTEM\Setup /v CmdLine /t REG_SZ /d "C:\Windows\System32\cmd.exe /k C:\SYSTEMEXPLOIT.bat" /f>nul
  22. echo Changes complete, press any key to restart.
  23. pause>nul
  24. shutdown /r /t 0
  25. exit
  26. :elevate
  27. echo Requesting Administrator privledges, please wait for UAC.
  28. powershell /c start-process -verb runAs \"%~s0\"
  29. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement