Skip to content
Projects

About

ZipCracker is a powerful Zip password-cracking tool from the Hx0 team. It integrates multiple cracking modes, including dictionary attacks, mask attacks, short-known-plaintext CRC32 enumeration recovery, known-plaintext attacks, and nested ZIP extraction, and can automatically repair files with false encryption. With its high performance and versatility, ZipCracker has become a powerful tool in CTF competitions. (ZipCracker by the Hx0 team is a tool for cracking passwords on Zip files, great for CTF competitions.)

Developer Tools

How these counts are measured

Measured star growth

in 24h
0
in 7 days
+2
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README_EN.md

Original

ZipCracker v2.2.1 — User Guide

Update:2026.10.09 (v2.2.1)

中文

Stable release: v2.2.1 · Download the complete ZIP bundle · Changelog

ZipCracker is a comprehensive ZIP cracking and recovery tool developed by Team Hx0. It is a strong fit for common ZIP challenges in CTF, as well as authorized security testing and recovering your own encrypted backups. It combines pseudo-encryption detection and repair, dictionary attacks, mask attacks, short-plaintext CRC32 preimage search, known-plaintext attack (KPA), and nested ZIP recovery into one workflow, with fast loading of huge wordlists, multi-threaded scheduling, and automatic extraction after success so you can analyze and recover ZIPs efficiently.

New in v2.2.1: unattended recovery with --batch and the test07 CTF sample; faster CRC32 and known-plaintext password checks, including binary short contents; isolated CRC32 collision candidates; fixes for duplicate-entry password verification and worker-error hangs. Existing commands remain supported.

Use ZipCracker_en.py for English UI; ZipCracker.py is the Chinese UI. Both call the same core.

ZipCracker overview

Main capabilities at a glance:

  • Pseudo-encryption detection and repair
  • Standard dictionary attacks
  • Custom wordlist file or directory of wordlists
  • Mask attacks
  • Short-plaintext recovery via CRC32 enumeration (1–4 bytes; separate candidate analysis for 5–6 bytes)
  • Known-plaintext attack (-kpa)
  • Nested ZIP extraction (-r / --recursive)
  • Batch mode (--batch, automatic answers with CRC32/template computation budgets)
  • Auto-extract after a successful crack

If you are new here, these three sections are enough to get started:

  1. Quick start
  2. Common usage
  3. FAQ

Quick start

Typical first commands:

# 1. Pseudo-encryption check and repair
python3 ZipCracker_en.py test01.zip

# 2. Default dictionary attack
python3 ZipCracker_en.py test02.zip

# 3. Known-plaintext attack
python3 ZipCracker_en.py test05.zip -kpa test05_plain.txt

# 4. Nested ZIP extraction
python3 ZipCracker_en.py outer.zip -r

# 5. Huge wordlist (recommended)
ZIPCRACKER_SKIP_DICT_COUNT=1 python3 ZipCracker_en.py target.zip huge_dict.txt

# 6. Unattended nested recovery
python3 ZipCracker_en.py test07.zip -r --batch -o test07_out

Download and extract the complete bundle, then run these commands from its ZipCracker-v2.2.1 directory. Replace outer.zip, target.zip, and huge_dict.txt with your own paths. test01.zip through test07.zip are bundled examples; test06.zip is the nested one (see Nested ZIP extraction), and test07.zip is a CTF batch/CRC32 collision fixture.

Runtime environment

Item Notes
Python Minimum Python 3.7; Python 3.10+ recommended
OS Linux / macOS / Windows
Required Python standard library only
Optional pyzipper — AES ZIP support
Optional bkcrack — faster KPA recovery when applicable

If you see:

TypeError: 'type' object is not subscriptable

your Python is likely too old. Check:

python --version

Upgrade to Python 3.10+ when possible.

Optional dependencies

1. pyzipper

Used for AES ZIP entries.

Behavior:

  • If installed, AES support is enabled automatically.
  • If missing, the script may prompt to install; you can enter n to skip.
  • In Chinese UI mode, one-key install prefers the Tsinghua PyPI mirror and falls back to the official index.

Manual install (example):

python3 -m pip install pyzipper

If the archive uses AES, the script also reminds you that:

  1. AES verification and extraction are usually much slower than legacy ZipCrypto.
  2. If you skip installation, traditional ZipCrypto remains available. Genuine AES archives are kept and ineffective attempts stop; install pyzipper and run the command again.

2. bkcrack

Mainly used for dictionary-free recovery during -kpa known-plaintext attacks.

Behavior:

  • If bkcrack is detected, a faster path is tried first.
  • If not found, the script suggests how to install it for your OS; n skips and other methods continue.
  • If you pass --bkcrack, bkcrack is required; the program exits if it is not available.

On Windows, if runtime libraries are missing, the program prints:

Common usage

1. Pseudo-encryption detection and repair

python3 ZipCracker_en.py test01.zip
267ab0f0-2340-4ed2-a3d5-11a0305753d4

2. Default dictionary attack

python3 ZipCracker_en.py test02.zip

By default it tries, in order:

  1. password_list.txt
  2. Numeric passwords from 1 to 6 digits

The current working directory's password_list.txt takes priority. If it is absent, the bundled dictionary next to the script is used, including when launching from another directory. An explicitly supplied wordlist file or directory uses the path you provide.

c0169c6d-83a8-45cc-94e4-6aa849dc3f62

If you run:

python3 ZipCracker_en.py your.zip

and the usual paths fail, the tool also looks inside the archive for entries that look like template KPA candidates (e.g. png, zip, exe, pcapng). When confidence is high enough, it may ask whether to switch to template KPA mode automatically.

Example:

python3 ZipCracker_en.py test06_image.zip
5eeb70f3-0dfa-4bdd-a1ac-6ce4232a4c52

3. Custom wordlists

Single file:

python3 ZipCracker_en.py test02.zip YourDict.txt
c98b517a-badf-4be7-8f63-cb4d92fedae9

Directory of wordlists (tried in sequence):

python3 ZipCracker_en.py test02.zip YourDictDirectory
bd70f862-71d0-41ae-b6cc-7614c4bac594

4. Short-plaintext CRC32 enumeration

For legacy encrypted entries 1–4 bytes long, the tool directly solves the stored CRC32 for the original contents. With correct length and CRC32 metadata, this length range has a unique preimage. Interactive mode asks first; --batch consents automatically. A cached CRC32 inverse linear transform needs at most 32 elimination steps per entry and supports arbitrary binary bytes, including 00 and FF. All entries in one archive share a default budget of 1 million candidate/solve attempts and 5 seconds; each short-entry solve consumes one attempt. Reaching either limit continues the recovery pipeline. Clear short entries are read directly; AES entries skip CRC32 recovery. Explicit dictionaries and masks are tried first, with CRC32 recovery attempted after failure.

5–6 byte matches can collide and are skipped by default. Enable --crc-candidates for candidate analysis. Candidates are written separately to <output_directory>_crc_candidates; they never count as success, overwrite normal extraction output, or permit source-archive cleanup. Inner candidate directories sit beside the corresponding nested_NNNN_name directory. Password verification continues, and unresolved recovery returns status 1. Candidate bytes also consume the recursive extraction budget.

Candidate analysis enumerates only a 1–2 byte printable prefix, directly solves the remaining four bytes and checks that the entire candidate is printable. This needs at most 100/10000 prefixes for five/six bytes, with one budget attempt per prefix. These faster matches remain unverified candidates.

python3 ZipCracker_en.py test03.zip

# Explicit 5–6 byte candidate analysis, with a larger budget
python3 ZipCracker_en.py target.zip --batch --crc-candidates --crc-max-candidates 10000000 --crc-timeout 10
fdf63111-adc6-4b5a-9f26-18e053c590c3

5. Mask attack

python3 ZipCracker_en.py test04.zip -m '?uali?s?d?d?d'

Mask placeholders:

Placeholder Meaning
?d Digits 0-9
?l Lowercase a-z
?u Uppercase A-Z
?s Special characters
?? Literal ?
a1eb3022-9ddd-4ed7-a0fa-aa1c5cd17efa

6. Known-plaintext attack (-kpa)

Tries bkcrack first when available, then falls back to dictionary/mask flows:

python3 ZipCracker_en.py test05.zip -kpa test05_plain.txt
9ec86c17-73db-4f24-8eff-14a5cd66ff23

If you have an unencrypted reference ZIP instead of a loose file:

python3 ZipCracker_en.py C.zip -kpa M.zip
image

Notes:

  1. After -kpa you can pass either a normal file or a passwordless ZIP.
  2. If you pass a ZIP, the tool prefers an entry with the same name as in the target.
  3. If you pass a plain file, it still prefers same-name matching inside the target ZIP.
  4. If the plaintext ZIP contains only one normal file, that file is used automatically.

Important:

  • In ZIP known-plaintext attacks, “plaintext” means the byte stream before ZipCrypto encryption, not necessarily the original extracted file.
  • If the target entry is ZIP_STORED, the original file can usually be used directly as -kpa input.
  • If the target entry is ZIP_DEFLATED / ZIP_BZIP2 / ZIP_LZMA, the encrypted bytes are usually the compressed data stream. Passing the uncompressed original file may lead to ciphertext is smaller than plaintext.
  • --kpa-offset only describes where known bytes start inside the pre-encryption byte stream; it cannot map an uncompressed file to compressed data.
  • See the bilingual note in docs/KPA_KNOWN_PLAINTEXT_NOTE.md.

Force a specific entry inside the target ZIP:

python3 ZipCracker_en.py test05.zip -kpa test05_plain.txt -c test05_plain.txt

Partial plaintext — offset and extra known bytes:

python3 ZipCracker_en.py secret.zip -kpa part.bin --kpa-offset 78 -x 0 4d5a

Notes:

  1. --kpa-offset — start offset of this plaintext inside the target file.
  2. -x — extra known bytes: -x <offset> <hex> (repeatable).
  3. Shorthand: -x 0:4d5a.

Built-in file-header templates:

python3 ZipCracker_en.py target.zip --kpa-template png -c image.png
python3 ZipCracker_en.py target.zip --kpa-template exe -c app.exe
python3 ZipCracker_en.py target.zip --kpa-template pcapng -c capture.pcapng
python3 ZipCracker_en.py target.zip --kpa-template zip -c inside.zip

Available templates: png, zip, exe, pcapng.

bkcrack only:

python3 ZipCracker_en.py test05.zip -kpa test05_plain.txt --bkcrack

Difference:

  • -kpa — if bkcrack fails, other methods can still run.
  • -kpa --bkcrack — only bkcrack; stop if it fails.

7. Output directory

python3 ZipCracker_en.py test02.zip -o output_dir

The default is unzipped_files. All extraction modes stage and verify the complete contents before publishing results to the specified output paths. Unrelated existing files are kept. Colliding old files are first saved to a sibling outputname_backup_random directory. If the input ZIP is inside the output directory, extraction uses an isolated archivename_extracted subdirectory to protect it. Traversal paths and symlink members are rejected.

8. Nested ZIP extraction

python3 ZipCracker_en.py outer.zip -r
python3 ZipCracker_en.py outer.zip my_dict.txt -r --max-total-size 8GiB --max-archives 10000

Only ZIPs produced by the current extraction are processed. Unencrypted layers are extracted directly; encrypted layers reuse the dictionary or mask settings. Each nested archive gets a separate, flat nested_NNNN_name directory so long chains do not accumulate long paths. The original input is always kept. Intermediate archives are removed only after complete, verified extraction; failed or limited archives are kept and listed.

The bundled test06.zip is a five-layer nested sample whose layers take four different paths — the built-in dictionary (outer archive and layer 2), pseudo-encryption repair (layer 1), the automatic 1-6 digit numeric dictionary (layer 3) and plain extraction (layer 4) — so it can be used to verify the whole recursive flow:

python3 ZipCracker_en.py test06.zip -r
image
Option Behavior
-r, --recursive Enable nested extraction
--max-depth N Maximum inner depth; default 2048, outer archive is depth 0
--max-archives N Maximum archive count including the outer archive; default 4096
--max-total-size SIZE Cumulative extracted bytes; default 1GiB; accepts bytes, KiB, MiB, GiB
--keep-nested-zips Keep successfully extracted intermediate archives

Size accounting includes intermediate ZIPs and bytes written by failed attempts. Deleting intermediate ZIPs does not restore the budget. These limits apply to recursive mode only. Inner layers never read keyboard input; --batch enables bounded CRC32 recovery there. Without an explicit dictionary or mask, inner layers also try built-in templates after standard recovery fails. User-supplied KPA plaintext/entry/template settings apply only to the outer archive. Exit status is 0 for complete success and 1 if any inner archive remains unresolved or a limit is reached.

See Output directory for output and backup behavior.

9. Batch mode (--batch)

python3 ZipCracker_en.py target.zip --batch
python3 ZipCracker_en.py outer.zip my_dict.txt -r --batch
Operation Batch behavior
1–4 byte CRC32 recovery Consent automatically, sharing candidate/time budgets per archive
5–6 byte CRC32 candidates Skip by default; explicitly enable with --crc-candidates; save separately, never count as success
Built-in template KPA Try after default recovery fails; also applies to inner layers without explicit dictionaries/masks
pyzipper / bkcrack installation Skip by default; explicit installation environment variables still take precedence
Masks exceeding 100 billion candidates Refuse and return failure

Budget values must be positive; 0, nan, and inf are rejected:

Option Default and scope
--crc-max-candidates N 1000000 candidate/solve attempts shared by all CRC32 entries in each archive
--crc-timeout SEC 5 seconds shared by each archive's CRC32 computation; checked every 1024 steps, excluding time waiting for confirmation
--template-timeout SEC 60 seconds shared by automatic template key searches per archive in batch mode

CRC32 budgets also apply to interactive recovery and explicit candidate analysis. A template key-search timeout terminates that search and keeps the source archive. Explicit -kpa / --kpa-template attacks do not use the automatic-template budget. Dependency probes, extraction, dictionaries/masks and later password recovery have their own flows; these options are not a deadline for the entire run. Recursive depth, archive-count and extraction-byte limits still apply.

The project's test07.zip is a typical combined CTF sample with 6 ZIP archives including the outer archive and a maximum inner depth of 3. Recovery uses a weak-password dictionary for the outer layer, repairs a pseudo-encrypted wrapper, then handles three branches: short flag shards, a CRC32 collision trap and a plain ZIP. Use it to validate batch mode and nested recovery:

python3 ZipCracker_en.py test07.zip -r --batch -o test07_out
image

The normal run requires no keyboard input, returns exit status 0 and saves its results to test07_out:

  1. Recover the 8 shards in 01_crc_shards.zip, each 3–4 bytes long, through CRC32. Concatenating them in filename order produces flag{batch_crc32_safe_recovery}.
  2. Skip ambiguous CRC32 enumeration for the 5-byte entry in 02_crc_collision.zip by default. Actual decryption with dictionary password 123456 recovers the original aRQ\,.
  3. Extract the plain branch directly, remove the 5 successfully processed intermediate ZIPs by default and keep the original test07.zip.

The provided test07_dict.txt also validates explicit dictionary recovery followed by CRC32 fallback. It contains only the outer and collision-branch passwords, so the short shard branch still needs CRC32 recovery:

python3 ZipCracker_en.py test07.zip test07_dict.txt -r --batch -o test07_dict_out
image

The collision trap's original aRQ\, and candidate 00000 have the same length and CRC32 but different contents. Finding a candidate alone never counts as successful recovery or permits removal of its source archive. See the test07 sample guide for flag concatenation, the intentional collision failure test and budget validation.

This feature builds on @halfcity789's PR #23, adding collision-candidate isolation and computation budgets.

Non-interactive execution and exit status

Without --batch, scripts, CI and redirected input skip CRC32 prompts and manual installation while available recovery methods continue. --crc-candidates explicitly enables bounded candidate analysis. With --batch, automatic answers follow the table above; installation environment variables can override the defaults. Masks exceeding 100 billion candidates require normal interactive confirmation and are refused in batch/non-interactive mode.

  • 0: the requested operation succeeded; in recursive mode all discovered inner archives were handled
  • 1: failure, including unresolved/corrupt inner archives or archives skipped because of resource limits
  • 130: interrupted by the user

Version and tests

Current version: 2.2.1. See CHANGELOG.md. Existing commands, both language entry points, and optional dependency installation remain supported.

python3 -m unittest discover -s tests -v

Tests generate temporary fixtures. Integration tests for pyzipper, Info-ZIP zip, and bkcrack run when those optional tools are installed and are skipped otherwise.

Huge wordlists

ZipCracker can handle very large wordlists without loading the entire file into memory.

For 10GB+ lists, skip the pre-count pass:

ZIPCRACKER_SKIP_DICT_COUNT=1 python3 ZipCracker_en.py your.zip your_big_dict.txt

Windows PowerShell syntax (applies to the current PowerShell session):

$env:ZIPCRACKER_SKIP_DICT_COUNT = "1"
python ZipCracker_en.py your.zip your_big_dict.txt
7ee7fc4c-df6f-4b6f-8d0d-cf09079f016e

Benefits:

  1. Faster startup
  2. Lower, steadier memory use
  3. Progress switches to streaming mode (by bytes read)

FAQ

1. Why is AES so slow?

That is normal. AES password checks and decryption are usually much slower than ZipCrypto. The script warns you when AES is detected.

2. What if pyzipper is not installed?

For AES entries, without pyzipper:

  1. The script may prompt you to install (or skip with n).
  2. If genuine AES encryption is detected, the archive is kept, a failure status is returned, and ineffective dictionary scans stop. Install the dependency and retry.

Safest approach: install first.

python3 -m pip install pyzipper

3. Windows: CERTIFICATE_VERIFY_FAILED when installing bkcrack

This is usually Python HTTPS certificate verification, not “GitHub is blocked” alone.

The script tries, in order: Python’s downloader, then curl.exe on Windows, then PowerShell.

If it still fails, check:

  1. System clock accuracy
  2. Proxies, gateways, or AV intercepting HTTPS
  3. Whether a browser can open the GitHub release page

4. Windows: bkcrack exit code 3221225477

Hex:

0xC0000005

This is an Access Violation — bkcrack.exe crashed. It is usually not “wrong password”. Try:

set BKCRACK_JOBS=1
python ZipCracker_en.py test05.zip -kpa test05_plain.txt

Also try:

  1. Install or repair Microsoft Visual C++ Redistributable
  2. Temporarily disable AV or allowlist bkcrack.exe
  3. If it still crashes, prefer WSL / Linux for bkcrack

5. Fan still spinning after extraction succeeded?

The script may still be trying to recover the original ZIP password after a successful extract.

To skip that:

ZIPCRACKER_SKIP_ORIG_PW_RECOVERY=1 python3 ZipCracker_en.py test05.zip -kpa test05_plain.txt

6. Huge wordlist looks idle at first?

By default the script counts total candidates first. For faster startup:

ZIPCRACKER_SKIP_DICT_COUNT=1 python3 ZipCracker_en.py your.zip your_big_dict.txt
cf3c32c6-19c8-4aab-bfb1-de0db357e654

Common environment variables

Variable Effect
ZIPCRACKER_SKIP_DICT_COUNT=1 Skip pre-count for huge wordlists
ZIPCRACKER_SKIP_ORIG_PW_RECOVERY=1 After KPA extract, do not keep recovering the original ZIP password
ZIPCRACKER_AUTO_INSTALL_PYZIPPER=0 Skip automatic pyzipper install prompts
ZIPCRACKER_AUTO_INSTALL_BKCRACK=0 Skip automatic bkcrack install prompts
BKCRACK_JOBS=1 Lower bkcrack thread count (useful on Windows)

Special Acknowledgments

Thanks to LANDY for support and feedback on this project.

ClawHub AI skill integration (New!)

ZipCracker is listed on the ClawHub skill hub. In OpenClaw you can invoke it with natural language so the assistant builds and runs decrypt/crack flows — handy for CTF and authorized self-checks.

Skill page: https://clawhub.ai/asaotomo/zipcracker

Install: Set up the ClawHub client, then run:

clawhub install zipcracker

Then you can say things like: “Crack this ZIP with ZipCracker, try a mask of four digits,” and the assistant will construct the right command.

Disclaimer

Use this tool only where you have legal permission, for example:

  • CTF / practice ranges
  • Recovering your own data
  • Authorized security testing

Do not use it for unauthorized access or other illegal purposes.


Support with tips — The code is open source; every bit of help keeps the project going.

Tip QR

Team official account — Follow for updates.

Team WeChat

Team knowledge planet

Knowledge planet

Explore related projects

Loading…