-
-
Save Ivlyth/ea528306c5ff325c12f2 to your computer and use it in GitHub Desktop.
Cracking a password protected excel doc with python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import win32com.client | |
openedDoc = win32com.client.Dispatch("Excel.Application") | |
filename= sys.argv[1] | |
password_file = open ( 'wordlist.lst', 'r' ) | |
passwords = password_file.readlines() | |
password_file.close() | |
passwords = [item.rstrip('\n') for item in passwords] | |
results = open('results.txt', 'w') | |
for password in passwords: | |
print(password) | |
try: | |
wb = openedDoc.Workbooks.Open(filename, False, True, None, password) | |
print("Success! Password is: "+password) | |
results.write(password) | |
results.close() | |
except: | |
print("Incorrect password") | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment