Sign in
Log inSign up

Algoritmo em BAT para quebrar senha de arquivos .RAR

Max Roberto Machado Ribeiro's photo
Max Roberto Machado Ribeiro
·Apr 6, 2018

Esse é um algoritmo em bat(CMD) baseado em um que já existe, porém que quebra apenas senhas numéricas. A grande diferença é que esse algoritmo permite quebrar uma senha que contenha os seguintes caracrets:

0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,@,#
REM============================================================ 
@echo off
title Rar Password Cracker
mode con: cols=47 lines=18
copy "C:\Program Files\WinRAR\Unrar.exe"
setlocal enableextensions disabledelayedexpansion

set "alphanumerics=,',0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,!_!A,!_!B,!_!C,!_!D,!_!E,!_!F,!_!G,!_!H,!_!I,!_!J,!_!K,!_!L,!_!M,!_!N,!_!O,!_!P,!_!Q,!_!R,!_!S,!_!T,!_!U,!_!V,!_!W,!_!X,!_!Y,!_!Z,@,#"
setlocal enabledelayedexpansion
SET DEST=%TEMP%\%RANDOM%
MD %DEST%
:RAR
cls
echo ----------------------------------------------
echo                   Problem
echo ----------------------------------------------
echo.
SET/P "NAME=Digite o nome do_ arquivo  : "
IF "%NAME%"=="" goto NERROR
goto GPATH
:NERROR
echo ----------------------------------------------
echo                      Problem
echo ----------------------------------------------
echo Voce nao deve deixar em branco.
pause
goto RAR
:GPATH
SET/P "PATH=Digite o Caminho Completo : "
IF "%PATH%"=="" goto PERROR
goto NEXT
:PERROR
echo ----------------------------------------------
echo                      ERROR
echo ----------------------------------------------
echo Desculpe nao pode ficar em branco.
pause
goto RAR
:NEXT
IF EXIST "%PATH%\%NAME%" GOTO START
goto PATH
:PATH
cls
echo ----------------------------------------------
echo                     ERROR
echo ----------------------------------------------
echo Opppss O Arquivo nao Existe..
pause
goto RAR
set PASS=0
set "COUNT=0"
:START
for %%a in (!alphanumerics!) do (    
    for %%b in (!alphanumerics!) do (
        for %%c in (!alphanumerics!) do (
            for %%d in (!alphanumerics!) do (
                for %%e in (!alphanumerics!) do (
                    for %%f in (!alphanumerics!) do (
                        for %%g in (!alphanumerics!) do (
                            for %%h in (!alphanumerics!) do (
                                for %%i in (!alphanumerics!) do (
                                    for %%j in (!alphanumerics!) do (
                                        for %%k in (!alphanumerics!) do (
                                            for %%l in (!alphanumerics!) do (
                                                IF !COUNT! EQU 0 (
                                                set PSWD=%%l                
                                                )    
                                                IF !COUNT! EQU 1 (
                                                set PSWD=%%k%%l                
                                                )
                                                IF !COUNT! EQU 2 (
                                                set PSWD=%%j%%k%%l                
                                                )
                                                IF !COUNT! EQU 3 (
                                                set PSWD=%%i%%j%%k%%l                
                                                )
                                                IF !COUNT! EQU 4 (
                                                set PSWD=%%h%%i%%j%%k%%l                
                                                )
                                                IF !COUNT! EQU 5 (
                                                set PSWD=%%g%%h%%i%%j%%k%%l                
                                                )
                                                IF !COUNT! EQU 6 (
                                                set PSWD=%%f%%g%%h%%i%%j%%k%%l                
                                                )
                                                IF !COUNT! EQU 7 (
                                                set PSWD=%%e%%f%%g%%h%%i%%j%%k%%l                
                                                )
                                                IF !COUNT! EQU 8 (
                                                set PSWD=%%d%%e%%f%%g%%h%%i%%j%%k%%l                
                                                )
                                                IF !COUNT! EQU 9 (
                                                set PSWD=%%c%%d%%e%%f%%g%%h%%i%%j%%k%%l                
                                                )
                                                IF !COUNT! EQU 10 (
                                                set PSWD=%%b%%c%%d%%e%%f%%g%%h%%i%%j%%k%%l                
                                                )
                                                IF !COUNT! EQU 11 (
                                                set PSWD=%%a%%b%%c%%d%%e%%f%%g%%h%%i%%j%%k%%l                
                                                )
                                                cls
                                                echo ----------------------------------------------
                                                echo             TESTANDO CHAVES
                                                echo ----------------------------------------------
                                                echo "!PSWD!"    

                                                UNRAR E -INUL -P!PSWD! "!PATH!\!NAME!" "!DEST!"
                                                IF /I !ERRORLEVEL! EQU 0 (
                                                GOTO FINISH
                                                )
                                            )
                                            IF /I !COUNT! EQU 0 (
                                            set COUNT=!COUNT!+1
                                            )
                                        )
                                        IF /I !COUNT! EQU 1 (
                                        set COUNT=!COUNT!+1
                                        )
                                    )
                                    IF /I !COUNT! EQU 2 (
                                    set COUNT=!COUNT!+1
                                    )
                                )
                                IF /I !COUNT! EQU 3 (
                                set COUNT=!COUNT!+1
                                )
                            )
                            IF /I !COUNT! EQU 4 (
                            set COUNT=!COUNT!+1
                            )
                        )
                        IF /I !COUNT! EQU 5 (
                        set COUNT=!COUNT!+1
                        )
                    )
                    IF /I !COUNT! EQU 6 (
                    set COUNT=!COUNT!+1
                    )
                )
                IF /I !COUNT! EQU 7 (
                set COUNT=!COUNT!+1
                )
            )
            IF /I !COUNT! EQU 8 (
            set COUNT=!COUNT!+1
            )
        )    
        IF /I !COUNT! EQU 9 (
        set COUNT=!COUNT!+1
        )
    )    
    IF /I !COUNT! EQU 10 (
    set COUNT=!COUNT!+1
    )
)

GOTO START
:FINISH
RD %DEST% /Q /S
Del "Unrar.exe"
cls
echo ----------------------------------------------
echo                     CRACKED
echo ----------------------------------------------
echo.
echo SENHA ENCONTRADA!
echo FILE  = %NAME%
echo SENHA CREACKEADA = %PSWD%
pause>NUL
exit

OBS - Atualmente ele quebra senhas com até 12 dígitos, porém é possível aumentar esse número incluindo mais loops internos seguindo a lógica criada. Para adicionar mais caracteres é só coloca-los na variável alphanumerics

OBS2- Quanto maior os arquivos dentro do RAR, mais ele demora para passar para próxima senha

E é isso espero que gostem.

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct