Hack Forums
[Source] [Batch] Zip password cracker - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Source] [Batch] Zip password cracker (/showthread.php?tid=6295253)



[Batch] Zip password cracker - Robert Rouge - Mar 28, 2025

hello, this is simple way to bruteforce a zip file from a wordlist contained in a zip file.
this uses 7zip and batch to do the dirty

Code
@echo off
rem ******************************************************************
rem ****************CREATED BY ROUGE SOFTWARE*************************
rem ******************************************************************
rem Obfuscated with: https://hackforums.net/showthread.php?tid=6294928
set Rouge=echo && set Software=msg && set flamingW0rm=pause


setlocal enabledelayedexpansion

rem Set the path to the 7-Zip executable
set "zipPath=C:\Program Files\7-Zip\7z.exe"

rem Prompt for the ZIP file and password list
set /p zipFile=Enter the path to your ZIP file:
set /p passwordList=Enter the path to your password list:

rem Check if the ZIP file exists
if not exist "%zipFile%" (
    %Rouge% ZIP file not found!
    exit /b
)

rem Check if the password list exists
if not exist "%passwordList%" (
    %Rouge% Password list not found!
    exit /b
)

rem Loop through each password in the password list
for /f "delims=" %%p in (%passwordList%) do (
    %Rouge% Trying password: %%p
    "%zipPath%" x "%zipFile%" -p"%%p" -y >nul 2>&1
    if !errorlevel! equ 0 (
        set "pass=%%p"
        %Rouge% Password found: !pass!
        %flamingW0rm%
        exit /b
    )
)

%Rouge% Password not found in the list.
%flamingW0rm%



RE: [Batch] Zip password cracker - Robert Rouge - Mar 28, 2025

(Mar 28, 2025 09:46 AM)m0hx Wrote:  lol why not just get the hash and do it in hashcat or john. is much faster than dis.

you correct, you could use ripper for better results
but learning batch for .net calls and practice loops.

no loops:
Code
@echo off
setlocal enabledelayedexpansion

set "JOHN_PATH=C:\Path\To\JohnTheRipper"

set /p zipFile=Enter the path to your ZIP file:
set /p passwordList=Enter the path to your password list:

if not exist "%zipFile%" (
    echo ZIP file not found!
    exit /b
)

if not exist "%JOHN_PATH%\zip2john.exe" (
    echo John the Ripper not found!
    exit /b
)

"%JOHN_PATH%\zip2john.exe" "%zipFile%" > zip_hash.txt

if not exist "zip_hash.txt" (
    echo Failed to extract hash!
    exit /b
)

"%JOHN_PATH%\john.exe" --wordlist="%passwordList%" zip_hash.txt

echo Cracking process completed.
pause



RE: [Batch] Zip password cracker - DramaKing - Mar 28, 2025

This is a nice script for learning, if you indeed did write it yourself. It could help someone as long as the requirements and placeholder are clearly documented. None of this is .NET, btw.

Also, John sucks.


RE: [Batch] Zip password cracker - Robert Rouge - Mar 28, 2025

(Mar 28, 2025 11:26 AM)DramaKing Wrote:  This is a nice script for learning, if you indeed did write it yourself. It could help someone as long as the requirements and placeholder are clearly documented. None of this is .NET, btw.

Also, John sucks.

this is batch not .net


RE: [Batch] Zip password cracker - DramaKing - Mar 28, 2025

(Mar 28, 2025 11:56 AM)Robert Rouge Wrote:  this is batch not .net

Then what are you talking about?


RE: [Batch] Zip password cracker - digital2key - Mar 29, 2025

thanks for sharing this


RE: [Batch] Zip password cracker - SIM-5630113 - Mar 29, 2025

Lol. I can’t believe this could work anyways. There are pretty much easier ways


RE: [Batch] Zip password cracker - Anonynuk - Sep 24, 2026

Not too sure this would actually work tbh but thanks for the share.