One of CYDEF’s managed detection and response clients was one of them. Fortunately, our team of analysts detected unusual activity associated with the attack before damage was done.
The following post details how the malware was detected and discusses what would have happened if we didn’t catch the attack as early as we did.
Emotet Slips by Standard Defenses
Not so long ago, our client received an email from a trusted business partner.
The partner sent an unexpected document, but this wasn’t out of the ordinary. They often exchanged documents for review. However, this document wouldn’t open. So, the client attempted to download the document a second time.
As you might have guessed, the document wasn’t all on the up and up. Unfortunately, it slipped through the spam filter, the AV layer, and other preventive defenses.
CYDEF Detects Emotet
During the course of routine monitoring, the team at CYDEF detected activity linked with the cmd.exe program:
This was an obvious attempt at obfuscation.
Upon identifying the breach, CYDEF immediately notified the client that they’d been hit by a living-off-the-land malware attack. We recommended that they quarantine the machine immediately.
About 60-minutes after the email had first been opened, the affected computer was removed from the network, unplugged, and secured in a private location.
Deobfuscating the Attack
During the deep dive to understand the scope of the incident, CYDEF analysts discovered a malicious Word document that triggered the attack.
By pulling out the raw events from our endpoint detection tool’s stack view and event explorer, the team identified in the chain of parent processes:
An email file path from an Outlook contents folder
Outlook.exe was the parent process
We also identified a child process of the PowerShell command that resulted from the CMD.exe activity:
The DLL drop appeared to be the sole method of persistence and the main tool for attackers to unleash mayhem.
In order to contain the threat, we needed to understand the capabilities packed in the DLL.
Since the affected machine was unplugged, it would be hard to analyze the exact strain of malware present.
Instead, CYDEF’s analysts pulled indicators of compromises (IoCs) from our endpoint detection solution (SMART-Sentinel), and decoded the Base 64-encoded PowerShell command (shown in the screen capture as all lowercase).
While still obfuscated, the PowerShell was clearly building and looping through URLs in order to download something.
Then, the team identified the broken up rundll32 near the end.
In order to understand the source of the file, we needed to unscramble the middle portion of the command.
While there are multiple approaches to deobfuscating PowerShell code, we let the computer to do the work. This method is faster than manual intervention, and less error prone. In order to complete this step, we opened PowerShell in a (Linux) VM, and ran the code between $Hvvhr9p=’h’ + ‘tt’ + ‘p’; and foreach ($Ob6xcz_ in $U5tym2l).
Next, we requested the value of the $U5tym2l variable to view the URLs from which the stager was downloading the DLL:
The team accessed threat intelligence databases in an effort to identify the URLs, but we ultimately relied on access to the DLL from one of the URLs. By uploading the DLL to VirusTotal, we identified the attack as an Emotet infection.
Emotet is one of the most dangerous malware infections in circulation.
It started out as a method to steal banking credentials, then evolved into a remote access tool that ransomware operators use to manage infections. Emotet can steal the passwords needed to compromise more machines, perform lateral movements, and drop additional pieces of malware at a later date.
Emotet is responsible for Ryuk/Coni infections.
If you let an Emotet infection fester, it hijacks passwords for future use, compromises all the machines in your network, then drops a Ryuk ransomware payload.
What would have happened if the malware wasn’t caught in time?
If the breach had not been detected, the following fallout could be expected:
Passwords saved on the computer would be compromised
Attackers would gain access to business partner sites and payroll sites
Machines or networks would be hijacked
Ransom would be demanded
The average ransomware payment for this type of attack is over $1million.
Given our client was not as large as the average company paying the ransom in the Coverware report, the estimated demand would be around $100,000.
SMART-Monitor: CYDEF’s Managed Detection and Response Solution
The process of calculating the real value of cybersecurity is complicated. After all, a lot of cybersecurity spending is similar to insurance spending: you pay a premium month-after-month with no apparent benefit. Then, one day, something happens and you are very glad that you made the investment.
$100,000 in ransomware is not comparable – not even remotely – to the annual cost of an endpoint protection solution. In this particular instance, our client certainly found value in the annual fee.