# SANSAR Linux Cryptomining Toolkit (REF3364) - Kernel Rootkit and NVML Wrapper Hide GPU Mining After Exposed Ray Job Agent Compromise

> Elastic Security Labs tracks REF3364, a Linux cryptomining intrusion that combines custom malware with public miners. SANSAR, a Rust miner orchestrator controlled over Tor, supervises XMRig and SRBMiner-MULTI, while a kernel rootkit and a modified NVML library hide processes, files, sockets and GPU load. Initial access was an internet-exposed, unauthenticated Ray job agent, and the actor deployed the toolkit as root across three Linux GPU hosts.

- **Author:** Threadlinqs Team
- **Published:** 2026-12-01T20:33:54Z
- **Last updated:** 2026-12-01T20:33:54Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-7209
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-7209.png
- **ID:** TL-2026-7209
- **Severity:** HIGH
- **Category:** MALWARE
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 29 (3 shown free below)
- **CVEs:** CVE-2023-48022

## Description

REF3364 is a Linux cryptomining intrusion documented by Elastic Security Labs (Salim Bitam, published 2026-11-12). The actor gained initial access through a Ray job agent that was reachable from the internet and accepted job submissions without authentication. The Ray dashboard was bound only to loopback, but the job agent was not. Ray logs show external probing on 2026-10-22, a submitted job on 2026-10-24 that ran nvidia-smi and sent the GPU inventory to an external server, and a Python reverse-shell job connecting to an external listener on 2026-10-25. Commands first ran as the local account that owned the Ray session; the actor then obtained root, added an SSH key to the session owner's authorized_keys, and deployed the toolkit across three Linux GPU hosts. The source assigns no CVE, no CVSS score and no named threat actor.

The toolkit is staged under /opt/vadi_/. SANSAR (Rust client v0.1.3) is the orchestrator. It checks TracerPid in /proc/self/status and exits if a 1,000-iteration timing loop takes 501 ms or longer. It stores its C2 domain as 62 encoded bytes (each byte rotated right by (i % 7)+1, then XORed with a repeating 32-byte mask), which decode to an onion address on port 9051. It reaches that address through Tor in two modes: direct via Arti (60-second bootstrap deadline) and bridge mode via the Lyrebird pluggable-transport helper (obfs4 and WebTunnel, 900-second deadline). The bridges file holds 7 WebTunnel and 3 obfs4 entries. SANSAR enumerates the host (nvidia-smi GPU names, /etc/hostname, /proc/cpuinfo, /proc/uptime, /proc/loadavg, who) and looks up its public IP via api.ipify.org, ifconfig.me/ip, icanhazip.com and checkip.amazonaws.com. It authenticates with a 40-byte field (8-byte big-endian timestamp plus HMAC-SHA256 over client ID and timestamp) and uses a binary protocol with command IDs 0-15. Those commands cover interactive shells (/bin/bash --norc --noprofile in a PTY with HISTFILE=/dev/null), miner start/stop/config (miner_type 0 = GPU via tilki/SRBMiner-MULTI 3.6.9, 1 = CPU via kurt/XMRig 6.25.0), and StressStart/StressStop raw IPv4 TCP SYN floods. Pool and wallet details come from the C2 with no hardcoded fallback.

Stealth is provided by two components. acpi_thermal_mgr.ko is a Linux ftrace-based kernel rootkit, built from /usr/src/acpi_thermal_mgr-1.0/acpi_thermal_mgr.c (source contains Turkish comments), installed through DKMS with an initramfs loader so it reloads at boot. It hooks getdents/getdents64, open/openat, kill and TCP/UDP socket-listing routines, hides the process names kurt and lyrebird by default, and can optionally hide itself from the module list and sysfs. A modified libnvidia-ml.so.1 (source in /opt/vadi_/nvml-hook/) wraps the genuine NVML library but always reports 0% GPU utilization and randomizes temperature (36-46 C) and power (100-200 W); the original is kept and a backup is created at /usr/lib/.libnvidia-ml.so.1.backup. A separate backdoor, netns, runs as a systemd service. It sends eth_call requests over HTTPS to public Ethereum RPC services against contract 0x43eb291f56688c63c93e8a93c4591fc997cf6349 (selector 0x6ded96e7), decodes an IPv4 address from the result, connects to it over TCP port 8080, and accepts an unauthenticated text command SHELL <host> <port> that forks Bash to a specified listener.

The article does not disclose mining pool or wallet addresses, C2 IPv4 addresses, Ethereum RPC providers, bridge addresses, the HMAC key, the reverse-shell listener or victim host names, so none are included as IOCs. No network IP IOCs exist to correlate against BeaconBeagle. Elastic ships YARA rules Linux_Trojan_Sansar_11eea454 and Linux_Trojan_Netns_c94a4b17. Severity HIGH is an analyst judgment (root compromise, kernel rootkit, GPU compute hijack, falsified telemetry); it is not stated in the source.

## MITRE ATT&CK

- T1190 Exploit Public-Facing Application
- T1059.006 Python
- T1059.004 Unix Shell
- T1098.004 SSH Authorized Keys
- T1543.002 Systemd Service
- T1547.006 Kernel Modules and Extensions
- T1014 Rootkit
- T1622 Debugger Evasion
- T1027 Obfuscated Files or Information
- T1140 Deobfuscate/Decode Files or Information
- T1690 Prevent Command History Logging
- T1082 System Information Discovery
- T1611 Escape to Host
- T1136.001 Local Account
- T1078.003 Local Accounts
- T1021.004 SSH
- T1685.006 Clear Linux or Mac System Logs
- T1090.003 Multi-hop Proxy
- T1102.001 Dead Drop Resolver
- T1095 Non-Application Layer Protocol
- T1496.001 Compute Hijacking
- T1498.001 Direct Network Flood

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**REF3364 SANSAR - Tor/Lyrebird Onion C2, netns Ethereum Dead-Drop Controller and Miner Network Activity** (`TL-2026-7209-SPL-003`)

Detects SANSAR and netns command-and-control network behavior on Linux hosts. It covers connections to the .onion C2 on port 9051 (efxisnqldelyr5ra25oqfrsut54b34g26e7zrsiuupsoekjof2gho2id.onion) from /opt/vadi_/ binaries, Lyrebird pluggable-transport egress, public-IP lookups (api.ipify.org, ifconfig.me, icanhazip.com, checkip.amazonaws.com) made by toolkit binaries, the netns backdoor connecting to its Ethereum-derived controller on TCP 8080, and miner binaries (kurt, tilki) making network connections.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1090.003, T1102.001, T1095, T1496.001, T1016
- **Data sources:** sysmon_for_linux, microsoft_defender_for_endpoint_linux, linux_network_connection
- **Severity:** high
- **Confidence:** high

### Splunk SPL

```spl
index=linux sourcetype="sysmon:linux" EventID=3 Initiated=true
| eval proc=lower(Image), dhost=lower(coalesce(DestinationHostname,""))
| eval c2_signal=case(
    match(dhost,"\.onion$") OR (DestinationPort=9051 AND match(proc,"/opt/vadi_/|/sansar")),"sansar_onion_c2",
    match(proc,"/lyrebird$"),"lyrebird_pluggable_transport_egress",
    match(proc,"/opt/vadi_/|/arti_data/") AND match(dhost,"^(api\.ipify\.org|ifconfig\.me|icanhazip\.com|checkip\.amazonaws\.com)$"),"sansar_public_ip_lookup",
    match(proc,"/netns$") AND DestinationPort=8080,"netns_controller_8080",
    match(proc,"/netns$") AND DestinationPort=443,"netns_ethereum_rpc_https",
    match(proc,"/(tilki|kurt)$"),"miner_process_network",
    true(),null())
| where isnotnull(c2_signal)
| stats count min(_time) as first_seen max(_time) as last_seen values(DestinationPort) as dest_ports values(dhost) as dest_hosts values(DestinationIp) as dest_ips by host, Image, c2_signal
| convert ctime(first_seen) ctime(last_seen)
```

### Microsoft KQL

```kql
DeviceNetworkEvents
| where Timestamp > ago(24h)
| where ActionType in ("ConnectionSuccess", "ConnectionRequest")
| extend Proc = tolower(InitiatingProcessFolderPath)
| extend Signal = case(
    RemoteUrl endswith ".onion" or (RemotePort == 9051 and Proc contains "/opt/vadi_/"), "sansar_onion_c2",
    Proc endswith "/lyrebird", "lyrebird_pluggable_transport_egress",
    (Proc contains "/opt/vadi_/" or Proc contains "arti_data") and RemoteUrl has_any ("api.ipify.org", "ifconfig.me", "icanhazip.com", "checkip.amazonaws.com"), "sansar_public_ip_lookup",
    Proc endswith "/netns" and RemotePort == 8080, "netns_controller_8080",
    Proc endswith "/netns" and RemotePort == 443, "netns_ethereum_rpc_https",
    Proc endswith "/tilki" or Proc endswith "/kurt", "miner_process_network",
    "")
| where Signal != ""
| project Timestamp, DeviceName, Signal, RemoteIP, RemotePort, RemoteUrl, InitiatingProcessFolderPath, InitiatingProcessCommandLine, InitiatingProcessAccountName
```

### Sigma

```yaml
title: REF3364 SANSAR - Tor/Lyrebird Onion C2, netns Controller and Miner Network Connections
id: c41e8b03-7f26-4d9a-a5b1-0d3e9f6a7c28
status: experimental
description: Detects SANSAR and netns command-and-control network connections on Linux. These are toolkit binaries under /opt/vadi_/ connecting to Tor port 9051 or to public-IP lookup services, Lyrebird pluggable-transport egress, the netns backdoor connecting to its controller on TCP 8080, and the kurt/tilki miners making network connections.
references:
    - https://www.elastic.co/security-labs/threat-command/sansar-linux-cryptomining-malware
author: Threadlinqs Team
date: 2026-12-01
tags:
    - attack.command-and-control
    - attack.t1090.003
    - attack.t1095
    - attack.t1102.001
    - attack.impact
    - attack.t1496.001
logsource:
    category: network_connection
    product: linux
detection:
    selection_onion_c2:
        Initiated: 'true'
        Image|contains: '/opt/vadi_/'
        DestinationPort: 9051
    selection_onion_host:
        DestinationHostname|endswith: '.onion'
    selection_lyrebird:
        Initiated: 'true'
        Image|endswith: '/lyrebird'
    selection_ip_lookup:
        Image|contains: '/opt/vadi_/'
        DestinationHostname:
            - 'api.ipify.org'
            - 'ifconfig.me'
            - 'icanhazip.com'
            - 'checkip.amazonaws.com'
    selection_netns:
        Image|endswith: '/netns'
        DestinationPort: 8080
    selection_miner:
        Initiated: 'true'
        Image|endswith:
            - '/tilki'
            - '/kurt'
    condition: 1 of selection_*
falsepositives:
    - Legitimate Tor or obfs4 bridge clients on hosts where Tor use is approved
    - Unrelated binaries named netns, kurt or tilki
level: high
```

**Known false positives:**

- Legitimate Tor or obfs4 bridge clients on hosts where Tor use is approved
- Unrelated binaries that happen to be named netns, kurt or tilki

**Tuning notes:** Rootkit process hiding (kurt, lyrebird) can hide these processes from host tools, so also alert on egress from GPU hosts to Tor and pluggable-transport infrastructure at the network layer. The netns Ethereum eth_call contract 0x43eb291f56688c63c93e8a93c4591fc997cf6349 (selector 0x6ded96e7) is only visible with TLS inspection, so search proxy bodies for it if you have them. Public-IP lookups are legitimate, so keep them tied to toolkit paths. The research disclosed no C2 IPs, pool or wallet addresses, so no IP blocklist is included. TL_OSINT_Scan found no community-corroborated sibling indicators for this threat.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- REF3364 SANSAR - Ray Job Agent Child Process Reverse Shell and History-Suppressed Shell (KQL) (locked: unlock with TL Creds)
- REF3364 SANSAR - Kernel Rootkit, NVML Hook, netns Service and SSH Key Persistence (KQL) (locked: unlock with TL Creds)
- REF3364 SANSAR - Onion C2, Lyrebird Egress, netns Controller Connection and Miner Traffic (KQL) (locked: unlock with TL Creds)
- REF3364 SANSAR - Ray Job Supervisor Spawning nvidia-smi Inventory or Reverse Shell (Sigma) (locked: unlock with TL Creds)
- REF3364 SANSAR - Rootkit, NVML Wrapper, netns Service and Toolkit Staging File Artifacts (Sigma) (locked: unlock with TL Creds)
- REF3364 SANSAR - Toolkit Tor Port 9051, Lyrebird Egress and Public-IP Lookup Connections (Sigma) (locked: unlock with TL Creds)
- REF3364 SANSAR - Ray Job Agent Spawning GPU Inventory or Reverse Shell (Exploitation) (locked: unlock with TL Creds)
- REF3364 SANSAR - Rootkit DKMS Module, NVML Backup, netns Service and SSH Key Persistence (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (3 of 29)

Defanged, TLP:CLEAR.

- Domain: `efxisnqldelyr5ra25oqfrsut54b34g26e7zrsiuupsoekjof2gho2id[.]onion`
- File hash: `00c9ac44291f83c72d54302e99d155a3e26d02225a3e516764d5833a99657c9e`
- Domain: `api[.]ipify[.]org`

Full set of 29 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [0% GPU utilization: How SANSAR hides Linux cryptomining (Elastic Security Labs, Salim Bitam)](https://www.elastic.co/security-labs/threat-command/sansar-linux-cryptomining-malware)
- [PHANTOMPULSE: anatomy of a hijackable blockchain-C2 RAT (Elastic Security Labs)](https://www.elastic.co/security-labs/threat-command/blockchain-c2-phantompulse-rat-sinkhole)
- [ShadowRay: AI workloads actively exploited in the wild (Oligo Security)](https://oligo.security/blog/shadowray-attack-ai-workloads-actively-exploited-in-the-wild)
- [CVE-2023-48022 - Ray Jobs API missing authentication (NVD)](https://nvd.nist.gov/vuln/detail/cve-2023-48022)
- [ShadowRay vulnerability on Ray framework exposes thousands of AI workloads (VentureBeat)](https://venturebeat.com/security/shadowray-vulnerability-on-ray-framework-exposes-thousands-of-ai-workloads-compute-power-and-data/)
- [Thousands of firms vulnerable to security bug in Ray AI (The Register)](https://www.theregister.com/security/2024/03/27/thousands-of-firms-vulnerable-to-security-bug-in-ray-ai/779533)
- [Ray security documentation (Anyscale)](https://docs.ray.io/en/latest/ray-security/index.html)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-7209
