An analysis of Astaroth, the info-stealing malware that uses multiple fileless techniques to install on a computer and steal passwords.
Malware of the day: Astaroth
Whenever a new malware or a novel attack technique is discovered, our clients worry about how it could affect them. Many come to us asking: “Am I protected against this new threat?”
This post addresses concerns around Astaroth, the info-stealing malware that uses fileless techniques to gain access to computers and then steal passwords.
The Astaroth malware family has been tracked for a long time – most notably by the Microsoft Advanced Threat Protection (ATP) group, who developed signatures to monitor their activity.
Recently, Astaroth adapted its fileless techniques in order to avoid detection. In particular, it no longer uses WMI, which was previously a trigger for detection. The following post by ATP describes the changes:
CYDEF’s SMART-Monitor technology, the engine behind the SMART-Monitor detection service, picks up Astaroth using several tripwires.
Let’s start by looking at the breakdown of the infection chain published by ATP. The report identifies 5 stages:
- The infection stage: where the spear phishing component drops the initial zip, which then gets decrypted to start the infection chain
- The stager phase: where the additional malware components are downloaded.
- The main script phase: where the different malware components are reassembled in preparation of their injection in memory.
- The injection phase: where the malware is injected into memory via process hollowing.
- The monetization phase: where the attacker actively puts the malware to work to steal passwords.
In this infection chain, CYDEF’s coverage model would detect several items in the first three stages (when the malware is being installed). Stages 4 and 5, where malware purely resides in hollowed processes, would leave few traces that would be observable to the current model. This means that malware like Astaroth would be detected by SMART-Monitor early enough to prevent the attackers from accessing data.
Astaroth Attack Chain
The following diagram from Microsoft’s ATP group illustrates which component of the attack chain would be picked up by SMART-Monitor for review by a CYDEF security expert.
Early Breach Detection with SMART-Monitor
Let’s break down each detection opportunity.
One of Astaroth’s great tricks is the zip package delivery. At first glance, the package contains files that appear innocuous. This would not generate an alert in SMART-Monitor.
That being said, the LNK file in the zip would prompt an analyst for review.
Illegitimate Use of CMD
The LNK file is actually a BAT script that calls CMD with the following command line (reposted from ATP):
Since this shows up as a command line, an analyst would review it with particular care, as CMD is a known living –off-the-land binary (LOLbin). An analyst would immediately flag this as suspicious because it is an obvious attempt at obfuscation and not a hallmark of legitimate use.
The command line provided in the following ATP blog post snippet would also alert an analyst:
The URL is clearly illegitimate. Furthermore, the .zip file is saved with a different extension. This blatant attempt at obfuscation is not seen in legitimate programs and would be an immediate marker of foul play.
Data Stream Abuse
Finally, the alternate data stream abuse and the reconstruction of the malware DLL, while difficult to detect for traditional AV products, would be trivial to detect from the daily Smart-Monitor review of command lines. After all, these techniques are essentially never used by legitimate software, so they stand out very clearly as anomalies. For example, the ADS abuse uses the following command line provided by ATP:
This would be automatically reviewed extensively by our team because CMD is a known LOLbin.
The same applies to the creation of the DLLs:
This would trigger a command line review for CMD. The presence of type, a rarely used command to read text files at the command line, would draw the analyst’s attention. Additionally, it would be evident that no legitimate program would create a DLL in this manner.