A simple Python script that uses pdfcrack to brute-force the password of a PDF file. By default, it generates a wordlist of possible dates (in the format MMDDYYYY) that might serve as the PDF password.
Important: This tool should only be used on files you have permission to test. Misuse could lead to legal consequences. The author is not responsible for any misuse or damage caused by this tool.
- Automatically generates a date-based wordlist using Python’s exrex library (covering years 1930–2099 by default).
- Uses pdfcrack to attempt unlocking the PDF.
- Supports both Linux and Windows.
-
Python 3
Make sure you have Python 3 installed. -
pdfcrack
- Linux:
Install via your package manager. For example, on Debian/Ubuntu:sudo apt-get update sudo apt-get install pdfcrack
- Windows:
Thepdfcrack.exe
already present in windows folder.
- Linux:
-
Clone this repository:
git clone https://github.com/sangleshubham/Pan-Card-Password-Cracker.git
-
Navigate into the cloned repository:
cd Pan-Card-Password-Cracker
-
Install required Python libraries:
pip install -r requirements.txt
-
(Optional) Verify
pdfcrack
is installed by running on linux:pdfcrack --help
If it’s not installed or not recognized, install or place
pdfcrack.exe
in thewindows/
folder as needed.
Run the script:
python3 script.py <PDF_Filename.pdf>
Example:
python3 script.py secret_pan_card.pdf
- The script will generate a file named
wordlist
in the current directory. - It will then call
pdfcrack
with the generated wordlist to try to unlock the PDF. - Once the process finishes, it prints the total time taken for the cracking attempt.
-
Generate the Wordlist
The script uses a regular expression to generate all possible dates in the formatMMDDYYYY
(for example,02141995
). This is done usingexrex.generate()
with the pattern:((0[0-9])|(1[0-2]))((0[1-9])|(1[0-9])|(2[0-9])|(3[0-2]))((19[3-9][0-9])|(20[012][0-9]))
-
Crack the PDF
- On Linux, it calls
pdfcrack
directly. - On Windows, it calls
pdfcrack.exe
in thewindows/
directory.
- On Linux, it calls
-
Track Execution Time (~1 second)
It measures how long the cracking attempt takes and prints the total duration.
If you want to adjust the date range or pattern:
- Open the script in a text editor.
- Locate this line:
data = list(exrex.generate(r'((0[0-9])|(1[0-2]))((0[1-9])|(1[0-9])|(2[0-9])|(3[0-2]))((19[3-9][0-9])|(20[012][0-9]))'))
- Adjust the regex to meet your needs (e.g., to handle narrower or broader date ranges).
- Fork the repo.
- Create a new feature branch:
git checkout -b feature/YourFeature
- Commit your changes:
git commit -m "Add some feature"
- Push the branch:
git push origin feature/YourFeature
- Open a pull request describing the changes.
This project is licensed under the MIT License. You can freely modify and distribute it. See the LICENSE file for details.
Use this script only on PDFs you own or have explicit permission to test. The author is not responsible for any misuse or damages caused by this tool. Always comply with your local laws and regulations.