Thursday 11 January 2018

Is there a way to crack the password on an Excel VBA Project?

Colin Pickard has an excellent answer, but there is one
'watch out' with this. There are instances (I haven't figured out the cause yet) where
the total length of the "CMG=........GC=...." entry in the file is different from one
excel file to the next. In some cases, this entry will be 137 bytes, and in others it
will be 143 bytes. The 137 byte length is the odd one, and if this happens when you
create your file with the '1234' password, just create another file, and it should jump
to the 143 byte length.


If you try to paste the wrong
number of bytes into the file, you will lose your VBA project when you try to open the
file with
Excel.


EDIT


This
is not valid for Excel 2007/2010 files. The standard .xlsx file format is actually a
.zip file containing numerous sub-folders with the formatting, layout, content, etc,
stored as xml data. For an unprotected Excel 2007 file, you can just change the .xlsx
extension to .zip, then open the zip file and look through all the xml data. It's very
straightforward.


However, when you password protect an
Excel 2007 file, the entire .zip (.xlsx) file is actually encrypted using RSA
encryption. It is no longer possible to change the extension to .zip and browse the file
contents.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...