Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7974567

Browse files
committed
added pdf cracker tutorial
1 parentb0da74f commit7974567

File tree

7 files changed

+5024
-0
lines changed

7 files changed

+5024
-0
lines changed

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ This is a repository of all the tutorials of [The Python Code](https://www.thepy
2626
-[How to Brute Force FTP Servers in Python](https://www.thepythoncode.com/article/brute-force-attack-ftp-servers-using-ftplib-in-python). ([code](ethical-hacking/ftp-cracker))
2727
-[How to Extract Image Metadata in Python](https://www.thepythoncode.com/article/extracting-image-metadata-in-python). ([code](ethical-hacking/image-metadata-extractor))
2828
-[How to Crack Zip File Passwords in Python](https://www.thepythoncode.com/article/crack-zip-file-password-in-python). ([code](ethical-hacking/zipfile-cracker))
29+
-[How to Crack PDF Files in Python](https://www.thepythoncode.com/article/crack-pdf-file-password-in-python). ([code](ethical-hacking/pdf-cracker))
2930

3031
-###[Machine Learning](https://www.thepythoncode.com/topic/machine-learning)
3132
-###[Natural Language Processing](https://www.thepythoncode.com/topic/nlp)

‎ethical-hacking/pdf-cracker/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[How to Crack PDF Files in Python](https://www.thepythoncode.com/article/crack-pdf-file-password-in-python)
2+
To run this:
3+
-`pip3 install -r requirements.txt`
4+
- Use any`wordlist.txt` you want, and run`pdf_cracker.py`
83.1 KB
Binary file not shown.

‎ethical-hacking/pdf-cracker/foo.pdf

82.2 KB
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
importpikepdf
2+
fromtqdmimporttqdm
3+
4+
# load password list
5+
passwords= [line.strip()forlineinopen("wordlist.txt") ]
6+
7+
# iterate over passwords
8+
forpasswordintqdm(passwords,"Decrypting PDF"):
9+
try:
10+
# open PDF file
11+
withpikepdf.open("foo-protected.pdf",password=password)aspdf:
12+
# Password decrypted successfully, break out of the loop
13+
print("[+] Password found:",password)
14+
break
15+
exceptpikepdf._qpdf.PasswordErrorase:
16+
# wrong password, just continue in the loop
17+
continue
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pikepdf
2+
tqdm

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp