|
|
Introduction
As this is a document file, its mostly going to be Macro stuff.
And this is confirmed by trying to extract any macros, I used olevba3
which is part of oletools.
And like expected it had a really big one (most of it is data). Can be found in macro.out.
Information collecting
Alright, lets go.
The big data sections
There are two data blocks in F
. The first one is small and it seperated by "."
character:
|
|
The other one is so gigantic to be included here, check F.T.Text.txt it is 1142916
bytes.
rigmarole
function and fix encoded strings
From the Workbook_Open
and Auto_Open
functions, the main is in Sheet1.folderol
.
We can see the first big data block (which is named F.L
) is being used.
|
|
But in folderol
, the pattern rigmarole(onzo($index))
is used a lot.
rigmarole
looks like decoding function, so lets replace all the calls with the
results real quick before going into folderol
.
Using these strings we can fill them in the appropriate places, check macro_1_fixed.
folderol
function
In this function, there is a check for internet connection and then tries to checks if the machine is a VM. If it is it will run
|
|
Then after that
|
|
it will call canoodle
to decrypt F.T.Text
(the second big data block) with the key in xertz
. Then writes the content into "%APPDATA%\\Microsoft\\stomp.mp3"
. And calls play
on the file.
Let’s analyze canoodle
and find the content of the file that was written.
canoodle
function
This function is the function that is used to decrypts the big data block F.T.Text
.
The function definition can be rewritten to:
|
|
It will loop through encrypted_data
string but 4
characters at a time,
but only XOR the first 2 character with the key integer value.
Something like:
As you might have guessed, using this method not all the data in F.T.Text
is being used, and as expected the result of the following line (the content of the mp3
file):
|
|
Is not the flag and only sound of stomps :D
The real folderlo
function
In the results of olevba3
script there was a large chunk of what looked like
a somewhat compiled version of VBA
which is called P-Code
.
At first I just ignored it because it looked similar to the original code before it, so I thought it is a compiled version of it. But that was wrong, it is actually important.
Solution
Most of the real
folderlo
function is the same, These are the additional parts:
|
|
0x45C21
= 285729
(this is much bigger that the first one).
Now with this, becuase canoodle
’s second argument is 2
it makes sense that it
takes step of 4
on each loop.
And the key now is the reversed version of the string "FLARE-ON"
.
Decoding F.T.Text
string with the arguments above, we get this:
Flag:
|
|