How to Stay Safe from Office Macro-Based Malware with Email Security

Microsoft Office macros have been spreading malware since the late ’90s, ranging from Melissa to well-known ransomware applications such as Locky or the Dridex banking malware. However, as users learned how to combat these threats, this type of attack fell out of favor with hackers.

Unfortunately, with the threat landscape ever evolving, cybercriminals becoming more sophisticated, and macro programs becoming popular among businesses, we have seen a resurgence of this type of attack over the past few years. In 2016, Microsoft reported an increase in macro-based malware, accounting for almost 98% of all Office-targeted threats. Last year Microsoft warned that Windows macro-based malware was being spread via Excel in email.

What are macro viruses? 

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 N‑able 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 N‑able® 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 N‑able Mail Assure

Want to stay up to date?

Get the latest MSP tips, tricks, and ideas sent to your inbox each week.

Loading form....

If the form does not load in a few seconds, it is probably because your browser is using Tracking Protection. This is either an Ad Blocker plug-in or your browser is in private mode. Please allow tracking on this page to request a trial.

If this issue persists, please visit our Contact Sales page for local phone numbers.

Note: Firefox users may see a shield icon to the left of the URL in the address bar. Click on this to disable tracking protection for this session/site