Cryptojacking

On this page 7

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.

StageTypical techniqueWhat defenders can observe
Initial accessExploited web flaw, weak SSH password, exposed Docker APIUnusual inbound requests or logins
Payload deliveryShell script fetched with curl or wgetOutbound downloads from unknown hosts
Competitor removalKilling other miners and security agentsTerminated processes, disabled services
PersistenceCron jobs, systemd units, SSH keysNew scheduled tasks or authorized keys
MiningXMRig connecting to a pool over StratumSustained high CPU, pool connections
Typical stages of a cryptojacking intrusion

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.

FormResource abusedPersistenceMain cost to the victim
Browser-basedVisitor CPU through JavaScript or WebAssemblyOnly while the page is openBattery drain, slow devices
Host-basedServer, PC or IoT device CPUSurvives reboots via scheduled tasksPerformance loss, hardware wear
Cloud-basedRented instances and containersLasts until accounts are securedDirect cloud billing charges
Comparison of cryptojacking forms

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.

ThreatPrimary goalVisibility to the victimTypical impact
CryptojackingOngoing mining revenueLow, deliberately hiddenCosts, slowdowns, overheating
RansomwareExtortion paymentVery high, announcedEncrypted data, outage
InfostealerCredentials and session dataLowAccount takeover, fraud
BotnetReusable network of devicesLow to moderateDDoS, spam, further attacks
How cryptojacking differs from neighboring threats

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.

MistakeConsequenceBetter practice
Killing only the processMiner restarts from cron or systemdRemove all persistence mechanisms
Ignoring the entry pointReinfection or new payloadsPatch and investigate initial access
Not rotating cloud keysAttacker relaunches instancesRevoke and reissue all exposed keys
Assuming no data lossMissed credential theftScope the incident as a full compromise
Response mistakes and better practice

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.