Cryptojacking is the unauthorized use of another party’s computing resources to mine cryptocurrency, carried out through malicious software, injected browser scripts or abused cloud accounts. In cybersecurity it belongs to the family of malware and attacks that aim at quiet, long-term monetization rather than data theft or disruption: the attacker keeps the mined coins, while the victim pays for the electricity, cloud bills and lost performance.
Unlike ransomware, cryptojacking is designed to stay invisible for as long as possible. Its success depends on persistence and stealth, which is why it often reveals deeper weaknesses such as unpatched servers, exposed container APIs or leaked cloud credentials.
How cryptojacking turns compute into revenue
Cryptojacking works by running a mining workload on hardware the attacker does not own and sending the results to a mining pool that pays out to the attacker’s wallet. The miner repeatedly computes hash functions in search of valid solutions, so every CPU or GPU cycle it consumes translates into a small fraction of a reward.
Attackers strongly prefer Monero (XMR) because its RandomX algorithm is optimized for ordinary CPUs rather than specialized ASIC hardware, and because its privacy features make payouts hard to trace. The open-source XMRig miner is the most common payload, frequently recompiled or packed to evade signature-based detection.
A typical intrusion follows a predictable chain. The attacker gains initial access, drops a downloader script, kills competing miners, installs persistence and finally launches the miner with a configuration that points to a pool. The table below summarizes the main stages.
| Stage | Typical technique | What defenders can observe |
|---|---|---|
| Initial access | Exploited web flaw, weak SSH password, exposed Docker API | Unusual inbound requests or logins |
| Payload delivery | Shell script fetched with curl or wget | Outbound downloads from unknown hosts |
| Competitor removal | Killing other miners and security agents | Terminated processes, disabled services |
| Persistence | Cron jobs, systemd units, SSH keys | New scheduled tasks or authorized keys |
| Mining | XMRig connecting to a pool over Stratum | Sustained high CPU, pool connections |
Main forms of cryptojacking
Cryptojacking appears in three main forms: browser-based mining, host-based malware and cloud resource abuse. Each targets a different resource and leaves different traces, so detection strategies differ as well.
Browser-based cryptojacking became widespread around 2017 with JavaScript miners embedded in websites or injected into compromised pages. It runs only while the tab is open and needs no installation. Its prevalence dropped sharply after the best-known script service shut down in 2019 and browsers began throttling background tabs, although injected scripts still appear on poorly maintained sites.
Host-based cryptojacking installs a persistent miner on servers, workstations or IoT devices, often spread by a worm or a botnet. Cloud cryptojacking is now the most costly variant: attackers use stolen access keys or misconfigured Kubernetes clusters to launch large numbers of compute instances, sometimes generating bills of tens of thousands of dollars within days.
| Form | Resource abused | Persistence | Main cost to the victim |
|---|---|---|---|
| Browser-based | Visitor CPU through JavaScript or WebAssembly | Only while the page is open | Battery drain, slow devices |
| Host-based | Server, PC or IoT device CPU | Survives reboots via scheduled tasks | Performance loss, hardware wear |
| Cloud-based | Rented instances and containers | Lasts until accounts are secured | Direct cloud billing charges |
Cryptojacking compared with related attacks
Cryptojacking differs from neighboring threats mainly in its business model: it earns money continuously from stolen resources instead of from stolen data or extortion. This makes it low-noise by design, which is also why many organizations underestimate it.
The presence of a miner is rarely an isolated problem. Because attackers reach the system through the same weaknesses used for ransomware or infostealers, a miner is best treated as evidence of a broader compromise, and access brokers sometimes resell the same foothold to other criminal groups.
| Threat | Primary goal | Visibility to the victim | Typical impact |
|---|---|---|---|
| Cryptojacking | Ongoing mining revenue | Low, deliberately hidden | Costs, slowdowns, overheating |
| Ransomware | Extortion payment | Very high, announced | Encrypted data, outage |
| Infostealer | Credentials and session data | Low | Account takeover, fraud |
| Botnet | Reusable network of devices | Low to moderate | DDoS, spam, further attacks |
Detecting and preventing cryptojacking
The most reliable signal of cryptojacking is sustained, unexplained CPU or GPU utilization, often close to 100 percent on several cores, combined with outbound connections to mining pools. Many miners throttle themselves to around half of available capacity to avoid attention, so baselines matter more than absolute thresholds.
- Endpoint detection and response tools flag known miner binaries, suspicious command lines and the RandomX memory pattern.
- Network monitoring detects the Stratum mining protocol and DNS queries for known pool domains.
- Cloud billing alerts and quotas expose sudden spikes in instance counts or GPU usage.
- Browser extensions and content security policies block unauthorized mining scripts on endpoints and websites.
Prevention relies on ordinary security hygiene applied consistently: prompt patching of internet-facing services, strong SSH authentication, closed container management ports, and least-privilege cloud credentials that are rotated and never stored in public code repositories.
Common mistakes in handling cryptojacking
The most frequent error is treating a miner as a nuisance and simply deleting the process. Without removing persistence and closing the entry point, the miner usually returns within minutes, and the underlying access remains available for more damaging payloads.
| Mistake | Consequence | Better practice |
|---|---|---|
| Killing only the process | Miner restarts from cron or systemd | Remove all persistence mechanisms |
| Ignoring the entry point | Reinfection or new payloads | Patch and investigate initial access |
| Not rotating cloud keys | Attacker relaunches instances | Revoke and reissue all exposed keys |
| Assuming no data loss | Missed credential theft | Scope the incident as a full compromise |
The short version
Cryptojacking means someone secretly uses your computer, server or cloud account to produce digital money for themselves. You do not lose files, and nothing is announced, but your machines run hot and slow and you pay the electricity or cloud bill.
Think of a stranger who quietly plugs a power-hungry machine into your office socket at night. The real warning is not the stolen power itself but the fact that someone got inside in the first place.
Where it makes a difference
A small software company runs its test environment in a public cloud. A developer accidentally commits an access key to a public code repository. Within hours, automated scanners find the key, and the attacker launches dozens of GPU instances in a region the company never uses, each running a Monero miner.
The incident surfaces three days later when a billing alert fires because daily spending has risen from roughly 80 dollars to more than 4,000 dollars. The security team revokes the key, terminates the instances, enables region restrictions and adds secret scanning to the commit pipeline. The provider waives part of the charges, but the company still absorbs several thousand dollars, and the review shows that budget alerts set at a lower threshold would have stopped the attack on the first day.