I created a Batch script to crack a TC volume given a text list of known passwords delimited by a newline. Unfortunately it’s not working correctly. When it goes down each line, it doesn’t read spaces. If I have an entry “HelloWorld” it will read “Helloworld”, but if the entry is “Hello World”, then it will only read “Hello”. Code:
@echo off
echo "--- Starting ---"
set drive=V
set tcexe="C:\Program Files\TrueCrypt\TrueCrypt.exe"
set tcvol="C:\Users\Ryan\Desktop\rawr.tar.gz"
:Start
for /f %%i in (passlist.txt) do call :Crack %%i
:Crack
set pass=%1
echo Trying %pass%...
%tcexe% /q /l %drive% /v %tcvol% /p %pass% /s /e /b
if exist %drive%: goto :End
goto :eof
:End
echo "TC volume cracked!"
echo The password is %pass%
pause
Can someone fix this problem for me? Thanks.
Use
and
for /fdoes tokenizing on the input and by default separates tokens with whitespace. And if you pass those to subroutines you need to quote the argument.Another option is to not quote in the
forline but inset pass="%*". Either way, you need quotes.