Back to Intelligence

SANSAR Linux Cryptomining Malware (REF3364): Detection and Eradication Guide for GPU Infrastructure

SA
Security Arsenal Team
November 16, 2026
7 min read

The Short Version

A financially motivated threat activity cluster tracked as REF3364 is actively deploying a Linux-focused cryptocurrency mining operation that deliberately subverts the exact telemetry defenders rely on to spot GPU cryptominers. The centerpiece is SANSAR, a Rust-based orchestrator that receives commands over the TOR anonymity network and manages both CPU and GPU miners on compromised Linux hosts.

The most operationally significant behavior: SANSAR tampers with the NVIDIA driver library so that GPU utilization readings — the very signal most SOC teams, cloud cost-anomaly alerts, and host-based detections key on — return false "normal" values while the card is being hammered at full mining load. If your detection strategy for cryptominers is "watch for nvidia-smi showing 95%+ utilization," this campaign was engineered specifically to defeat you.

Linux servers with NVIDIA GPUs — AI/ML training nodes, rendering farms, research clusters, crypto-adjacent infrastructure, and increasingly, cloud GPU instances — are the target set. If you operate any of those, read on.


Technical Analysis

What We Know About REF3364 and SANSAR

REF3364 is a financially motivated intrusion set. This is not espionage — it's compute theft. The economics are simple: GPU-rich Linux hosts are expensive, and Monero (or similar CPU/GPU-mineable coins) monetized on stolen hardware is pure margin.

The SANSAR toolkit is architecturally notable for several reasons:

1. Rust-based orchestrator. SANSAR's command-and-control logic is written in Rust, consistent with the broader trend of malware authors moving to memory-safe languages that produce portable, statically-linked binaries with low AV detection rates. Rust binaries also tend to be harder for analysts to reverse quickly, slowing triage.

2. C2 over TOR. SANSAR receives tasking over the TOR anonymity network, meaning its command-and-control traffic blends into anonymized, encrypted onion routing. On hosts with no legitimate business need for TOR, any outbound TOR connectivity is a high-fidelity anomaly. Blocking or alerting on TOR egress remains one of the cheapest, highest-signal network controls for this class of threat.

3. CPU + GPU miner management. SANSAR is not the miner itself — it's the orchestration layer. It deploys, configures, and supervises CPU miners (typically XMRig or derivatives) and GPU miners, managing which resource to exploit based on host characteristics. This layered design means killing the miner process alone may not remove the implant; the orchestrator will respawn or reconfigure it.

4. NVIDIA library tampering — the headline technique. This is the detail that should change your detection posture. SANSAR modifies or hooks the NVIDIA management library (the library backing nvidia-smi and the NVML API, libnvidia-ml.so) so that GPU utilization, memory consumption, and process-attribution queries return sanitized results. Defenders running nvidia-smi see a clean idle card while the GPU is running at mining intensity.

This is a classic rootkit-adjacent technique applied to observability: don't hide the process, corrupt the sensor. It defeats:

  • Manual checks (nvidia-smi looks clean)
  • Naive host monitoring that polls NVML for utilization
  • Some EDR behavioral rules that trigger on GPU-utilization anomalies
  • Cloud cost dashboards that infer mining from GPU-hours

Exploitation Status and Delivery

The activity is confirmed in-the-wild as an active campaign. No specific CVE identifier is associated with the initial access vector in the reporting — consistent with most cryptomining intrusions, REF3364 almost certainly enters through exposed services (SSH brute force, weak credentials, misconfigured Docker/Kubernetes APIs, unpatched web frameworks, or cloud credential theft) rather than a single novel vulnerability. The lesson: your patch management matters, but your attack surface management and credential hygiene matter more against this actor.

This is not in CISA KEV as of publication (no CVE is implicated), but it is operationally active and should be treated as a current threat, not a theoretical one.

Why This Should Worry You More Than "Just Another Miner"

  1. It's an evasion-first design. The NVIDIA library tampering indicates the operators expect to be hunted and have engineered around standard SOC detections.
  2. Persistence of the orchestrator. A Rust-based C2-managed implant on your Linux host is a beachhead. Today's payload is a miner; tomorrow's could be a credential stealer, a proxy for other threat actors, or ransomware staging.
  3. Financial and operational bleed. GPU mining on cloud instances can run thousands of dollars per instance per month. On-prem, it degrades hardware lifespan and starves legitimate AI/ML, HPC, or rendering workloads.
  4. Compliance exposure. A compromised host processing regulated data (HIPAA, PCI-DSS) is a reportable incident in many frameworks, even if the attacker "only" mined cryptocurrency.

Detection & Response

This is a technical threat. The detections below are written for real-world SOC deployment and tuned to minimize noise while catching the specific behaviors described in this campaign.

SIGMA Rules

The following rules target: (1) SANSAR's TOR-based C2 connectivity, (2) NVIDIA library tampering, and (3) suspicious miner-like process behavior on Linux.

YAML
---
title: Linux Process Initiating TOR Network Connection (Possible SANSAR C2)
id: 3c8a1b92-5f4e-4a7d-9c21-8b2e6d4f0a15
status: experimental
description: Detects processes establishing outbound connections to well-known TOR entry/guard ports. SANSAR receives commands over the TOR anonymity network; on servers with no legitimate TOR use, this is a high-fidelity indicator of C2 activity.
references:
  - https://attack.mitre.org/techniques/T1090/003/
  - https://attack.mitre.org/techniques/T1071/001/
author: Security Arsenal
date: 2026/11/25
tags:
  - attack.command_and_control
  - attack.t1090.003
  - attack.t1071.001
logsource:
  category: network_connection
  product: linux
detection:
  selection_ports:
    DestinationPort:
      - 9001
      - 9030
      - 9050
      - 9051
      - 9150
  filter_tor_browser:
    Image|contains:
      - '/tor-browser/'
      - '/tor/'
  condition: selection_ports and not filter_tor_browser
falsepositives:
  - Legitimate TOR daemon or relay operation (rare on production servers)
  - Privacy-focused developers on workstation builds
level: high
---
title: NVIDIA Management Library Modification or Replacement (SANSAR GPU Tampering)
id: 7d2e4c81-9a3b-4f5e-8d16-2c7b9e0f4a38
status: experimental
description: Detects writes or modifications to the NVIDIA Management Library (libnvidia-ml.so) and associated driver components. SANSAR tampers with this library to falsify GPU utilization readings and hide cryptomining activity from nvidia-smi and NVML-based monitoring.
references:
  - https://attack.mitre.org/techniques/T1554/
  - https://attack.mitre.org/techniques/T1036/
author: Security Arsenal
date: 2026/11/25
tags:
  - attack.persistence
  - attack.defense_evasion
  - attack.t1554
logsource:
  category: file_event
  product: linux
detection:
  selection:
    TargetFilename|contains:
      - 'libnvidia-ml.so'
      - '/usr/lib/x86_64-linux-gnu/libnvidia'
      - '/usr/lib64/libnvidia'
      - '/usr/local/cuda/'
  filter_package_manager:
    Image|endswith:
      - '/apt'
      - '/apt-get'
      - '/dpkg'
      - '/yum'
      - '/dnf'
      - '/rpm'
  condition: selection and not filter_package_manager
falsepositives:
  - Legitimate NVIDIA driver updates via package manager (filtered above)
  - Manual driver installation by administrators
level: critical
---
title: Suspicious Cryptominer Process Execution on Linux (CPU/GPU Mining Behavior)
id: 9f1b6d34-2e7c-4a8f-b3d5-6a0c4e8f2b71
status: experimental
description: Detects execution patterns associated with common cryptominers (XMRig and derivatives) and miner-like behavior including stratum protocol arguments, donation-level flags, and high thread-count CPU affinity settings consistent with SANSAR-managed mining payloads.
references:
  - https://attack.mitre.org/techniques/T1496/
author: Security Arsenal
date: 2026/11/25
tags:
  - attack.impact
  - attack.t1496
logsource:
  category: process_creation
  product: linux
detection:
  selection_stratum:
    CommandLine|contains:
      - 'stratum+tcp://'
      - 'stratum+ssl://'
      - 'stratum+udp://'
      - 'pool.'
      - '--donate-level'
      - '--coin='
      - '--algo='
  selection_binary:
    Image|endswith:
      - '/xmrig'
      - '/xmr-stak'
      - '/ccminer'
      - '/ethminer'
      - '/nanominer'
      - '/lolMiner'
  condition: 1 of selection_*
falsepositives:
  - Authorized mining operations (rare in enterprise environments)
  - Security research
level: high

Tuning notes for these rules:

  • The TOR rule will be quiet in most environments. If you operate legitimate TOR relays (you'd know), whitelist those hosts.
  • The NVIDIA library rule is intentionally critical — no legitimate process outside package managers should be writing to libnvidia-ml.so on a stable system. If you do manual driver installs, expect a small number of alerts during maintenance windows; suppress by change-ticket correlation, not by blanket exclusion.
  • The miner rule keys on stratum protocol strings and known miner binary names. Adjust binary names if your environment uses custom-built miners for legitimate purposes.

KQL — Microsoft Sentinel / Defender

Even for Linux threats, most enterprise SOCs ingest Linux Syslog/auditd data into Sentinel. The queries below hunt across process execution and network tables.

KQL — Microsoft Sentinel / Defender
// Hunt 1: Outbound connections to TOR ports from Linux hosts (possible SANSAR C2)
// Scope: last 7 days. Excludes common TOR browser paths.
let tor_ports = dynamic([9001, 9030, 9050, 9051, 9150]);
union isfuzzy=true
    (CommonSecurityLog

```kql
    | where TimeGenerated > ago(7d)
    | where DestinationPort in (tor_ports)
    | where DeviceAction !in (

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.