Is there a way to obfuscate parts of a batch file?
Posted: 09 Apr 2021 12:52
Hello,
I have a batch file that I need to obfuscate. Instead of just obfuscating all of it I just want to obfuscate parts of it. is that possible? The example file is called test.bat
test.bat
And this is the obfuscator that I use.
obfu.bat
engine.cmd
Both of these files need to be together to work. Using this obfuscator or something else, is this possible? in test.bat i want the second part obfuscated while the first part untouched.
Thanks Rasil
I have a batch file that I need to obfuscate. Instead of just obfuscating all of it I just want to obfuscate parts of it. is that possible? The example file is called test.bat
test.bat
Code: Select all
@echo off
echo this part isint hidden.
pause
goto axtb
:axtb
cls
echo this part is hidden.
pause
exit
obfu.bat
Code: Select all
set filename="sd"
set source="engine"
if exist temp.~b644 goto n
if not exist %filename%.bat exit
"%source%.cmd" "%filename%.bat"
:n
del %filename%.bat
::ping localhost -n 2 >nul
ren t.bat %filename%.bat
"%source%.cmd" "%filename%.bat"
Code: Select all
if "%~1"=="" exit /b
if /i "%~x1" neq ".bat" if /i "%~x1" neq ".cmd" exit /b
for /f %%i in ("certutil.exe") do if not exist "%%~$path:i" (
echo CertUtil.exe not found.
pause
exit /b
)
>"temp.~b64" echo(//4mY2xzDQo=
certutil.exe -f -decode "temp.~b64" "t.bat"
del "temp.~b64"
::ping localhost -n 1 >nul
copy "t.bat" /b + "%~1" /b
echo .>temp.~b644
::ping localhost -n 1 >nul
start obfu.bat
exit
Thanks Rasil