Threat Level: green Handler on Duty: Xavier Mertens

SANS ISC: ZIP & AES SANS ISC InfoSec Forums

Watch ISC TV. Great for NOCs, SOCs and Living Rooms: https://isctv.sans.edu

Sign Up for Free!   Forgot Password?
Log In or Sign Up for Free!
ZIP & AES

A comment on my diary entry "MALWARE Bazaar" mentioned problems with the ZIP password of downloaded samples (MALWARE Bazaar is a free service were you can download malware samples).

When you download a sample from MALWARE Bazaar, it is stored in a password protected ZIP file. As mentioned on the download page, the password is infected.

But you can still have issues when extracting the sample, because AES is used as encryption method. Not all ZIP utilities support AES as encryption method, and so you'll have to use a utility that not only supports ZipCrypto, but also AES.

Python's module zipfile does not support AES, only ZipCrypto. So many of my analysis tools (oledump, pdf tools, ...) that can analyse samples inside a password protected ZIP file, will not work directly with MALWARE Bazaar samples.

But I found a solution, and implemented it first in my zipdump.py utility: there is an open-source drop-in replacement for the zipfile module, that supports AES encrytpion. This module is pyzipper.

When pyzipper is installed, my zipdump.py tool will use it in stead of zipfile, and thus provide AES encryption support. If it is not installed, it will use built-in module zipfile.

I will gradually update my other tools using zipfile, to include support for pyzipper.

 

 

Didier Stevens
Senior handler
Microsoft MVP
blog.DidierStevens.com DidierStevensLabs.com

DidierStevens

469 Posts
ISC Handler
May 3rd 2020
Hallo,

you are not a helpdesk, so just for information:

Some of the *.xlsx files are not zip-archives, but have the "magic"-bytes "D0 CF 11 E0 A1 B1 1A E1", i.e. they are old OLE-files, normaly *.xls. Your msoffice-password-crack.py reveals the password, but I couldn't look inside with zipdump.py nor oledump.py or a combination.

regards
Anonymous
You are probably dealing with an encrypted OOXML file.
Does it look like the documents I described in this blog post?
blog.didierstevens.com/2018/06/07/encrypted-ooxml-documents/
DidierStevens

469 Posts
ISC Handler
One example is: f7183d3a992ead2bf194ac46b1f6f70ad9e30bfd5b6065ffbd96a3529c311725.xlsx

There are 3-4 other comparable files.
The password is according to MSoffice-crack: "Valvet..."
Anonymous

Sign Up for Free or Log In to start participating in the conversation!