Advertisement
sofaygo

Script Obfuscator/Deobfuscator (Batch File)

Apr 13th, 2024 (edited)
925
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.84 KB | None | 0 0
  1. [[-]] Batch Obfuscator Code [[-]]
  2.  
  3. Batch Obfuscator/Deobfuscator:
  4.  
  5. Just drag the batch script you want to obfuscate to the obfuscate.bat
  6.  
  7. To deobfuscate the file, drag the obfuscated batch script to it.
  8.  
  9. [[-]] Code [[-]]
  10.  
  11. Obfuscate:
  12. @echo off
  13. REM Code to obfuscate the file
  14. if "%~1"=="" exit /b
  15. if /i "%~x1" neq ".bat" if /i "%~x1" neq ".cmd" exit /b
  16. for /f %%i in ("certutil.exe") do if not exist "%%~$path:i" (
  17.   echo CertUtil.exe not found.
  18.   pause
  19.   exit /b
  20. )
  21. >"temp.~b64" echo(//4mY2xzDQo=
  22. certutil.exe -f -decode "temp.~b64" "%~n1___%~x1"
  23. del "temp.~b64"
  24. copy "%~n1___%~x1" /b + "%~1" /b
  25.  
  26. Deobfuscator:
  27. @echo off
  28. REM Deobfuscates the file that is obfuscated.
  29. setlocal
  30. if "%~1"=="" exit /b
  31. if /i "%~x1" neq ".bat" if /i "%~x1" neq ".cmd" exit /b
  32. <"%~1" ((for /l %%N in (1 1 8) do pause)>nul&findstr "^">"%~n1__%~x1")
  33.  
  34. Enjoy.
  35.  
Tags: batch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement