XMR-Stak
- Type
- Cryptominer
- Capabilities
- PersistenceDefense evasionProcess injection
- Platforms
- LinuxWindowsmacOS
XMR-Stak is a publicly available cryptocurrency miner used for legitimate mining and abused in cryptojacking campaigns, particularly to mine Monero using compromised systems. It has been deployed on Linux, Windows, and macOS. Mining configurations specify pool connections, wallet identifiers, resource-use controls, and logging settings; observed deployments have also required TLS-protected pool connections.
XMR-Stak has been deployed by Watchbog and associated with KORKERDS mining activity. Linux infection chains have installed it through shell-based downloaders after server exploitation or compromise through weak SSH and Telnet credentials. Supporting components in these campaigns provide persistence, propagation, competing-miner removal, and process concealment; these behaviors are not intrinsic capabilities of the miner itself. A Windows campaign exploiting Microsoft Exchange ProxyLogon deployed XMR-Stak-related components through a staged downloader and injected the miner into an existing process. On macOS, the Calendar 2 application bundled and launched XMR-Stak to mine Monero as part of a feature-access arrangement that generated user complaints. Its use across unrelated operations does not establish attribution to a single threat actor.
Associated vulnerabilities
1 CVE Mallory has correlated with this family across public research and vendor advisories. Each card links to the full Mallory page for that vulnerability.
Techniques & procedures
18 distinct techniques documented for this family, organized by ATT&CK tactic.
Execution
6 techniques
Execution
After all the competing miners are wiped out, the attribute of /var/spool/cron/root is made immutable and crontab is reloaded.
The batch script is renamed as a temporary file and deleted after it starts running in the background.
The attack begins with a PowerShell command to retrieve a file named win_r.zip from another compromised server’s Outlook Web Access logon path (/owa/auth).
The .zip file is not a compressed archive, but a batch script that then invokes the built-into-Windows certutil.exe program to download two additional files
The shell script starts with an infinite loop to remove all competing cryptominers found in the infected system
We observed attackers targeting the following package and products via security vulnerabilities disclosed in 2020 and 2021 for malicious cryptocurrency-mining activities through samples caught in our honeypots
Persistence
1 technique
Persistence
After all the competing miners are wiped out, the attribute of /var/spool/cron/root is made immutable and crontab is reloaded.
Privilege Escalation
2 techniques
Privilege Escalation
After all the competing miners are wiped out, the attribute of /var/spool/cron/root is made immutable and crontab is reloaded.
When decoded, the batch script runs the executable, which extracts the miner and configuration data from the QuickCPU.dat file, injects it into a system process, and then deletes the evidence.
Stealth
6 techniques
Stealth
Earlier this year, a security flaw identified as CVE-2021-41773 was disclosed to Apache HTTP Server Project, a path traversal and remote code execution (RCE) flaw in Apache HTTP Server 2.4.49.
The file uses forged data in its Properties sheet that indicates the file is a Windows component, but the binary is not digitally signed
When decoded, the batch script runs the executable, which extracts the miner and configuration data from the QuickCPU.dat file, injects it into a system process, and then deletes the evidence.
The batch file then deletes the evidence and the miner remains running in memory, injected into a process already running on the system.
The certutil application is designed to be able to decode base64-encoded security certificates, so the attackers have leveraged that functionality by encoding an executable payload in base64 and wrapping it in headers that indicate it is some form of digital certificate.
The .zip file is not a compressed archive, but a batch script that then invokes the built-into-Windows certutil.exe program to download two additional files
Defense Impairment
1 technique
Defense Impairment
The shell script starts with an infinite loop to remove all competing cryptominers found in the infected system
Discovery
2 techniques
Discovery
If the miner is already running (c3.exe), the execution jumps to an ALREADY_RUNNING label.
The script further conducts a series of checks in the system, such as if the USERPROFILE environment variable is defined, and whether utilities like wmic, powershell, find, findstr, and tasklist are available or not.
Command and Control
2 techniques
Command and Control
We saw the usage of Netlify and GitHub as the malware file servers for downloading batch scripts from an attacker-controlled account.
By default, the payload sets up the miner so that it only can communicate if it can have a secure TLS connection back to the Monero wallet where it will store its value.
Impact
1 technique
Impact
we found more of these exploits being abused to target different gaps in products and packages for malicious mining of Monero
Observables
12 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
7 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.