Macros are basically small scripts written in the Visual Basic for Applications (VBA) programming language. They allow repetitive actions within Office documents, and every user can record their actions, generate a macro, and run it every time they need to complete that sequence and save time. In short, macros are small programs that run within bigger programs to automate time-consuming tasks on a user’s behalf to boost productivity. Unfortunately they also allow bad actors to embed dangerous payloads, such as ransomware, rootkits, spyware, and so on.
Cybercriminals use macros to infect any computer that opens and runs the malicious macro. For example, malicious macros can leverage the VBA SHELL command to execute arbitrary code and the VBA KILL command to delete files from the HDD. VBA works within majority of Microsoft Office programs, including Excel, Outlook, PowerPoint, Access, Word, Project, cloud-based Office 365, and more. The problem comes when malicious macros also use "AutoExec" to automatically start with an office application or "AutoOpen" to autorun the macro when the document is open.
How does this happen?
While recent versions of Microsoft Office have macros disabled by default, cybercriminals are using social engineering to convince users to turn on macros to allow their malware to run. Typically, macro malware is transmitted through phishing emails containing malicious attachments.
Take Locky as an example. This was spread via email attachments containing Word documents that would have some scrambled text and a big headline saying you should enable macros to view the text properly. By doing this, cybercriminals were attempting to social engineer you into enabling macros because the data appeared incorrectly encoded. Even when macros were enabled, the text would remain the same, but in the background a small piece of code would save a file on your hard drive and execute it. The file saved is "Troj/Ransom-CGX", a downloader that delivers the final payload, which in this case is Locky. The ransomware payload is not embedded in the document, but it is later downloaded.
The downloader connects to the internet and the final payload hits your computer, and Locky starts to scramble all your files that match a list of extensions, such as videos, images, documents or source code. If you are the lucky owner of a Bitcoin wallet, it encrypts that one too.
Another action that Locky takes after infecting your computer is to remove your Volume Snapshot Service (VSS) files, a type of live backup file on Windows, and replace your wallpaper with its ransom notice.
From here on you either pay up or wait for someone to release a decryption tool, as we saw in the case with CTB-Locker, Locky or TeslaCrypt.
How to help protect against macro malware
The question you need to be asking is not what do you do after your computer is infected with ransomware, but how can you stop it before it reaches your inbox in that attachment?
The answer is simple—be proactive! You filter the email and its attachments, leaving no room for the malware downloader and blocking it before it reaches your email server and/or mailbox.
Finally, always ensure macros are disabled on Microsoft Office applications, and don’t open suspicious emails or attachments.
How does SolarWinds Mail Assure help protect your email?
Normally we would reject the spam/phishing email even before we scan it, because in the majority of cases we classify it as spam/phishing before classifying it as malware. We do this by filtering email using a variety of filtering technologies.
We also offer you the ability to take this one step further, giving you control to block attachments containing macros by default. Once this feature is enabled, emails received with document-based attachments (.doc, .xls, .ppt etc.) containing macros are rejected and quarantined by default.
The SolarWinds® Mail Assure cloud-based email security helps your customers stay in control and protect their inbound and outbound email from email-borne threats.
Start a free trial today to experience SolarWinds Mail Assure
Mia Thompson is product marketing manager, Mail Assure, at SolarWinds MSP.