pdfcrack
Table of Contents
Pdfcrack
Description
Pdfcrack is an open-source tool used in digital forensics and penetration testing to gain unauthorized access to password-protected PDF documents. It targets the authentication mechanisms built into the PDF standard.
How it Works
PDF files can be protected by two types of passwords:
- User Password: Restricts the ability to open and view the document content. This is the primary target of Pdfcrack.
- Owner Password: Restricts document permissions (e.g., printing, editing, copying text). Once the user password is known, the owner password is often trivial or unnecessary to crack.
Pdfcrack works by attempting to crack the hash of the password stored within the PDF metadata.
- Attack Methods: It supports brute-force attacks (trying every possible character combination) and dictionary attacks (testing passwords from a wordlist). It is generally optimized for speed on CPU cores.
- Decryption: Once a password candidate is found, Pdfcrack verifies it against the PDF's internal encryption data. If the attempt is successful, the password is recovered and displayed.
- Speed Limitations: Since PDF encryption is not hardware-accelerated like modern hashing algorithms (unlike Hashcat/GPU tools), cracking PDF passwords can be very time-consuming, especially for long or complex passwords.
Security Note
The security of a protected PDF depends heavily on the encryption version used during creation. Older versions (e.g., PDF 1.4/128-bit RC4) are significantly easier and faster to crack than modern versions (e.g., PDF 2.0/256-bit AES), making Pdfcrack most effective against legacy files.
Examples
Pdfcrack is a straightforward command-line tool, typically requiring only the input file and the desired attack type.
. Basic ictionary Attack
This is the most common and fastest method, using a pre-compiled wordlist (like rockyou.txt).
```bash pdfcrack -f secureddocument.pdf -w /usr/share/wordlists/rockyou.txt