Featured Analyzing Malicious OneNote Documents | Didier Stevens

Published on February 12th, 2023 📆 | 7747 Views ⚑

0

Analyzing Malicious OneNote Documents | Didier Stevens


https://www.ispeech.org/text.to.speech

About a week ago, I was asked if I had tools for OneNote files.

I donā€™t, and I had no time to take a closer look.

But last Thursday night, I had some time to take a look. I looked at this OneNote maldoc sample.

I opened the file in the binary editor I use often (010 Editor):

I expected to see some magic header, a special sequence of byte that would tell me which file type is used. I didnā€™t see that, but I noticed that the first 16 bytes look random. And they were the same for another sample. So this could be a GUID. GUIDs in Microsoftā€™s representation are a mix of little- and big-endian hexadecimal integers. Thatā€™s why 010 Editor has an entry for GUIDs in its inspector tab:

This is the GUID represented as a string: {7B5C52E4-D88C-4DA7-AEB1-5378D02996D3}

Looking this up with Google:

Thatā€™s great, Microsoft has a document [MS-ONESTORE] describing this file format.

Unfortunately, I did a quick search but didnā€™t find a pure Python module to read this file format. Maybe it exists, but I didnā€™t find it.

Next I tried my pecheck.py tool to locate the executable inside the onenote sample. That worked well:





At position 0x2aa4, hereā€™s an embedded PE file. Taking a look with the binary editor:

I see the MZ header, and 36 bytes in front of that, another random looking sequence of 16 bytes. Maybe another GUID:

{BDE316E7-2665-4511-A4C4-8D4D0B7A9EAC}

A bit of Google search:

Turns out that this is a FileDataStoreObject structure.

So looking for this GUID in any file, one can find (and extract) embedded files. So thatā€™s what I quickly coded using my Python template for binary files (there are some issues with this GUID-search method, Iā€™ll address these in an upcoming blog post or video)

A new tool: onedump.py



Source link

Tagged with: ā€¢ ā€¢ ā€¢ ā€¢ ā€¢



Comments are closed.