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.preloadto spoof GPU metrics, blinding monitoring utilities such asnvidia-smiand 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

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'sdcgm-exportercall functions such asnvmlDeviceGetUtilizationRates()ornvmlDeviceGetComputeRunningProcesses(), 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)
| Tactic | Technique ID | Technique Name | Operational Context |
|---|---|---|---|
| Initial Access | T1190 | Exploit Public-Facing Application | Initial compromise via exposed cloud services or brute-forced SSH credentials. |
| Defense Evasion | T1574.006 | Dynamic Linker Hijacking | Tampering with /etc/ld.so.preload and hooking libnvidia-ml.so to spoof GPU metrics. |
| Defense Evasion | T1014 | Rootkit | Deployment of Linux Kernel Module (LKM) to conceal mining processes and sockets. |
| Command and Control | T1071.001 | Web Protocols / Multi-hop Proxy | Command-and-control communication routed through the TOR anonymity network. |
| Lateral Movement | T1021.004 | SSH | Automated SSH key harvesting and lateral propagation across internal cloud VPCs. |
| Impact | T1496 | Resource Hijacking | Hijacking enterprise GPU/CPU compute cycles for unauthorized cryptocurrency mining. |
Detection, Hunting & SOC Mitigation Playbook
1. Immediate Containment Checklist
- [ ] Inspect
/etc/ld.so.preloadacross all Linux hosts; remove any unauthorized shared library paths immediately. - [ ] Run
lsmodand audit loaded kernel modules against known vendor baselines; unload unverified LKMs viarmmod -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
- Dynamic Linker Integrity: Implement file integrity monitoring (FIM) on
/etc/ld.so.preload,/etc/ld.so.conf, and/usr/lib64/libnvidia-ml.so*. - 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. - 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
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.006Microsoft Sentinel / Defender Detection KQL (LD_PRELOAD & Library Hijacking)
// 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 descMicrosoft Sentinel / Defender Lateral Movement & Threat Hunting KQL (Automated SSH Sweeps)
// 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 desc4. Enterprise Hardening & Long-Term Resilience
- Enforce Kernel Module Signing: Enable
CONFIG_MODULE_SIG_FORCEin the Linux kernel configuration to prevent unsigned LKMs from loading. - Immutable System Configurations: Apply
chattr +i /etc/ld.so.preloadand/etc/ld.so.confto block runtime modifications by unauthorized processes. - 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 Type | Value | Forensic Description |
|---|---|---|
| file_path | /etc/ld.so.preload | Dynamic linker preload configuration modified to load hooking libraries |
| file_path | /usr/lib64/libnvidia-ml.so | Target NVIDIA Management Library intercepted by SANSAR |
| file_path | /usr/lib/x86_64-linux-gnu/libnvidia-ml.so | Debian/Ubuntu target path for hooked NVIDIA telemetry library |
| other | REF3364 | Financially motivated threat activity cluster operating SANSAR |
| other | SANSAR Rust orchestrator, TOR SOCKS5 proxy, XMRig GPU miner | Malware toolchain utilized in intrusion campaign |
---
Related Topic Cluster Intelligence
- Quantum Systems Drones: Bundeswehr Lifts Malware Grounding: Germany's military lifts precautionary grounding of Quantum Systems reconnaissance drones following a server cyber incident.
- GeoVision Surveillance: How to Detect XMRig Miner Attacks: Huntress uncovers active attacks exploiting GeoVision camera software, abusing BYOVD kernel drivers and IFEO hijacks to drop XMRig.
- GSocket: How to Detect Stealthy Linux C2 Relay Malware: Microsoft warns threat actors weaponize GSocket to maintain persistent, encrypted Linux C2 through public relays.
/etc/ld.so.preload/usr/lib64/libnvidia-ml.so/usr/lib/x86_64-linux-gnu/libnvidia-ml.soREF3364SANSAR Rust orchestrator, TOR SOCKS5 proxy, XMRig GPU miner// VERIFIED_SOURCES_&_REFERENCES
Related Threat Intelligence
View Archive
ARTEX AI Agents: How to Detect & Counter Autonomous Attacks
FBI issues FLASH advisory warning that cybercriminals abuse ARTEX AI agents to achieve domain compromise in under 3 hours. Hunt rapid automated lateral moves.

Rspamd 4.3.0: How to Fix DoS Crashes & DMARC Softening Flaw
Rspamd 4.3.0 patches critical HTTP header DoS worker crashes, milter proxy use-after-free bugs, and DMARC softening bypasses. Review upgrade steps.

AI Infostealer Market: How to Detect & Block Replay Attacks
Dark web shops deploy AI to parse infostealer logs into searchable corporate dossiers, targeting enterprise VPNs and AI tokens. Hunt token replay attacks.