Detect Compute Hijacking in Splunk
Adversaries may leverage the compute resources of co-opted systems to mine cryptocurrency or perform other resource-intensive tasks, degrading system performance and hosted service availability. The most prevalent form is unauthorized cryptocurrency mining (cryptojacking), typically targeting Monero (XMR) via XMRig or derivative tools due to CPU-friendliness and transaction privacy. Threat actors including TeamTNT, Blue Mockingbird, Rocke, APT41, Kinsing, and Hildegard have deployed miners as follow-on payloads targeting Windows endpoints, Linux servers, and containerized environments. Miners connect to mining pools over stratum protocol (commonly ports 3333, 4444, 14444) and are often deployed alongside rootkits, cron-based persistence, and competing miner kill scripts.
MITRE ATT&CK
- Tactic
- Impact
- Technique
- T1496 Resource Hijacking
- Sub-technique
- T1496.001 Compute Hijacking
- Canonical reference
- https://attack.mitre.org/techniques/T1496/001/
SPL Detection Query
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational"
| eval is_proc_create=if(EventCode=1, 1, 0)
| eval is_net_connect=if(EventCode=3, 1, 0)
| where is_proc_create=1 OR is_net_connect=1
| eval MinerBinaryMatch=if(
match(lower(Image), "(xmrig|minerd|cpuminer|ethminer|nbminer|t-rex|phoenixminer|nanominer|xmrstak|xmr-stak|kdevtmpfsi|kinsing|sysupdate|networkservice|sysguard|kerberods)"),
1, 0)
| eval MiningArgMatch=if(
match(lower(CommandLine), "(stratum\+tcp://|stratum\+ssl://|--donate-level|--mining-threads|--coin\s+monero|--coin\s+xmr|pool\.minexmr|pool\.hashvault|supportxmr\.com|nanopool\.org|monerohash\.com|cryptonight|randomx|--max-cpu-usage|xmrpool)"),
1, 0)
| eval MiningPortMatch=if(
is_net_connect=1 AND match(DestinationPort, "^(3333|4444|5555|7777|14444|45700|3032|8008|9999|14433|45560)$")
AND NOT match(DestinationIp, "^(10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)"),
1, 0)
| eval SuspicionScore=MinerBinaryMatch + MiningArgMatch + MiningPortMatch
| where SuspicionScore > 0
| eval DetectionType=case(
is_proc_create=1 AND MinerBinaryMatch=1, "KnownMinerBinary",
is_proc_create=1 AND MiningArgMatch=1, "MiningArguments",
is_net_connect=1 AND MiningPortMatch=1, "MiningPoolConnection",
true(), "Mixed")
| eval ProcessName=coalesce(Image, "unknown")
| eval CmdLine=coalesce(CommandLine, "")
| eval DestPort=coalesce(DestinationPort, "")
| eval DestIP=coalesce(DestinationIp, "")
| table _time, host, User, ProcessName, CmdLine, ParentImage, ParentCommandLine,
DestIP, DestPort, DetectionType, MinerBinaryMatch, MiningArgMatch,
MiningPortMatch, SuspicionScore
| sort - SuspicionScore, - _time Detects cryptocurrency mining activity using Sysmon Event ID 1 (Process Create) and Event ID 3 (Network Connect). Evaluates three detection signals: (1) known miner binary names in the process image path including XMRig variants, kdevtmpfsi, kinsing, and common Linux miner disguise names; (2) mining-specific command line arguments such as stratum protocol URLs, --donate-level, and known pool domain names; (3) outbound network connections to common mining pool ports (3333, 4444, 14444, etc.) to non-RFC1918 destinations. Assigns a suspicion score across signals for prioritization.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Authorized cryptocurrency mining operations or research environments where staff legitimately run miners
- Security researchers testing miner detection capabilities using XMRig or similar tools in sandboxed environments
- Port 3333 used by legitimate development tools or custom applications (e.g., some IoT platforms, local proxy servers)
- Penetration testers running authorized mining simulations as part of red team engagements with documented change tickets
- Academic HPC workloads that use similar CPU-maximizing flags but for legitimate compute tasks
Other platforms for T1496.001
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1XMRig Miner Execution with Pool Arguments (Windows)
Expected signal: Sysmon Event ID 1: Process Create with Image=xmrig.exe, CommandLine containing '--donate-level', 'stratum+tcp://', '--max-cpu-usage'. Sysmon Event ID 3: Network connection attempt to 127.0.0.1:3333 (will fail). Security Event ID 4688 if command line auditing enabled. High CPU utilization visible in performance counters immediately after launch.
- Test 2XMRig Miner Execution via PowerShell Download Cradle (Windows)
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with '-ExecutionPolicy Bypass -WindowStyle Hidden'. Sysmon Event ID 3: Network connection attempt to 127.0.0.1:8080 from powershell.exe. PowerShell ScriptBlock Log Event ID 4104 with full download cradle content. If the download succeeded: second Sysmon Event ID 1 for svchost32.exe with mining arguments.
- Test 3Miner Persistence via Linux Cron Job
Expected signal: Linux auditd: syscall=execve for crontab command. On next cron tick: process creation for bash/sh spawning curl with mining-related URL, then chmod +x on /tmp/kdevtmpfsi, then execution of /tmp/kdevtmpfsi. If MDE Linux agent enrolled: DeviceProcessEvents showing cron as initiating process spawning curl and the miner binary.
- Test 4Mining Pool Network Connection Simulation
Expected signal: Sysmon Event ID 3: three network connection events from powershell.exe to 127.0.0.1 on ports 3333, 4444, and 14444. Connections will fail (no listener) but the event is generated on the SYN attempt. Windows Firewall log entries for outbound connection attempts on mining ports.
References (13)
- https://attack.mitre.org/techniques/T1496/001/
- https://unit42.paloaltonetworks.com/hildegard-malware-teamtnt/
- https://www.trendmicro.com/en_us/research/19/e/infected-cryptocurrency-mining-containers-target-docker-hosts-with-exposed-apis-use-shodan-to-find-additional-victims.html
- https://www.trendmicro.com/en_us/research/20/i/war-of-linux-cryptocurrency-miners-a-battle-for-resources.html
- https://unit42.paloaltonetworks.com/lucifer-new-cryptojacking-and-ddos-hybrid-malware/
- https://redcanary.com/blog/blue-mockingbird-cryptominer/
- https://www.aquasec.com/blog/threat-alert-kinsing-malware-container-vulnerability/
- https://sysdig.com/blog/cryptojacking-cloud-security-kinsing/
- https://www.lacework.com/blog/teamtnt-the-first-crypto-mining-worm-to-steal-aws-credentials/
- https://github.com/xmrig/xmrig
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceprocessevents-table
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1496/T1496.md
Unlock Pro Content
Get the full detection package for T1496.001 including response playbook, investigation guide, and atomic red team tests.