-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathstart.py
50 lines (34 loc) · 1.7 KB
/
start.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
print("""
╔═══╦═══╦═══╗╔═══╦═══╦═══╦═══╦╗╔═╦═══╦═══╗
║╔═╗╠╗╔╗║╔══╝║╔═╗║╔═╗║╔═╗║╔═╗║║║╔╣╔══╣╔═╗║
║╚═╝║║║║║╚══╗║║─╚╣╚═╝║║─║║║─╚╣╚╝╝║╚══╣╚═╝║
║╔══╝║║║║╔══╝║║─╔╣╔╗╔╣╚═╝║║─╔╣╔╗║║╔══╣╔╗╔╝
║║──╔╝╚╝║║───║╚═╝║║║╚╣╔═╗║╚═╝║║║╚╣╚══╣║║╚╗
╚╝──╚═══╩╝───╚═══╩╝╚═╩╝─╚╩═══╩╝╚═╩═══╩╝╚═╝
Author:Swagkarna
""")
import PyPDF2 as pd
filename = input('Enter the Path of Pdf File: ')
passlist = input('Enter the Path of Passlist file:')
file = open(filename, 'rb')
pdfReader = pd.PdfFileReader(file)
tried = 0
if not pdfReader.isEncrypted:
print('Your PDF file does not Contain a Password you can Easily open')
else:
wordListFile = open(passlist, 'r')
body = wordListFile.read().lower()
words = body.split()
for i in range(len(words)):
print("Attempts tried :",i)
word = words[i]
print('Cracking {}'.format(word))
result = pdfReader.decrypt(word)
if result == 1:
print('\n[-]Password Cracked Successfuly \n[-]The password is: ' + word)
break
elif result == 0:
tried += 1
print("Passwords cannot be cracked: + str(tried)")
continue
print("Happy Cracking")