Skip to main content
ACTIVELY MONITORED//Verified: Nov 16, 2026
Threat IntelligenceCloud DefenseVulnerability Watch
5 min read

SANSAR Malware: How to Detect NVIDIA Lib GPU Miner Rootkit

•By Rutvij Khatri•VERIFIED INTEL
SANSAR Malware: How to Detect NVIDIA Lib GPU Miner Rootkit

SOC Briefing Summary :: Executive Key Takeaways

  • [01]Threat cluster REF3364 deployed SANSAR, a Rust-based orchestrator controlling CPU and GPU cryptominers via the TOR network.
  • [02]Hooks NVIDIA Management Library (libnvidia-ml.so) via LD_PRELOAD to spoof GPU telemetry and conceal heavy mining workloads.
  • [03]Deploys kernel rootkits to hide processes and automates lateral movement across cloud VPC subnets using harvested SSH credentials.

Executive Incident Briefing (2-Minute CISO Brief)

Quick Answer (At-A-Glance): Financially motivated threat activity cluster REF3364 has deployed SANSAR, an advanced Rust-based Linux cryptomining orchestrator that tampers with the NVIDIA Management Library (libnvidia-ml.so) and installs kernel rootkits to conceal illicit GPU mining operations. Operating over the TOR anonymity network, the malware modifies /etc/ld.so.preload to spoof GPU metrics, blinding monitoring utilities such as nvidia-smi and Prometheus agents while actively propagating across cloud VPCs via harvested SSH keys. SOC and CloudSec teams must immediately audit dynamic linker configurations, verify kernel module signatures, and deploy endpoint KQL hunting queries for unauthorized SSH sweeps.

Enterprise cloud infrastructure—specifically high-performance GPU compute clusters dedicated to artificial intelligence and deep learning workloads—represents an increasingly lucrative target for financially motivated cybercrime syndicates. The deployment of SANSAR by threat cluster REF3364 highlights an evolution toward kernel-level and library-level stealth.

  • Threat Cluster: REF3364 (Financially Motivated Cryptojacking Group)
  • Malware Toolkit: SANSAR (Rust orchestrator), custom Linux Kernel Module (LKM) rootkit, patched libnvidia-ml.so.
  • Stealth Vector: LD_PRELOAD library hooking to forge GPU telemetry and spoof zero-utilization states.
  • Operational Blast Radius: GPU resource exhaustion, multi-thousand-dollar cloud compute billing spikes, and lateral server compromise across corporate VPCs.

Organizations running AI training workloads on NVIDIA hardware (e.g., A100, H100, L40S) face significant risk, as traditional workload health monitoring and billing alarms can be actively misled by the hooked telemetry.

Technical Vulnerability Analysis & Attack Chain

Attack Chain Flow
// Attack Chain Flow

SANSAR's infection lifecycle integrates multiple advanced evasion and lateral propagation mechanisms.

1. Ingress & SANSAR Orchestrator Deployment

Adversaries exploit exposed web applications, container management interfaces, or compromised SSH credentials to gain initial low-privileged access. The threat actor drops a statically compiled Rust binary into /tmp or /dev/shm, which verifies the underlying hardware architecture and assesses whether NVIDIA GPU acceleration libraries are available.

2. Dynamic Linker Hijacking via libnvidia-ml.so Hooking

To prevent site reliability engineers (SREs) and automated alerting systems from spotting 100% GPU utilization, SANSAR modifies /etc/ld.so.preload or injects a shared object library intercepting the NVIDIA Management Library (`libnvidia-ml.so`).

  • When monitoring tools like nvidia-smi, Datadog, or Prometheus's dcgm-exporter call functions such as nvmlDeviceGetUtilizationRates() or nvmlDeviceGetComputeRunningProcesses(), the hooked library intercepts the API call and returns forged baseline metrics (e.g., reporting 2-5% GPU load and hiding active compute process PIDs).
  • As a result, the GPU runs at maximum mining capacity while dashboard metrics appear completely idle.

3. Kernel Rootkit Deployment & Process Concealment

SANSAR compiles and loads a malicious Linux Kernel Module (LKM) directly into memory. The rootkit hooks the sys_call_table—specifically sys_getdents64 and sys_kill—to filter out directories, process IDs, and network sockets belonging to the XMRig or KawPow mining processes. Standard system inspection commands such as ps aux, top, lsof, and netstat fail to reveal the existence of the miner.

4. TOR C2 & Lateral SSH Propagation

For command-and-control, SANSAR drops an embedded, stripped-down TOR daemon that proxies traffic over local SOCKS5 ports, communicating with onion services to fetch updated mining configurations and cryptocurrency wallet assignments.

Simultaneously, the malware initiates lateral movement routines:

  • It parses ~/.ssh/known_hosts, /etc/hosts, and bash history files to extract internal private hostnames and IP addresses.
  • It harvests unencrypted private keys (id_rsa, id_ed25519) from /home/*/.ssh/ and executes automated batch SSH commands (ssh -o StrictHostKeyChecking=no -o BatchMode=yes ...) across RFC1918 subnets, deploying SANSAR to every reachable node in the cluster.

MITRE ATT&CK Tactics, Techniques & Procedures (TTPs)

MITRE ATT&CK • OPERATIONAL TTP MAPPING
TacticTechnique IDTechnique NameOperational Context
Initial AccessT1190Exploit Public-Facing ApplicationInitial compromise via exposed cloud services or brute-forced SSH credentials.
Defense EvasionT1574.006Dynamic Linker HijackingTampering with /etc/ld.so.preload and hooking libnvidia-ml.so to spoof GPU metrics.
Defense EvasionT1014RootkitDeployment of Linux Kernel Module (LKM) to conceal mining processes and sockets.
Command and ControlT1071.001Web Protocols / Multi-hop ProxyCommand-and-control communication routed through the TOR anonymity network.
Lateral MovementT1021.004SSHAutomated SSH key harvesting and lateral propagation across internal cloud VPCs.
ImpactT1496Resource HijackingHijacking enterprise GPU/CPU compute cycles for unauthorized cryptocurrency mining.

Detection, Hunting & SOC Mitigation Playbook

1. Immediate Containment Checklist

  • [ ] Inspect /etc/ld.so.preload across all Linux hosts; remove any unauthorized shared library paths immediately.
  • [ ] Run lsmod and audit loaded kernel modules against known vendor baselines; unload unverified LKMs via rmmod -f.
  • [ ] Block outbound TOR directory and guard node IP connections at the cloud VPC firewall level.
  • [ ] Revoke and re-generate all enterprise SSH keypairs stored in /home/*/.ssh/ and enforce Hardware Security Keys (FIDO2) for SSH access.

2. Behavioral Detection Strategy

  1. Dynamic Linker Integrity: Implement file integrity monitoring (FIM) on /etc/ld.so.preload, /etc/ld.so.conf, and /usr/lib64/libnvidia-ml.so*.
  2. Out-of-Band Hardware Telemetry: Compare software-reported GPU metrics (nvidia-smi) against out-of-band baseboard management controller (BMC/IPMI) hardware power consumption. An idle GPU consuming 300+ Watts indicates hooked metrics.
  3. Network Connection Anomalies: Monitor for outbound connections destined for TCP port 9001/9050 or known TOR guard nodes.

3. Endpoint Detection & Hunting Query

Sigma Detection Rule

QUERY / DETECTION_RULE
SIGMA / YAML
title: Linux Dynamic Linker Preload Tampering (SANSAR GPU Evasion)
id: 4a2b1c89-9812-4fe3-b124-7890abcdef12
status: experimental
description: Detects modifications to /etc/ld.so.preload or creation of suspicious shared libraries used to hook libnvidia-ml.so.
author: Rutvij Khatri (CyberNewsAI)
references:
    - https://thehackernews.com/2026/11/sansar-linux-cryptomining-malware-uses.html?ref=cybernewsai.com
date: 2026-11-16
logsource:
    category: file_event
    product: linux
detection:
    selection:
        TargetFilename:
            - '/etc/ld.so.preload'
            - '/etc/ld.so.conf.d/nvidia-hook.conf'
        TargetFilename|contains:
            - 'libnvidia-ml'
    filter_pkg:
        InitiatingProcessAccountName:
            - 'root'
        InitiatingProcessFileName:
            - '/usr/bin/apt-get'
            - '/usr/bin/yum'
            - '/usr/bin/dnf'
    condition: selection and not filter_pkg
falsepositives:
    - Legitimate GPU driver upgrades conducted via non-standard packaging scripts.
level: high
tags:
    - attack.defense_evasion
    - attack.t1574.006

Microsoft Sentinel / Defender Detection KQL (LD_PRELOAD & Library Hijacking)

QUERY / DETECTION_RULE
SENTINEL / KQL
// Detection Query: Hunt for modifications to Linux dynamic linker configuration files
DeviceFileEvents
| where Timestamp >= ago(7d)
| where ActionType in ("FileCreated", "FileModified")
| where FolderPath has_any ("/etc/ld.so.preload", "/etc/ld.so.conf.d/", "/usr/lib64/libnvidia-ml.so", "/usr/lib/x86_64-linux-gnu/")
| where not(InitiatingProcessFileName in~ ("apt-get", "dpkg", "yum", "dnf", "rpm", "nvidia-installer"))
| project Timestamp, DeviceName, ActionType, FolderPath, FileName, InitiatingProcessAccountName, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc

Microsoft Sentinel / Defender Lateral Movement & Threat Hunting KQL (Automated SSH Sweeps)

QUERY / DETECTION_RULE
SENTINEL / KQL
// Lateral Movement Hunting: Identify rapid lateral SSH connections originating from non-administrative service accounts
DeviceProcessEvents
| where Timestamp >= ago(7d)
| where FileName in~ ("ssh", "scp", "sftp")
| where ProcessCommandLine has_any ("BatchMode=yes", "StrictHostKeyChecking=no", "known_hosts", "id_rsa")
| extend DestinationTarget = extract(@"([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})", 1, ProcessCommandLine)
| summarize TargetCount = dcount(DestinationTarget), Commands = make_set(ProcessCommandLine) by DeviceName, InitiatingProcessFileName, AccountName, bin(Timestamp, 30m)
| where TargetCount >= 3
| sort by TargetCount desc

4. Enterprise Hardening & Long-Term Resilience

  1. Enforce Kernel Module Signing: Enable CONFIG_MODULE_SIG_FORCE in the Linux kernel configuration to prevent unsigned LKMs from loading.
  2. Immutable System Configurations: Apply chattr +i /etc/ld.so.preload and /etc/ld.so.conf to block runtime modifications by unauthorized processes.
  3. Network Microsegmentation: Restrict intra-VPC SSH traffic between GPU compute nodes using zero-trust network access (ZTNA) and bastion gateways.

Indicators of Compromise (IOCs)

Indicator TypeValueForensic Description
file_path/etc/ld.so.preloadDynamic linker preload configuration modified to load hooking libraries
file_path/usr/lib64/libnvidia-ml.soTarget NVIDIA Management Library intercepted by SANSAR
file_path/usr/lib/x86_64-linux-gnu/libnvidia-ml.soDebian/Ubuntu target path for hooked NVIDIA telemetry library
otherREF3364Financially motivated threat activity cluster operating SANSAR
otherSANSAR Rust orchestrator, TOR SOCKS5 proxy, XMRig GPU minerMalware toolchain utilized in intrusion campaign

---

Related Topic Cluster Intelligence

Indicators of Compromise (IOCs)
5 Identified
FILE PATH/etc/ld.so.preload
FILE PATH/usr/lib64/libnvidia-ml.so
FILE PATH/usr/lib/x86_64-linux-gnu/libnvidia-ml.so
THREAT ACTOR CLUSTERREF3364
MALWARE TOOLINGSANSAR Rust orchestrator, TOR SOCKS5 proxy, XMRig GPU miner
SHARE INTEL:Reddit