A couple of months ago we observed an influx of XML spam attachments that were actually Office documents containing malicious macros. Last week, the same gang behind this campaign introduced another unusual trick.
The spam campaign's theme is the usual fake invoices.
Here are some examples of the various subject lines associated with this campaign that we've spotted:
- Important information
- Financial Information
- Need your attention,"Important notice
- Payment details and copy of purchase [<Random AlphaNumeric>]
Last week, we observed an Italian version:
As you can see in the screenshot, the attachment file may use a .doc or .xls file extension. But what's interesting is the file is actually an MHTML file.
It seems that, after crafting the malicious macro document in MS Office, the criminals opted to save it as .MHTML instead of the usual .DOC/DOCX/XLS/XLSX type. After saving it, they renamed the file extension back to .doc or .xls. By doing this, opening the file will run the program associated with the file extension by default (in this case Microsoft Office).
Below is how the .mhtml file looks like when viewed from a text editor. Highlighted in red is a base64 encoded ActiveMime part where the malicious Office Document file is hidden. When we first identified this this campaign, most antivirus products did not detect the malicious macros. I suspect the criminal purposefully saved it as .mhtml to evade antivirus detection.
To further understand the malicious document file, I've extracted the malicious OLE from the encoded ActiveMime document using a Python script I wrote. The script is crude but it works! You can get it here.
Next, I dumped the VBS macro code from the OLE file to analyze it. The go-to tool I use to extract macro code is OleDump written by Didier Stevens. I modified the tool to automatically find the offending macro and dump it using –m switch. Here you see the extracted macro and a URL string pointing to pastebin.com:
The macro obfuscation varies every day. A sample we collected last week shows that strings like the download link have been obfuscated.
While the macro obfuscation varies from campaign to campaign, it essentially has the same behavior. The macro pulls a Visual Basic script (VBS) from pastebin.com then saves the script in the infected machine's temporary folder as a .vbs file then runs it. The script pulls another malicious executable from a URL: http://18.104.22.168/bt/get3[.]php
The downloaded executable payload is a banking Trojan called Dridex. It connects to the following IP addresses to download additional bot-configuration instructions:
- 22.214.171.124:5443 - Estonia
- 126.96.36.199:5443 - Russia
- 188.8.131.52:5443 - Russia
The bot is designed to steal banking credentials by hooking browsers like Internet Explorer, Chrome, Firefox and Opera. It is also worth noting that the criminal has code-signed their Dridex executables to evade malware filters.
It's interesting that the gang behind these campaigns has utilized several types of Microsoft Office file formats to circumvent either antivirus detection or spam filters. Infection, though, is dependent on the victim allowing the macro to run. Always ensure you disable macros in your Microsoft Office applications.