Python Forum
Excel password recovery tool for work
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Excel password recovery tool for work
#1
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
Reply
#2
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?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
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
Reply
#4
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.
Reply
#5
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  OS module and file/directory recovery hikerguy62 1 2,176 Aug-02-2019, 06:42 AM
Last Post: Gribouillis
  Reading data from password protected excel Anirudh_Avantsa 2 22,299 Apr-04-2018, 03:26 PM
Last Post: nilamo
  Strings read from excel don't work? Tibas 0 2,415 Mar-06-2018, 10:37 PM
Last Post: Tibas
  simplify my excel work on python CodeAyoub 1 2,938 Oct-08-2017, 12:09 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020