Description
Cryptojacking involves unauthorized use of computing resources to mine cryptocurrency. Attackers compromise servers, cloud infrastructure or endpoints and use their CPU or GPU capacity for mining without the owner's permission.
In the SANSAR intrusion, Elastic identified a more sophisticated approach than simply installing a cryptocurrency miner.
The attacker deployed a coordinated Linux malware toolkit that included a remote-management component, a kernel rootkit, a modified NVIDIA monitoring library and a separate backdoor.
The operation specifically targeted Linux GPU infrastructure. The attacker abused an exposed Ray job agent to execute commands, established persistent access through SSH authorized keys and subsequently obtained root privileges.
After gaining control, the attacker deployed the malware under /opt/vadi_, installed a kernel module through Dynamic Kernel Module Support (DKMS), modified NVIDIA's management library and registered the separate netns backdoor as a systemd service.
The combination of process concealment and falsified hardware telemetry made the mining activity significantly harder to identify through ordinary system monitoring.
Technical Description
1. SANSAR — Rust-Based Cryptomining Orchestrator
SANSAR is the primary management component of the toolkit.
It is written in Rust and identified by the version string:
sansar-client v0.1.3
Its responsibilities include:
Communicating with the operator through Tor.
Collecting host and GPU information.
Registering compromised systems with the C2 server.
Managing CPU and GPU cryptocurrency miners.
Opening interactive Bash sessions.
Updating mining configurations.
Monitoring miner output and status.
Managing Tor connections and bridge configurations.
Supporting network traffic-generation tasks.
SANSAR does not contain a fixed mining-pool address or wallet configuration. Instead, the C2 server supplies the mining configuration when issuing a MinerStart command.
This gives the operator flexibility to change the mining destination and configuration remotely.
2. XMRig and SRBMiner-MULTI
SANSAR manages two different mining programs.
Component | Software | Purpose |
|---|---|---|
| XMRig 6.25.0 | CPU cryptocurrency mining |
| SRBMiner-MULTI 3.6.9 | GPU cryptocurrency mining |
The malware selects the appropriate miner according to the supplied miner type.
Miner type
0selects the GPU miner,tilki.Miner type
1selects the CPU miner,kurt.
Elastic found that the collected tilki executable had the same SHA-256 hash as the official SRBMiner-MULTI 3.6.9 Linux release.
This is an important forensic detail: the presence of a legitimate mining binary does not automatically make the activity benign. The context of installation, execution, configuration and unauthorized control must also be examined.
3. acpi_thermal_mgr.ko — Linux Kernel Rootkit
The acpi_thermal_mgr.ko kernel module is responsible for concealing malicious activity.
It uses Linux Function Tracer (ftrace) to intercept selected kernel functions and system calls.
Its capabilities include:
Hiding selected processes.
Hiding worker threads associated with concealed processes.
Removing selected entries from directory listings.
Preventing access to hidden process information.
Concealing selected files and directories.
Filtering TCP and UDP socket listings.
Potentially hiding its own kernel module entry.
The rootkit hooks functions including:
getdents64openatkill
Process concealment
The rootkit modifies directory-listing results so that selected process IDs are omitted from /proc.
For example, when a monitoring tool attempts to enumerate processes, the kernel module can remove entries associated with configured hidden processes.
It also intercepts access to hidden process paths and can return errors such as:
ENOENT— No such file or directory.ESRCH— No such process.
These responses make concealed processes appear nonexistent to certain inspection tools.
File concealment
When configured with a hidden filename prefix, the module removes matching files and directories from directory listings.
It also blocks access to matching paths through the open and openat hooks.
Socket concealment
The module intercepts kernel routines responsible for producing TCP and UDP socket listings. This allows it to conceal selected network connections from conventional inspection tools.
Module self-hiding
When the hide_module parameter is enabled, the module removes its entry from the kernel module list and its sysfs object.
This creates an additional obstacle for investigators attempting to identify the malicious kernel component through ordinary module enumeration.
4. Modified NVML Library — Falsifying GPU Telemetry
One of the most distinctive techniques in the SANSAR toolkit is its modification of NVIDIA's Management Library.
NVML is a user-space library used by NVIDIA monitoring tools, including nvidia-smi, to retrieve GPU information.
The attackers replaced the normal NVML library interface with a modified wrapper.
The wrapper forwards requests to the genuine NVIDIA library and then alters selected results before returning them to the requesting application.
Observed telemetry manipulation
GPU Metric | Reported Value |
|---|---|
GPU utilization | 0% |
GPU temperature | Random values between 36°C and 46°C |
GPU power consumption | Random values between 100 W and 200 W |
The wrapper therefore creates misleading monitoring results even when the GPU is being used by the cryptocurrency miner.
Elastic identified the following directory:
/opt/vadi_/nvml-hook/
It contained:
nvml_hook.cA Makefile
The modified
libnvidia-ml.so.1library.
The installation process uses make, make install and ldconfig to replace the NVML library used by monitoring applications.
The genuine versioned NVIDIA library is retained for backend calls, and a backup may be created at:
/usr/lib/.libnvidia-ml.so.1.backup
This is particularly important for GPU-intensive AI and machine-learning environments, where administrators frequently depend on NVIDIA telemetry to monitor hardware utilization.
5. netns — Ethereum-Assisted Backdoor
The separate netns component provides another method of remote access.
Unlike SANSAR, which obtains its C2 information from an encoded Tor onion address, netns retrieves its controller's IPv4 address from an Ethereum smart contract.
The backdoor sends eth_call requests over HTTPS through public Ethereum RPC services.
Embedded Ethereum contract:
0x43eb291f56688c63c93e8a93c4591fc997cf6349
Function selector:
0x6ded96e7
The smart-contract response contains an encoded IPv4 address.
The backdoor decodes this address and attempts to connect to the controller over TCP port 8080.
After connecting, the controller can send a command using the format:
SHELL <host> <port>
The backdoor parses the supplied destination, creates a child process and launches Bash to establish another outbound connection.
The destination of this reverse-shell connection can be different from the controller address obtained from Ethereum.
Elastic also observed that the command loop does not implement application-level authentication or integrity checking.
This design demonstrates how public blockchain infrastructure can be used as a dynamic C2 discovery mechanism.
Attack Overview
Initial Access: Exposed Ray Job Agent
The attacker initially compromised a Linux GPU host through an exposed Ray job agent.
Ray is an open-source framework used to distribute Python workloads across multiple machines. It supports distributed machine-learning training, inference and other computational workloads.
Its Jobs API allows users to submit applications and commands for execution on a Ray cluster.
In the observed intrusion:
The Ray dashboard on the head node listened only on the local loopback interface.
The job agent remained accessible from the internet.
The exposed interface accepted job submissions without authentication.
This allowed the attacker to submit jobs and execute commands through Ray.
Attack Timeline
Date | Observed activity |
|---|---|
October 22, 2026 | External probing appeared in Ray logs |
October 24, 2026 | A submitted job executed |
October 25, 2026 | A Python reverse-shell job connected to an external listener |
Following initial access | The attacker added an SSH public key to the compromised account's |
Post-compromise | The attacker obtained root privileges and deployed the SANSAR toolkit |
Subsequent activity | The toolkit was deployed across three Linux GPU hosts |
Phase 1: Reconnaissance and GPU Discovery
The attacker used the exposed Ray job agent to execute commands on the first compromised host.
One of the early commands was:
nvidia-smi
The command was used to identify the available GPU hardware.
The collected information was transmitted to an external server.
SANSAR also collects information about the compromised host, including:
Hostname from
/etc/hostname.GPU model and device count.
Logical CPU count from
/proc/cpuinfo.Public IP address.
System uptime.
Logged-in user information.
System load averages.
Phase 2: Reverse Shell and Persistence
On October 25, 2026, the attacker submitted a Python reverse-shell job.
The reverse shell connected to an external listener and ran under the local account associated with the Ray session.
The attacker subsequently added an SSH public key to the account's:
authorized_keys
This allowed persistent SSH access without repeatedly relying on the initial Ray job submission.
Phase 3: Privilege Escalation and Toolkit Deployment
After obtaining root privileges, the attacker staged the toolkit under:
/opt/vadi_/
The installation involved:
Deploying the SANSAR orchestrator.
Building the
acpi_thermal_mgrkernel module using DKMS.Adding an initramfs loader to support loading the module during boot.
Replacing the NVIDIA Management Library with a modified wrapper.
Registering the
netnsbackdoor as a systemd service.
The GPU miner was deployed later on two hosts.
Elastic observed a kernel log recording /opt/vadi_/tilki starting on one machine. Cache creation and new GPU contexts provided supporting evidence of execution on the other system.
Phase 4: Tor-Based Command and Control
SANSAR uses the Arti library, the Rust implementation of Tor, for its C2 communication.
The malware supports two connection modes:
Direct mode: Connects through Arti without Lyrebird.
Bridge mode: Uses Lyrebird to reach Tor through configured WebTunnel or obfs4 bridges.
Both modes connect to the same onion C2 service.
The malware stores supporting data relative to its executable directory, including:
arti_data/statearti_data/cachebridges.client_idlyrebird
The recovered bridge configuration contained seven WebTunnel entries and three obfs4 entries.
Phase 5: Mining and Concealment
After connecting to the C2 infrastructure, SANSAR receives commands to start and manage CPU and GPU miners.
The kernel rootkit conceals selected mining processes, files and socket entries.
At the same time, the NVML wrapper modifies GPU telemetry so that monitoring applications report 0% utilization.
This combination allows the miners to continue consuming system resources while making ordinary process and hardware monitoring less reliable.
Phase 6: Separate Ethereum-Based Backdoor
The netns backdoor provides a separate command-execution mechanism.
It retrieves its controller IP address through an Ethereum smart contract and establishes a TCP connection to port 8080.
The controller can then request a reverse shell by supplying a SHELL command.
This creates an additional remote-access channel that does not depend on SANSAR's Tor C2 connection.
Technical Analysis
SANSAR's Anti-Analysis Mechanisms
Before establishing its C2 connection, SANSAR performs anti-debugging checks.
It reads:
/proc/self/status
It examines the TracerPid value and exits if it is nonzero.
This helps detect whether the process is being traced by a debugger.
SANSAR also measures the execution time of a 1,000-iteration loop. It exits if the operation takes 501 milliseconds or longer.
These checks can interfere with dynamic analysis in debugging environments and virtualized sandboxes.
Encoded Tor C2 Address
SANSAR stores its onion C2 hostname as 62 encoded bytes.
Elastic reproduced the decoding process offline.
Each byte is rotated right by a position-dependent amount and then XORed with a byte from a repeating 32-byte mask.
The decoding operation is:
plaintext[i] = ROR8(ciphertext[i], (i % 7) + 1) XOR mask[i % 32]
The resulting onion address is:
efxisnqldelyr5ra25oqfrsut54b34g26e7zrsiuupsoekjof2gho2id.onion:9051
The malware uses this address for command delivery, host registration, inventory reporting and miner-status communication.
HMAC-Based Registration
SANSAR uses an HMAC-SHA256-based authentication field during registration.
The 40-byte field consists of:
An 8-byte timestamp.
A 32-byte HMAC-SHA256 digest.
The digest is calculated using the client ID, timestamp and a key embedded in the binary.
The format is:
timestamp = BE64(unix_seconds)
authentication = timestamp || HMAC-SHA256(K, client_id_bytes || timestamp)
The malware also sends periodic heartbeats reporting its runtime, Tor connection mode and reconnection statistics.
Binary C2 Protocol
SANSAR communicates through a binary message protocol over Tor.
Each message contains:
A four-byte big-endian body length.
A four-byte little-endian message type identifier.
A payload containing the message-specific information.
Elastic identified 16 incoming message types.
ID | Message Type | Function |
|---|---|---|
0 |
| Confirms registration and provides session information |
1 |
| Acknowledges a client heartbeat |
2 |
| Handles version responses, restart requests and unsupported custom commands |
3 |
| Closes the current C2 session |
4 |
| Updates the Tor bridge configuration |
5 |
| Opens an interactive Bash session |
6 |
| Sends input to an existing shell |
7 |
| Changes terminal dimensions |
8 |
| Closes a shell session |
9 |
| Starts a TCP SYN traffic-generation task |
10 |
| Stops a selected traffic-generation task |
11 |
| Starts a CPU or GPU miner |
12 |
| Stops a selected miner |
13 |
| Updates miner configuration |
14 |
| Enables miner console-output forwarding |
15 |
| Disables miner console-output forwarding |
Interactive shell behavior
The ShellOpen handler launches:
/bin/bash --norc --noprofile
It runs Bash in a pseudo-terminal and configures:
HISTFILE=/dev/null
It also sets the shell-history size variables to zero, preventing normal command-history storage.
This is an important forensic consideration because standard shell-history review may not provide a complete record of commands executed through these sessions.
Indicators of Compromise (IOCs)
Elastic Security Labs published the following SHA-256 hashes for the components identified in its investigation.
SHA-256 File Hashes
SHA-256 | File | Description |
|---|---|---|
|
| Rust-based mining orchestrator |
|
| XMRig 6.25.0 CPU miner |
|
| SRBMiner-MULTI GPU miner |
|
| Tor transport helper |
|
| Modified NVML wrapper |
|
| Linux kernel rootkit |
|
| Ethereum-assisted backdoor |
Network Indicators
Indicator | Type | Purpose |
|---|---|---|
| Tor onion address | SANSAR C2 |
Port | TCP port | SANSAR onion service port |
| Ethereum contract |
|
| Function selector | Ethereum contract call |
Port | TCP port |
|
File and Directory Artifacts
Artifact | Description |
|---|---|
| Toolkit staging directory |
| NVML wrapper source and build files |
| Modified NVML wrapper source |
| Potential backup of the original NVML library |
| Rootkit source directory |
| Kernel rootkit module |
| Areas to inspect for unexpected access artifacts |
Process and Command Indicators
sansarkurttilkilyrebirdnetnsnvidia-smi --query-gpu=name --format=csv,noheader/bin/bash --norc --noprofileHISTFILE=/dev/nullUnexpected Python reverse-shell jobs submitted through Ray.
IOC handling note: The hashes and infrastructure indicators above are taken from Elastic's investigation. The SRBMiner-MULTI executable identified as tilki had the same hash as the official release, so its hash alone should not be treated as proof of malware. Investigators should correlate it with its installation path, execution context and unauthorized mining configuration.
Detection and Threat Hunting
Traditional process and GPU monitoring may be unreliable when a rootkit and modified hardware-monitoring library are present.
Security teams should therefore correlate multiple sources of evidence rather than relying on a single command or dashboard.
1. Ray Job-Agent Exposure
Investigate Ray deployments for:
Internet-accessible job-agent endpoints.
Jobs submitted without authentication.
Unexpected Python job submissions.
Commands executing
nvidia-smi.Reverse-shell processes launched from Ray workloads.
Unexpected outbound connections following job execution.
Review Ray job logs and correlate job submission timestamps with network and endpoint events.
2. SSH Persistence
Review:
Unexpected additions to
authorized_keys.Changes to SSH configuration.
New login sessions.
Unusual SSH authentication patterns.
Access from unfamiliar source addresses.
Pay particular attention to the local account that owns the Ray session.
3. Kernel Rootkit Detection
Investigate:
Unexpected kernel modules.
Unusual DKMS registrations.
Changes to initramfs images.
Unexpected ftrace hooks.
Differences between process listings from independent collection methods.
Suspicious changes to
/procand/sysvisibility.
Because a rootkit can manipulate output from user-space inspection tools, investigators should consider trusted offline acquisition and analysis methods when root-level compromise is suspected.
4. GPU Telemetry Integrity
Do not rely exclusively on nvidia-smi output.
Compare GPU activity against:
Application-level GPU workloads.
GPU contexts and process information.
Power consumption and temperature from independent monitoring sources.
The integrity of
libnvidia-ml.so.1.Unexpected library replacement or backup files.
Changes to NVIDIA library paths and loader configuration.
An apparent 0% GPU utilization reading does not establish that the GPU is idle when the monitoring library itself may have been modified.
5. Tor and Blockchain C2 Detection
Monitor for:
Unexpected Tor-related outbound connections.
WebTunnel and obfs4 bridge activity.
Connections to the identified onion address.
Unexpected access to public Ethereum RPC services.
Requests involving the identified contract address.
Outbound TCP connections to port 8080 associated with suspicious processes.
6. YARA Detection
Elastic published YARA rules for both SANSAR and netns.
SANSAR rule:
Linux_Trojan_Sansar_11eea454
netns rule:
Linux_Trojan_Netns_c94a4b17
These rules can be obtained from the original Elastic report and incorporated into appropriate malware-scanning workflows.
Recommendations
Immediate Actions
Secure Ray deployments: Disable unauthenticated public access to Ray job submission interfaces and restrict access to trusted networks.
Investigate exposed hosts: Review Ray job histories, authentication records and process activity for suspicious submissions.
Inspect SSH persistence: Check
authorized_keysfiles for unauthorized public keys and investigate unfamiliar SSH sessions.Validate kernel modules: Examine DKMS registrations, loaded kernel modules and initramfs images for unexpected modifications.
Verify NVIDIA library integrity: Compare
libnvidia-ml.so.1against trusted vendor packages and inspect suspicious backup files.Hunt for cryptominers: Search for unexpected XMRig and SRBMiner-MULTI processes, especially those executing from unusual directories.
Review outbound traffic: Investigate Tor connections, Ethereum RPC requests and suspicious outbound TCP sessions.
Preserve forensic evidence: Capture relevant logs, process information, kernel-module metadata, file hashes and disk images before rebuilding compromised systems.
Preventive Actions
Restrict job submission: Require authentication and authorization for Ray Jobs API access.
Segment GPU infrastructure: Isolate GPU compute nodes from public networks and restrict management-plane connectivity.
Monitor hardware telemetry integrity: Compare NVIDIA telemetry with independent hardware and application-level measurements.
Protect kernel integrity: Use secure boot where appropriate, monitor kernel-module loading and restrict unauthorized module installation.
Monitor persistence mechanisms: Alert on unexpected systemd services, DKMS registrations, initramfs changes and SSH authorized-key modifications.
Control outbound connections: Apply network policies to restrict unnecessary Tor, proxy and blockchain RPC traffic.
Use file-integrity monitoring: Monitor critical NVIDIA libraries, kernel modules, system binaries and boot-related files.
Protect AI infrastructure: Audit who can submit workloads, inspect GPU utilization patterns and investigate unexplained resource consumption.
Potential Impact
1. Unauthorized Compute Resource Consumption
The malware uses compromised CPU and GPU resources for cryptocurrency mining, reducing the capacity available for legitimate workloads.
2. Increased Infrastructure Costs
Unauthorized mining can increase electricity consumption, hardware utilization and cloud-computing expenses.
3. AI and Machine-Learning Workload Disruption
Organizations operating GPU clusters for AI training and inference may experience reduced compute availability and degraded workload performance.
4. Kernel-Level Concealment
The rootkit can hide selected processes, files and socket entries, reducing the effectiveness of ordinary host inspection.
5. Monitoring Evasion
The NVML wrapper can falsify GPU utilization, temperature and power readings, potentially delaying detection of unauthorized mining.
6. Persistent Remote Access
The combination of SSH key persistence, SANSAR's interactive shell functionality and the separate netns backdoor gives the operator multiple methods of maintaining remote access.
7. Additional Network Abuse
SANSAR includes a traffic-generation command that can initiate raw IPv4 TCP SYN tasks. This capability creates the potential for unauthorized network disruption.
Conclusion
The SANSAR intrusion demonstrates how modern Linux cryptomining operations can combine resource hijacking with advanced defense-evasion techniques.
The attacker exploited an exposed Ray job agent to gain initial access, established SSH persistence and deployed a toolkit across three Linux GPU hosts.
The most significant aspect of the operation is the coordinated concealment mechanism. The acpi_thermal_mgr.ko kernel rootkit hides processes, files and network sockets, while the modified NVML library falsifies GPU telemetry to report 0% utilization.
SANSAR manages CPU and GPU miners over Tor, while the separate netns backdoor uses an Ethereum smart contract to discover its controller address.
For organizations operating GPU infrastructure, particularly AI and machine-learning environments, this incident highlights the importance of securing workload-submission interfaces and independently validating hardware monitoring data.
A GPU reporting 0% utilization is not necessarily idle. When the monitoring layer itself is compromised, the underlying hardware and operating-system evidence must be examined independently.
