An advanced Python tool for cracking password-protected PDF files using brute force and dictionary attacks. Features multi-threading, progress tracking, and efficient password generation.
- Brute Force Attack: Generate passwords using character combinations
- Dictionary Attack: Use wordlist files for password attempts
- Multi-threading: Parallel processing for faster cracking
- Progress Tracking: Real-time progress bars with statistics
- Early Exit: Stops immediately when password is found
- Memory Efficient: Stream-based password generation
- Configurable Threading: Adjustable thread count for optimal performance
- Time Tracking: Shows attack duration and success rate
- Smart Warnings: Alerts for potentially long operations
- File Validation: Checks file existence before starting
- Error Handling: Comprehensive error handling and reporting
- Keyboard Interrupt: Graceful handling of user cancellation
- Input Validation: Validates all command-line parameters
- Python 3.7+
- Required libraries: pikepdf, tqdm
# Install required packages
pip install pikepdf tqdm
# Or on Kali Linux
sudo apt install python3-pikepdf python3-tqdm# Download the tool
git clone https://github.com/Sergios9494/pdf-cracker-tool.git
cd pdf-cracker-tool
# Make executable
chmod +x CrackerPDF_Attack.py# Use wordlist file
python3 CrackerPDF_Attack.py document.pdf --wordlist passwords.txt# Generate passwords on the fly
python3 CrackerPDF_Attack.py document.pdf --generate --min_length 1 --max_length 4# Use only numbers
python3 CrackerPDF_Attack.py document.pdf --generate --charset "0123456789" --max_length 6
# Use lowercase letters only
python3 CrackerPDF_Attack.py document.pdf --generate --charset "abcdefghijklmnopqrstuvwxyz" --max_length 5# Use more threads for faster cracking
python3 CrackerPDF_Attack.py document.pdf --wordlist passwords.txt --max_workers 8# Enable detailed output
python3 CrackerPDF_Attack.py document.pdf --generate --verbosepositional arguments:
pdf_file Path to the password-protected PDF file
options:
-h, --help show this help message and exit
--wordlist WORDLIST Path to the password list file
--generate Generate passwords using brute force
--min_length MIN_LENGTH
Minimum length of passwords to generate (default: 1)
--max_length MAX_LENGTH
Maximum length of passwords to generate (default: 4)
--charset CHARSET Characters to use for password generation
--max_workers MAX_WORKERS
Maximum number of parallel threads (default: 4)
--verbose, -v Enable verbose output
python3 CrackerPDF_Attack.py confidential.pdf --wordlist common_passwords.txtOutput:
[+] Target PDF: confidential.pdf
[+] Threads: 4
[+] Starting dictionary attack on confidential.pdf
[+] Using wordlist: common_passwords.txt
[+] Loaded 10000 passwords
Cracking PDF: 100%|██████████| 10000/10000 [00:45<00:00, 222.22passwords/s]
[+] SUCCESS! PDF decrypted with password: password123
[+] Time taken: 45.23 seconds
python3 CrackerPDF_Attack.py document.pdf --generate --min_length 1 --max_length 3 --charset "1234567890"python3 CrackerPDF_Attack.py secure.pdf --wordlist rockyou.txt --max_workers 16 --verbose- CPU-bound: Use number of CPU cores
- I/O-bound: Use 2-4x CPU cores
- Network: Use 4-8 threads
- Default: 4 threads (good balance)
- Numbers only:
0123456789(fastest) - Lowercase:
abcdefghijklmnopqrstuvwxyz(medium) - Full charset:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()(slowest)
- 1-3 characters: Very fast (seconds)
- 4-5 characters: Fast (minutes)
- 6+ characters: Slow (hours to days)
- Authorized penetration testing
- Security research on your own files
- Educational purposes
- Recovery of forgotten passwords on your own documents
- Always obtain proper authorization before testing
- Only use on files you own or have explicit permission to test
- Respect privacy and data protection laws
- The author is not responsible for misuse
- Use responsibly and ethically
- Respect others' privacy and property
- Follow applicable laws and regulations
- Report vulnerabilities responsibly
Module Not Found
pip install pikepdf tqdmPermission Denied
chmod +x CrackerPDF_Attack.pyFile Not Found
- Check file path and spelling
- Ensure PDF file exists
- Verify wordlist file exists (if using dictionary attack)
Out of Memory
- Reduce thread count:
--max_workers 2 - Use smaller character set
- Reduce password length range
Very Slow Performance
- Use dictionary attack instead of brute force
- Reduce character set size
- Lower maximum password length
- Increase thread count (if CPU allows)
For Fast Attacks:
# Use dictionary attack with many threads
python3 CrackerPDF_Attack.py file.pdf --wordlist passwords.txt --max_workers 8For Memory Efficiency:
# Use fewer threads and smaller charset
python3 CrackerPDF_Attack.py file.pdf --generate --charset "0123456789" --max_workers 2- pikepdf: Modern PDF library for Python
- tqdm: Progress bar library
- concurrent.futures: Threading support
- itertools: Password generation
- Class-based Design: Organized and maintainable code
- Stream Processing: Memory-efficient password generation
- Thread Pool: Efficient parallel processing
- Early Exit: Stops immediately on success
- PDF 1.4 and later
- Password-protected PDFs
- User password (not owner password)
Contributions are welcome! Please feel free to submit:
- Bug reports
- Feature requests
- Performance improvements
- Documentation updates
This project is licensed under the MIT License.
Sergios9494 - Cybersecurity Professional
- GitHub: @Sergios9494
- Built for cybersecurity professionals
- Designed for educational and authorized testing
- Inspired by security research needs
Use Responsibly! 🔒