A powerful and efficient tool for brute-force password cracking of compressed archives. Supports ZIP, RAR, and 7Z formats with both dictionary-based and brute-force attack modes.
English | 简体中文
- Multiple Archive Formats: Full support for RAR, ZIP, and 7Z archives
- Dual Attack Modes:
- Dictionary-based attacks using password lists
- Brute-force attacks with customizable character sets
- Multiprocessing Support: Bypass Python's GIL limitation by using true multiprocessing
- Built-in Dictionaries: Includes comprehensive password dictionaries from SecLists
- Flexible Configuration: Customize character sets, password length, and process count
- Progress Tracking: Real-time progress bars showing attack status
- Memory Efficient: Optimized to handle large password lists and brute-force ranges
Loads password dictionaries from text files and attempts each password sequentially. Supports multiprocessing to distribute password attempts across multiple CPU cores.
Generates all possible password combinations from specified character sets (uppercase, lowercase, digits, symbols) up to a maximum length. Processes incrementally from length 1 to max length.
Instead of using threading (limited by Python's GIL), this tool uses the multiprocessing module to create separate processes. Each process handles a chunk of passwords, enabling true parallel execution and maximum CPU utilization.
- Python 3.7+
- Required packages (see
requirements.txt) - For RAR support: UnRAR library
git clone https://github.com/Mustenaka/brute_force_unpackage.git
cd brute_force_unpackagepip install -r requirements.txt# Install using Homebrew
brew install libunrar
# Or compile from source
wget https://www.rarlab.com/rar/unrarsrc-6.2.12.tar.gz
tar -xzf unrarsrc-6.2.12.tar.gz
cd unrar
make lib
sudo make install-lib
# Set environment variable
export UNRAR_LIB_PATH="/usr/local/lib/libunrar.so"# Compile from source
wget https://www.rarlab.com/rar/unrarsrc-6.2.12.tar.gz
tar -xzf unrarsrc-6.2.12.tar.gz
cd unrar
make lib
sudo make install-lib
# Set environment variable (add to ~/.bashrc or ~/.zshrc)
export UNRAR_LIB_PATH="/usr/local/lib/libunrar.so"# Download UnRAR DLL from https://www.rarlab.com/rar_add.htm
# Extract UnRAR.dll to your system or project directory
# Set environment variable
set UNRAR_LIB_PATH=C:\path\to\UnRAR.dllpython main.py <archive_file> [options]file- Path to the encrypted archive file (RAR/ZIP/7Z)
-d, --dictionary- Enable dictionary-based attack mode-p, --dict-path PATH- Path to password dictionary directory (default: password_list)
-b, --brute- Enable brute-force attack mode-u, --uppercase- Include uppercase letters (A-Z) in brute-force-l, --lowercase- Include lowercase letters (a-z) in brute-force-n, --digits- Include digits (0-9) in brute-force-s, --symbols- Include special symbols in brute-force-m, --max-length N- Maximum password length for brute-force (default: 8, max: 16)
-t, --threads N- Number of parallel processes to use (default: CPU count)- Set to 1 to disable multiprocessing
- Leave empty to use all available CPU cores
# Use default password lists with single process
python main.py archive.zip -d -t 1# Use all CPU cores
python main.py archive.rar -d
# Use specific number of processes
python main.py archive.7z -d -t 4
# Use custom dictionary path
python main.py archive.zip -d -p /path/to/custom/dictionaries -t 8# Lowercase + digits, max length 6, multiprocessing
python main.py archive.zip -b -l -n -m 6
# Uppercase + lowercase + digits, max length 4, 8 processes
python main.py archive.rar -b -u -l -n -m 4 -t 8
# All character sets, max length 5
python main.py archive.7z -b -u -l -n -s -m 5# Try dictionary first, then brute-force if not found
python main.py archive.rar -d -b -l -n -m 5 -t 4For convenience, you can use the provided scripts:
# Batch file
run.bat
# PowerShell
./run.ps1chmod +x run.sh
./run.shbrute_force_unpackage/
├── main.py # Main entry point
├── requirements.txt # Python dependencies
├── README.md # This file
│
├── src/
│ ├── core/ # Core functionality
│ │ ├── base_attacker.py # Abstract base class for attacks
│ │ ├── archive_handlers.py # Archive format handlers (RAR/ZIP/7Z)
│ │ └── multiprocess_attacker.py # Multiprocessing implementation
│ │
│ ├── attackers/ # Attack implementations
│ │ ├── dictionary_attacker.py # Dictionary-based attack
│ │ └── bruteforce_attacker.py # Brute-force attack
│ │
│ ├── dic_unpack/ # Legacy dictionary module (deprecated)
│ └── rnd_unpack/ # Legacy random module (deprecated)
│
├── password_list/ # Built-in password dictionaries
│ ├── Common-Credentials/ # Common passwords
│ ├── Default-Credentials/ # Default device passwords
│ ├── Books/ # Book-based passwords
│ └── ... # More dictionaries
│
├── origin_file/ # Test files for verification
├── rarlib/ # UnRAR library binaries
└── scripts/
├── run.bat # Windows batch script
├── run.ps1 # Windows PowerShell script
└── run.sh # Linux/macOS shell script
- Strategy Pattern: Different archive formats (RAR, ZIP, 7Z) are handled by separate handler classes implementing a common interface
- Template Method: Base attacker class provides common attack logic, with specific implementations for dictionary and brute-force modes
- Factory Pattern: Archive handlers are created based on file extension
This tool uses multiprocessing instead of threading to overcome Python's Global Interpreter Lock (GIL):
- Threading: Limited by GIL, only one thread executes Python code at a time (pseudo-parallelism)
- Multiprocessing: Creates separate Python processes, each with its own interpreter and memory space (true parallelism)
Each worker process:
- Receives a chunk of passwords to test
- Independently attempts to extract the archive
- Reports back when password is found or chunk is exhausted
This approach maximizes CPU utilization and significantly reduces cracking time on multi-core systems.
This project includes password dictionaries from the SecLists project:
- Common passwords (top 100, 1000, 10000, etc.)
- Default device credentials
- Year-based passwords (1900-2020)
- Book titles and variations
- Leaked password databases
- Loading large dictionaries may take time and memory
- Multiprocessing is highly effective for dictionary attacks
- Recommended: Use 4-8 processes for optimal balance
- Complexity grows exponentially with password length
- Character set size impacts combinations:
- Lowercase only (26): 26^n combinations
- Lowercase + digits (36): 36^n combinations
- All sets (95): 95^n combinations
- Recommended maximum length: 8-10 characters
- Always use multiprocessing for brute-force attacks
- 4-char lowercase+digits: seconds to minutes
- 6-char lowercase+digits: minutes to hours
- 8-char lowercase+digits: days to weeks
- 8-char all sets: months to years
This tool is for educational and authorized security testing purposes only.
- Only use on archives you own or have explicit permission to test
- Unauthorized access to computer systems is illegal
- The authors assume no liability for misuse of this tool
- Always comply with local laws and regulations
Contributions are welcome! Please feel free to submit pull requests or open issues for:
- Bug fixes
- Performance improvements
- New features
- Documentation updates
This project is open source. Please check the license file for details.
Mustenaka
- GitHub: @Mustenaka
- Blog: https://www.mustenaka.cn
- ✨ Complete architecture refactoring with strategy pattern
- ✨ Implemented true multiprocessing support (bypasses GIL)
- ✨ Added comprehensive English documentation and comments
- ✨ Improved command-line argument naming and validation
- ✨ Progress tracking for multiprocessing mode
- ✨ Better error handling and user feedback
- 🐛 Fixed parameter naming (simbol→symbols, brust→brute)
- 🗑️ Deprecated legacy modules (kept for compatibility)
- Basic dictionary attack support
- Basic brute-force attack support
- RAR, ZIP, 7Z format support
- Single-threaded execution
If you encounter issues:
- Check that all dependencies are installed
- Verify UnRAR library is properly configured
- Ensure you have permission to access the archive file
- Open an issue on GitHub with detailed error information
⭐ If you find this tool useful, please consider giving it a star on GitHub!