Skip to content

About

Pure-Rust encrypted archive toolkit: triage, strip pseudo-encryption, run known-plaintext attacks, and emit optimal hashes for ZIP, RAR, and 7-Zip

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ArchiveWolf

Triage encrypted archives. Strip pseudo-encryption. Run known-plaintext attacks. Emit optimal hashes. One static binary.

CI crates.io License: Apache 2.0

Installation • Quick start • Subcommands • Formats • Specifications


ArchiveWolf handles the full encrypted archive pipeline in a single binary: detect archives by magic bytes across directory trees, triage every entry with empirical CRC32 verification, strip pseudo-encryption, recover tiny files from CRC alone, run Biham-Kocher known-plaintext attacks on ZipCrypto, crack RAR 1.3 inline, and emit the optimal hash for external cracking -- all across ZIP, RAR, and 7-Zip. Pure Rust, #![forbid(unsafe_code)], statically linked under musl. Replaces zip2john, rar2john, 7z2john.pl, zip2hashcat, 7z2hashcat, and the hashcat *2john utilities.

From archive to cracked in three commands

$ archivewolf info encrypted.zip
  Entry                    Uncomp    Comp   Encrypted   Verdict
  ──────────────────────────────────────────────────────────────
  report.pdf               89,012  34,567   yes         Encrypted (WinZip AES-256)
  data.csv                  1,024     512   yes         Encrypted (ZipCrypto)
  fake-locked.txt           2,048   1,024   yes         Unencrypted (pseudo-encrypted)
  tiny.txt                      3       3   yes         CRC32 RECOVERED: "abc"

  Hashes:
  $zip$1$*0*2*...*$/zip$
  $zip$2$*3*...*$/zip$

$ hashcat -m 13600 hash.txt wordlist.txt
...
$zip$2$*3*...*$/zip$:secretpassword

$ archivewolf unlock --password secretpassword encrypted.zip -o output/
  PASSWORD: secretpassword -> report.pdf
  PASSWORD: secretpassword -> data.csv
  EXTRACTED: 2 WinZip AES files to output/
  STRIPPED: fake-locked.txt (pseudo-encrypted)

The archive had mixed encryption (WinZip AES + ZipCrypto), a pseudo-encrypted entry, and a 3-byte file. ArchiveWolf stripped the fake encryption, recovered the tiny file from its CRC32 alone, and emitted the optimal hash for each real encryption family -- no manual entry selection, no silent failures.

Installation

# Prebuilt static binary (Linux x86_64, zero dependencies):
curl -LO https://github.com/StrongWind1/ArchiveWolf/releases/latest/download/archivewolf-linux-x86_64
chmod +x archivewolf-linux-x86_64

# Or from crates.io:
cargo install archivewolf

# Or from source:
git clone https://github.com/StrongWind1/ArchiveWolf && cd ArchiveWolf && make release

Requires Rust 1.95+. No system dependencies -- pure Rust, #![forbid(unsafe_code)].

All artifacts and verification

Download from the Releases page. Each release ships with a SHA256SUMS checksum file.

File Target Notes
archivewolf-linux-x86_64 musl, static Zero-dependency binary, runs on any Linux kernel
archivewolf-linux-arm64 musl, static ARM64 Linux
archivewolf-macos-universal macOS (Apple Silicon + Intel) Universal binary
archivewolf-windows-x86_64.exe MSVC Windows x86_64
archivewolf-windows-arm64.exe MSVC Windows ARM64
sha256sum -c SHA256SUMS --ignore-missing

What it does

  • Detects archives by magic bytes -- walks directory trees with rayon, identifies ZIP, RAR, and 7-Zip by structural signatures, not file extension. Finds archives inside PE/ELF executables (SFX).
  • Triages every entry empirically -- CRC32-verifies each entry regardless of metadata. Catches pseudo-encryption, corrupt headers, and misclassified entries that fool other tools.
  • Runs a 5-step recovery ladder before emitting hashes -- exhausts every non-cracking path first:
    1. DEFAULT -- tests 8 common passwords against fast verifiers
    2. CRC32 recovery -- recovers 1-4 byte ZipCrypto entries instantly from CRC alone
    3. BYPASS -- detects and strips pseudo-encryption
    4. COLLIDE -- Biham-Kocher known-plaintext attack on ZipCrypto (12+ bytes, automatic plaintext from 18 file signature sources)
    5. CRACK -- emits the optimal hash for external cracking
  • Scores entries for optimal hashing -- picks the single fastest, lowest-collision candidate per encryption family. Never emits an uncrackable hash. By default, one hash per encryption method -- the cheapest one for hashcat to crack. Pass --all-hashes to emit a hash for every encrypted entry (useful for forensic verification, mixed-encryption archives, or hashcat plugin testing).
  • Recovers RAR 1.3 keys inline -- exhaustive search of the 2^23 password-reachable keys, each checked by decrypting and unpacking the entry. Prints the key and writes a decrypted archive that plain unrar x extracts. Under a second for stored entries; seconds to minutes for compressed ones, growing with entry size.
  • Decrypts with recovered keys -- Biham-Kocher recovers ZipCrypto internal keys, then decrypts all entries directly without knowing the password.
  • Emits key-to-password hashes -- after BK key recovery, emits $zip$4$ hashes so hashcat can recover the actual password (needed to unlock WinZip AES and SES entries sharing the same password).
  • Zero dependencies -- pure Rust, no C, no system libraries. Static musl binary runs on any Linux.

Supported formats

9 encryption methods, 4 archive formats, 27+ configurations:

Format Method Hash prefix hashcat -m Notes
ZIP ZipCrypto (traditional) $zip$1$ 17200 Broken by BK in seconds with 12+ bytes of known plaintext
ZIP WinZip AES-128/192/256 $zip$2$ 13600 PBKDF2-HMAC-SHA1, 1000 iterations
ZIP PKWARE SES (12 algorithms) $zip$3$ 23001-23003 SHA1-only KDF, ~600x faster than WinZip AES
ZIP Key-to-password recovery $zip$4$ 20500/20510 After BK recovers internal keys
RAR RAR 1.3 additive stream (24-bit key) -- -- Key recovered inline, decrypted archive written
RAR RAR 1.5 CRC32 stream $rar$15$ 46500 New format (no existing hashcat mode)
RAR RAR 2.0 Feistel $rar$20$ 46600 New format (no existing hashcat mode)
RAR RAR 3.x AES-128-CBC $rar$30$ 46700 SHA1 KDF, 262,144 rounds. Supersedes 12500/23700/23800
RAR RAR 5.x/7 AES-256-CBC $rar$50$ 46800 PBKDF2-HMAC-SHA256. Supersedes 13000
7-Zip AES-256-CBC $7z$ 11600 Custom iterated SHA-256 (NOT PBKDF2)

The $rar$NN$ formats are ArchiveWolf's own. Modes 46500-46800 are plugins in the feat/archive-modes branch of the hashcat fork (plan: specs/HASHCAT-PLUGIN-PLAN.md); upstream hashcat does not accept these hashes. Every hash ArchiveWolf emits carries the whole encrypted entry, so the plugins confirm a password by decrypting, unpacking when the entry is compressed, and comparing the checksum. Two kinds of entry get no usable hash: one over 4 MiB packed (no hash is emitted), and a compressed solid member that depends on earlier files (emitted with a warning, cannot be verified alone).

Password verification (unlock -p) is in-process for RAR 1.3, RAR 1.5, RAR 5.x, header-encrypted RAR 3.x and stored RAR 2.0/3.x entries. Compressed RAR 2.0 and RAR 3.x entries need unrar on PATH; without it the password is reported as not checked rather than wrong.

ArchiveWolf's 4 ZIP hash formats replace 11 existing hashcat modes. Full field-by-field specifications in specs/.

Quick start

# Identify archives and emit hashes:
archivewolf info encrypted.zip

# Scan a directory recursively:
archivewolf info /path/to/files/

# Run the full recovery ladder:
archivewolf unlock encrypted.zip

# Test a specific password:
archivewolf unlock --password "secret" encrypted.zip

# Hashes only, for piping to hashcat:
archivewolf info --format hashcat encrypted.zip

# Emit a hash for every encrypted entry (not just the best):
archivewolf --all-hashes info --format hashcat encrypted.rar

# JSON output:
archivewolf info --format json encrypted.zip

# Strip pseudo-encryption:
archivewolf advanced strip fake-encrypted.zip -o cleaned.zip

# Decrypt with recovered ZipCrypto keys:
archivewolf advanced decrypt archive.zip --key0 12345678 --key1 23456789 --key2 34567890 -o output/

Subcommands

Group Subcommand Purpose
Triage info Identify archives, print encryption info and hashes. --format {plain,json,hashcat}
Recovery unlock Run the full 5-step recovery ladder. --password, --potfile, -o for extraction
Advanced advanced extract Extract unencrypted entries from mixed archives
Advanced advanced strip Remove pseudo-encryption flags, write cleaned archive
Advanced advanced decrypt Decrypt with recovered ZipCrypto keys (key0/key1/key2)

Global flags: -v/-vv/-vvv, --quiet, --all-hashes.

Comparison with existing tools

Feature ArchiveWolf zip2john / rar2john / 7z2john.pl
Entry scoring Smallest + stored + CRC check byte; multi-file verification First entry or all entries
Archive detection Magic-byte + structural validation, parallel with rayon Extension-based
SFX support Scans PE/ELF at non-zero offsets Manual extraction
Pseudo-encryption CRC32-verified detection and stripping Silent wrong hash or crash
CRC32 recovery 1-4 byte files recovered instantly Not attempted
Known-plaintext attack Built-in Biham-Kocher with 18 automatic plaintext sources Requires separate bkcrack
RAR legacy Detects and cracks RAR 1.3/1.5/2.0 inline Ignores or crashes
RAR5 PswCheck Prefers entries with 64-bit fast-rejection check No selection logic
7z coder chains Encodes full chain (19 coder IDs) in hash Partial support
Output Plain text, JSON (NDJSON), hashcat (raw hashes) Unstructured text
Binary Single static Rust binary Perl + C + Python, platform-specific

What ArchiveWolf does not do

  • Does not create or modify archives (read-only tool).
  • Does not crack passwords itself (emits hashes for hashcat). Exception: RAR 1.3, where it searches the key space, not passwords.
  • Does not decrypt certificate-based ZIP encryption (detected and reported).
  • Does not handle ACE archives (proprietary compression, no public spec -- detection only).

Platform support

Platform Supported
Linux x86_64 (musl static) yes
Linux arm64 (musl static) yes
macOS (Apple Silicon + Intel) yes
Windows x86_64 / arm64 yes
Development

Conventional commit messages (feat:, fix:, docs:). 502 tests across unit and integration suites. Differential testing against hashcat self-test vectors and compiled zip2john/zip2hashcat/7z2hashcat reference binaries.

make hooks        # install the repo pre-commit hook
make dev          # debug build, fast iteration
make check-all    # full gate: fmt, lint (clippy pedantic), audit, check, test, doc, hygiene

Quality gate includes: rustfmt, clippy (pedantic), cargo-deny, cargo-machete, editorconfig, yamllint, actionlint, taplo, markdownlint.

Credits

  • bkcrack by kimci86 -- the Biham-Kocher reference implementation (C++), from which the attack algorithm was ported.
  • bkcrack-rs by zachshallbetter -- cleanest Rust BK API design, informed the library-first attack module.
  • zip-forensic-core by SecurityRonin -- the only public Rust PKWARE SES implementation, validated DeriveKey and CBC IV chaining.
  • zip-password-finder by agourlay -- PBKDF2 single-block optimization for WinZip AES password verification.
  • minizip-ng -- WinZip AES counter-starts-at-1 and data layout verification.
  • 7-Zip by Igor Pavlov -- 7z format specification and SES DeriveKey reference.
  • UnRAR by Alexander Roshal -- RAR format specification, all 6 encryption methods.
  • John the Ripper -- zip2john, rar2john, 7z2john.pl as differential testing baselines.
  • hashcat -- self-test vectors for modes 13600, 13000, 11600, 23001-23003.
  • Eli Biham and Paul C. Kocher -- "A Known Plaintext Attack on the PKZIP Stream Cipher" (1994).

Related tools

  • IKEWolf -- IKE/IPsec security scanner with Aggressive Mode PSK hash extraction
  • NFSWolf -- NFS security scanner, export escape, and credential escalation
  • CredWolf -- Active Directory credential validation over NTLM and Kerberos
  • KerbWolf -- Kerberos roasting and hash extraction toolkit
  • NTDSWolf -- offline NTDS.dit parser and credential extractor
  • PassWolf -- AD password change, reset, and policy read over SAMR, Netlogon, LSA, Kerberos, and LDAP
  • AD-SecretGen -- derive AD password hashes and Kerberos keys from a cleartext password

Disclaimer

ArchiveWolf is a penetration-testing and security-research tool. Operating it against systems or data without explicit written authorization is illegal in most jurisdictions. You alone are responsible for how you use it.

If you believe you have found a security issue in ArchiveWolf itself, please open a private security advisory on the GitHub repository rather than a public issue.

License

Apache License 2.0

The RAR ciphers, key derivations, header dispatch and the RAR 1.5 decompressor follow the UnRAR source by Alexander Roshal: src/crypto/unpack15.rs, rar15_cipher.rs, rar20_cipher.rs, rar3_kdf.rs, rar5_kdf.rs, src/pipeline/rar13_crack.rs, src/formats/rar/encryption.rs and headers.rs. Those parts are under the UnRAR license, LICENSE-UNRAR.txt, whose second paragraph reads:

UnRAR source code may be used in any software to handle
RAR archives without limitations free of charge, but cannot be
used to develop RAR (WinRAR) compatible archiver and to
re-create RAR compression algorithm, which is proprietary.
Distribution of modified UnRAR source code in separate form
or as a part of other software is permitted, provided that
full text of this paragraph, starting from "UnRAR source code"
words, is included in license, or in documentation if license
is not available, and in source code comments of resulting package.

About

Pure-Rust encrypted archive toolkit: triage, strip pseudo-encryption, run known-plaintext attacks, and emit optimal hashes for ZIP, RAR, and 7-Zip

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages