Malscape Snapshot: Malicious Activity in the Office 365 Cloud
The accelerating migration to the cloud is creating an attractive target for cybercriminals. One of the primary offerings is Microsoft Office 365, so we decided to take a closer look. We have provided a brief history of Office 365 attacks, and then we take a close look at two recent attacks to illustrate the challenges of effectively protecting employees from attack once your company makes the move to Office 365.
Some Recent History
Before taking a look at the current threats reaching Office 365 mailboxes, let’s take a look at some recent history of publicly recorded attacks.
In June 2016 at least 57 percent of all Office 365 customers received at least one malspam attempt that contained an infected Cerber ransomware attachment. It took Microsoft several hours to update their levels of protection to stop the attack coming into the environment. At the time they had 18 million subscribers. That number increased to 120 million in 2017, and they expect to have at least two-thirds of business customers in the Office 365 cloud by the end of fiscal 2019. Clearly, this is an increasingly juicy target for all sorts of threat actors.
In July 2017 there was a sophisticated attack targeting high-level employees of Fortune 2000 organizations. Within each organization, the attackers targeted a small number of senior employees across multiple departments. It revealed that attackers know that Office 365 is ripe to be exploited and that we should anticipate that attacks against Office 365 will proliferate in the foreseeable future.
In March 2018 millions of Office 365 accounts were hit with Password Stealers, a wave of malspam attacks that tried to dupe users and steal their passwords by disguising malicious emails as tax-related notifications from the IRS. To quote the Dark Reading article linked to above:
“The threat lured victims with Microsoft 365 Office files claiming to be tax forms or other official documents. Examples of this tactic include files named ‘taxletter.doc’ and phrases like ‘We are apprising you upon the arisen tax arrears in the number of 2300CAD.’ The use of popular file types like Word and Excel, which are globally known and used, further ensures victims will fall for it. In this case, users are hit with the password stealer when they download and open the malicious document. When the document opens, a macro inside launches PowerShell, which acts in the background while the victim views the document.”
In May 2018 researchers spotted in-the-wild attacks using a method to bypass the advanced threat protection features in Office 365. Dubbed BaseStriker, the attack was tested against several configurations and found that “anyone using Office 365 in any configuration is vulnerable,“ be it web-based client, mobile app, or desktop application of Outlook.
Last year Microsoft saw malware attempts targeted at Office 365 increase 600 percent. This malicious activity is the backdrop to two recent campaigns Lastline has detected in the Office 365 cloud.
Trikbot and Gandcrab
The first malspam campaign we detected was the Trikbot (aka Phorpiex) spambot, eventually downloading a Gandcrab V3 ransomware payload.
As you can see from Figure 1, Trikbot creates sender IDs that fit the pattern nameXX@XXXX.com where X is a 0-9 number and uses a personal subject line emphasizing the individual, not a work function. Example subject lines, “I’m about to publish your photo” and “Keep them private,” are clearly related to the target’s personal life. The attachment that accompanies the subject line mimics that of a timestamp naming convention of a digital camera and has been given a file extension .jpg.zip.
powershell.exe -noprofile -windowstyle hidden -executionpolicy bypass
InVoKE-WmiMethOd -ClaSs Win32_Process -NAMe CrEAtE -ArgumentLIst
The crabin.exe payload then tries to contact two sites – carder[.]bit and ransomware[.]bit. “.bit” is a cryptocurrency alternative to ICANN DNS. The dotted quad 92.63.197[.]60 is associated with many other malware campaigns. See Figures 2 and 3 for a breakdown of the threats connecting to this IP address, and Figure 4 for a timeline of such connections.In order for a threat to get through the extensive checks deployed by Office 365 it must deploy a multitude of deceptive techniques. As mentioned in one of Microsoft’s articles, any anti-malware solution relying on signatures must make a choice: either they choose to cover an extended hash (leading to more false positives) or cover a smaller and more specific hash, which creates the risk of introducing false negatives.
As a matter of fact, Office 365 engineers recognize that the cost for a business to deal with erroneously quarantined emails has a huge impact and can quickly cause users to lose trust in one of their main communication tools. As they eloquently put it:
“In (EOP) Exchange Online Protection the False-Positive situations happens often and can have a high business impact on an organization.”
It should come as no surprise that fast-evolving threats might thus make signatures that rely on specific hashes less and less effective.
In the case of Gandcrab, the security community has seen a version turnaround of less than one month. This means that the malware is actively developed, and each release is packing new techniques to better serve the nefarious “attackers” or to better evade anti-malware solutions.
Take for example Gandcrab V2 and V3: to make the installation of the payload even more subtle and undetectable, they started relying on,
ReflectiveLoader a technique used to extract executable code, and load it in memory without the need of dropping yet another binary (see Figure 5). See Figure 6 for a breakdown of the main behaviors of the unpacking stage of the payload.
The second campaign we saw when analyzing Office 365 attacks was Emotet (see Figure 7 for a sample lure).
For example, consider the following links taken from the latest EMOTET spam campaign. While the domains are not per se malicious, the underlying hosts have been compromised, and malicious payloads uploaded in a folder featuring a randomly generated component.
As it was the case with file-based attacks, so is it in this case – it’s a matter of coming up with either a smart system able to “understand” the maliciousness of a link based on its structure, or just relying on an ever-increasing blacklist of malicious links known to be delivering a malicious payload. The blacklist approach, as a matter of fact, is the most widely adopted solution because it makes it extremely easy to coordinate with other security vendors when attempting to increase the detection coverage.
A future blog post for Lastline Labs will analyze the tradeoff between these two solutions further. In the meanwhile, it should come without surprise that blacklist based solutions suffer from the same problem of anti-malware solutions employing too restrictive hashing: false negatives.
You should expect breaches to occur when under attack from constantly evolving threats, especially when dealing with environments that cannot cope (by design) with false positives. With this conclusion in mind, we are providing 3 top tips for securing Office 365.
- Use Multi-Factor Authentication. Even if credentials are stolen, it restricts the attacker from moving forward with the attack.
- Trust no URL or attachment, detonate them all. Everything must pass a dynamic analysis check to study the actual intent of every URL and attachment before arriving in an Office 365 inbox.
- Apply best practice, implement Defense in Depth. Augment Microsoft’s own security controls. You can be sure that sophisticated threat actors will already have tested any malicious attack targeting the Office 365 environment against Microsoft’s own security tools to increase their success rate.
Latest posts by Andy Norton (see all)
- How do you Measure Cyber Resilience? - November 1, 2018
- Security Pros Fear Data Compromise, Financial Loss, and More from Cryptomining. But Are Risks Founded? - October 16, 2018
- Crypto-malware – A Look At The Latest Malware Threat - September 25, 2018
Latest posts by Stefano Ortolani (see all)
- Malscape Snapshot: Malicious Activity in the Office 365 Cloud - July 24, 2018
- Evading Static Analyzers by Solving the Equation (Editor) - July 12, 2018
- Evasive Monero Miners: Deserting the Sandbox for Profit - June 20, 2018