FlyFar

A Simple Vaccine For Your Computer To Prevent NotPetya

Oct 23rd, 2021 (edited)
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.06 KB | None | 0 0
  1. @echo off
  2. REM NotPetya Vaccine in Batch
  3. echo Administrative permissions required. Detecting permissions...
  4. echo.
  5.  
  6. net session >nul 2>&1
  7.  
  8. if %errorLevel% == 0 (
  9.     if exist C:\Windows\perfc (
  10.         echo Computer already vaccinated for NotPetya/Petya/Petna/SortaPetya.
  11.         echo.
  12.     ) else (
  13.         echo This is a NotPetya/Petya/Petna/SortaPetya Vaccination file. Do not remove as it protects you from being encrypted by Petya. > C:\Windows\perfc
  14.                 echo This is a NotPetya/Petya/Petna/SortaPetya Vaccination file. Do not remove as it protects you from being encrypted by Petya. > C:\Windows\perfc.dll
  15.                 echo This is a NotPetya/Petya/Petna/SortaPetya Vaccination file. Do not remove as it protects you from being encrypted by Petya. > C:\Windows\perfc.dat
  16.  
  17.         attrib +R C:\Windows\perfc
  18.                 attrib +R C:\Windows\perfc.dll
  19.                 attrib +R C:\Windows\perfc.dat
  20.  
  21.         echo Computer vaccinated for current version of NotPetya/Petya/Petna/SortaPetya.
  22.         echo.
  23.     )
  24. ) else (
  25.     echo Failure: You must run this batch file as Administrator.
  26. )
  27.  
  28. pause
Add Comment
Please, Sign In to add comment