Python Forum
Excel password recovery tool for work - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Excel password recovery tool for work (/thread-28853.html)



Excel password recovery tool for work - OTH - Aug-06-2020

Hi,

I am new to this forum and have only posted one other post but i am working on a few codes at once, I am still not sure whether I am completing these new forum thread correctly.

Below I have been working on a Excel password recovery tool for work as we have had a few occasions where project managers have password protected excels and then forgot the password and they have lost weeks of work because of this. I am trying to be proactive and help as I am the one who pulls the date for them and it is a pain having to run queries over and over.

The code below works but only seems to work on small wordlists, bigger wordlist like rockyou.txt it falls over and just accepts for first password.

I am not getting any errors it just shows:

[+] Password Found: 123456789 ------ which is the first password in the list.


from pip._vendor.distlib.compat import raw_input
from win32com.client import Dispatch

file = raw_input('[+] Excel to attack: ')
wordlist = raw_input('[+] Wordlist: ')

word = open(wordlist, 'r', encoding='utf8', errors='ignore')
passlist = word.readlines()
word.close()

for password in passlist:
    password = password.strip()
    print ("[-] Password attempt: "+password)
    instance = Dispatch('Excel.Application') 

    try:
        instance.Workbooks.Open(file, False, True, None, password)
        print ("[+] Password Found: "+password)
        break

    except:
        pass



RE: Excel password recovery tool for work - buran - Aug-06-2020

remove the all-catching try/except and see what actual error you get.
when handle errors with try/except be as concrete as possible.

also if it says Password found - doesn't it mean it was successful to open the workbook?


RE: Excel password recovery tool for work - OTH - Aug-06-2020

Hi Buran,

Thank you for your reply.

I have done what you said and I don't receive any errors? it has just printed the smaller wordlist that i used.

I know the password I am trying to uncover as it is my test excel and the password should be Nibble5 not 123456789.

[+] Excel to attack: target.csv
[+] Wordlist: 1.txt
[-] Password attempt: nibler5
[-] Password attempt: nibbler5
[-] Password attempt: jlhju
[-] Password attempt: bler5dddd
[-] Password attempt: kjh
[-] Password attempt: jh
[-] Password attempt: j
[-] Password attempt: bler5
[-] Password attempt: josu
[-] Password attempt: geat
[-] Password attempt: lump
[-] Password attempt: jump
[-] Password attempt: cows
[-] Password attempt: hope
[-] Password attempt: have
[-] Password attempt: goat
[-] Password attempt: cheese
[-] Password attempt: hg
[-] Password attempt: Nibble5


RE: Excel password recovery tool for work - ThreeYao - Mar-08-2021

How about HashtCat?It used to work on my brother’s computer, but it wasn’t for me,i’m not sure whether it’s its fault or I did something wrong,but it’s undeniable that it’s really powerful.


RE: Excel password recovery tool for work - OTH - Mar-08-2021

(Mar-08-2021, 08:51 AM)ThreeYao Wrote: How about HashtCat?It used to work on my brother’s computer, but it wasn’t for me,i’m not sure whether it’s its fault or I did something wrong,but it’s undeniable that it’s really powerful.

Thanks for your message, Yeah I use Hashcat quite a bit, if you downloaded the new version of hashcat it won't work with cracking the Microsoft programs, the version I found that worked was version 5.1.0.


RE: Excel password recovery tool for work - Rarymdom - Mar-06-2025

If you're dealing with structured data, you can quickly filter and sort it as needed. For more complex data processing, Excel TV has some great discussions on working with large datasets efficiently. Also, watch out for dtype mismatches when merging DataFrames; they can cause issues that are hard to spot at first.


RE: Excel password recovery tool for work - Pedroski55 - Mar-06-2025

Back in the day, there were things called pencils. You could write with them.

Now, if these forgetful managers had pencils, they could jot down their passwords on a little slip of paper, put it in their wallets behind the photo of the gf, wife, kids, whatever. This simple mnemonic actually worked once upon a time. The thought of losing weeks of work could actually spur the managers on to learn how to write!

Nowadays, we have too many passwords. So I mainly remember just one password: the password to my encrypted password file.