Today we analyze a malicious, VBA Enabled Word Document. The authors of this document have password protected the VBA Project within the file to prevent inspection of the malicious code. They have also taken measures to prevent password removal techniques. Automatic analysis tools do not work, but we show how to get past all these anti-analysis obstacles.
Filename
efax543254456_2156.doc
MD5
30B9491821923A1ECB5D221A028208F2
Sample
Video
DETAILS
We begin by opening the document and are greeted with a Phishing message claiming the document was created with an earlier version of Microsoft Office and in order to view the message we must enable macros.When we enable macros, the Document begins beaconing to cfai66.fr
To continue analysis, we can try to manually remove the password using some common hex editing techniques for Office files. To begin, we search the Document for the string “DPB” and change it to “DPx”. Some versions of Office will interpret this as a corrupt password hash. However, this does not work on our document and we still receive the password prompt.
Next we try replacing the “CMG”, “DPB”, and “GC” values of our document with new values from a password protected, VBA Enabled Document we create. Alas, the authors of our document have intentionally messed with the “CMG” value to throw off the length of the field. Our attempts at copying our new CMG to the malicious document fail. Also, attempting to pad the data both inside and outside the quotes of CMG to preserve the length of the file failed. (Our New Document On Left. Malicious Document on Right)
Since our password removal attempts have failed, we continue inspecting our Document with the popular Office Product analysis tool OfficeMalScanner. Running the tool with the scan/brute options yields no results:
Re-running the tool with the info option reveals 3 VBA Objects:
However, more bad news emerges when ViperMonkey fails to fully analyze the VBA due to 1.) Not recognizing the VBA function UBound, 2.) Being unable to evaluate the variable assignment for “i = UserForm1.T.Top” because it cannot locate the value for UserForm1.T.Top.
Variable fr will equal T - 11 and then on line 60 variable Wet will equal 1 - fr.
Line 62 states that if Wet = 0 then rd will be the character representation of variable rd.
If we take these statements in reverse logical order we get the following:
For rd to be a Char, Wet must equal 0:
Wet = 0
Wet = 1 - fr(1) = 0
fr = T(12) - 11 = 1
T(12) = i(12) = UserForm1.T.Top(12)
UserForm1.T.Top == 12
DROPPED FILES
i.batnpzdi.exe
NETWORK TRAFFIC
cfai66.fr/parabola.pngcfa-noisylegrand.com/parapola.png