Advertisement
sofaygo

[BAT] Batch Script Obfuscator/Deobfuscator

Sep 14th, 2024 (edited)
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.89 KB | Cybersecurity | 0 0
  1. Note: Do not use the code with malicious intent. This post IS for EDUCATIONAL PURPOSES ONLY.
  2.  
  3. (I mean if you run a batch file or anything of any sorts with an obfuscated code, ur js dumb asf)
  4.  
  5. Obfuscate Code:
  6. @echo off
  7. REM Obfuscates the code when the file is dragged to the script
  8. if "%~1"=="" exit /b
  9. if /i "%~x1" neq ".bat" if /i "%~x1" neq ".cmd" exit /b
  10. for /f %%i in ("certutil.exe") do if not exist "%%~$path:i" (
  11.   echo CertUtil.exe not found.
  12.   pause
  13.   exit /b
  14. )
  15. >"temp.~b64" echo(//4mY2xzDQo=
  16. certutil.exe -f -decode "temp.~b64" "%~n1___%~x1"
  17. del "temp.~b64"
  18. copy "%~n1___%~x1" /b + "%~1" /b
  19.  
  20. Deobfuscate Code:
  21. @echo off
  22. REM Deobfuscates the file that is obfuscated.
  23. setlocal
  24. if "%~1"=="" exit /b
  25. if /i "%~x1" neq ".bat" if /i "%~x1" neq ".cmd" exit /b
  26. <"%~1" ((for /l %%N in (1 1 8) do pause)>nul&findstr "^">"%~n1__%~x1")
  27.  
  28. ©️ 1997 WhoAsked, Inc. All rights reserved.
Tags: batch
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement