Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Advanced PDF password cracking tool with brute force and dictionary attacks. Features multi-threading, progress tracking, and efficient password generation for cybersecurity professionals.

Notifications You must be signed in to change notification settings

Sergios9494/pdf-cracker-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

PDF Password Cracker Tool

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.

Features

🔓 Password Cracking Methods

  • 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

⚡ Performance Features

  • 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

🛡️ Security Features

  • 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

Installation

Prerequisites

  • Python 3.7+
  • Required libraries: pikepdf, tqdm

Dependencies

# Install required packages
pip install pikepdf tqdm

# Or on Kali Linux
sudo apt install python3-pikepdf python3-tqdm

Setup

# Download the tool
git clone https://github.com/Sergios9494/pdf-cracker-tool.git
cd pdf-cracker-tool

# Make executable
chmod +x CrackerPDF_Attack.py

Usage

Basic Usage

Dictionary Attack

# Use wordlist file
python3 CrackerPDF_Attack.py document.pdf --wordlist passwords.txt

Brute Force Attack

# Generate passwords on the fly
python3 CrackerPDF_Attack.py document.pdf --generate --min_length 1 --max_length 4

Advanced Usage

Custom Character Set

# 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

High-Performance Attack

# Use more threads for faster cracking
python3 CrackerPDF_Attack.py document.pdf --wordlist passwords.txt --max_workers 8

Verbose Output

# Enable detailed output
python3 CrackerPDF_Attack.py document.pdf --generate --verbose

Command Line Options

positional 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

Examples

Example 1: Dictionary Attack

python3 CrackerPDF_Attack.py confidential.pdf --wordlist common_passwords.txt

Output:

[+] 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

Example 2: Brute Force Attack

python3 CrackerPDF_Attack.py document.pdf --generate --min_length 1 --max_length 3 --charset "1234567890"

Example 3: High-Speed Attack

python3 CrackerPDF_Attack.py secure.pdf --wordlist rockyou.txt --max_workers 16 --verbose

Performance Tips

Thread Count Optimization

  • 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)

Character Set Optimization

  • Numbers only: 0123456789 (fastest)
  • Lowercase: abcdefghijklmnopqrstuvwxyz (medium)
  • Full charset: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*() (slowest)

Password Length Considerations

  • 1-3 characters: Very fast (seconds)
  • 4-5 characters: Fast (minutes)
  • 6+ characters: Slow (hours to days)

Security Considerations

⚠️ Important: This tool is designed for:

  • Authorized penetration testing
  • Security research on your own files
  • Educational purposes
  • Recovery of forgotten passwords on your own documents

Legal Notice

  • 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

Ethical Guidelines

  • Use responsibly and ethically
  • Respect others' privacy and property
  • Follow applicable laws and regulations
  • Report vulnerabilities responsibly

Troubleshooting

Common Issues

Module Not Found

pip install pikepdf tqdm

Permission Denied

chmod +x CrackerPDF_Attack.py

File 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)

Performance Optimization

For Fast Attacks:

# Use dictionary attack with many threads
python3 CrackerPDF_Attack.py file.pdf --wordlist passwords.txt --max_workers 8

For Memory Efficiency:

# Use fewer threads and smaller charset
python3 CrackerPDF_Attack.py file.pdf --generate --charset "0123456789" --max_workers 2

Technical Details

Dependencies

  • pikepdf: Modern PDF library for Python
  • tqdm: Progress bar library
  • concurrent.futures: Threading support
  • itertools: Password generation

Architecture

  • Class-based Design: Organized and maintainable code
  • Stream Processing: Memory-efficient password generation
  • Thread Pool: Efficient parallel processing
  • Early Exit: Stops immediately on success

Supported PDF Versions

  • PDF 1.4 and later
  • Password-protected PDFs
  • User password (not owner password)

Contributing

Contributions are welcome! Please feel free to submit:

  • Bug reports
  • Feature requests
  • Performance improvements
  • Documentation updates

License

This project is licensed under the MIT License.

Author

Sergios9494 - Cybersecurity Professional

Acknowledgments

  • Built for cybersecurity professionals
  • Designed for educational and authorized testing
  • Inspired by security research needs

Use Responsibly! 🔒

About

Advanced PDF password cracking tool with brute force and dictionary attacks. Features multi-threading, progress tracking, and efficient password generation for cybersecurity professionals.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages