Honeypot capture

xmrig

C2 verifiedProtocol documented

The pipeline statically recovered five command-and-control endpoints (command and control is the channel an infected machine uses to reach its operator for instructions) from a 9,832,024-byte x86-64 ELF sample caught by a honeypot sensor network, and all five are the upstream project’s own infrastructure. For a defender, the usable output is the sample hashes, the host file paths a mining run touches and the XMRig/6.26.0 user-agent; the operator’s pool, wallet and worker credential are not in the file. The five endpoints are donate[.]ssl[.]xmrig[.]com, donate[.]v2[.]xmrig[.]com, api[.]xmrig[.]com, the loopback address 127[.]0[.]0[.]1 on which an optional HTTP API binds, and the default pool stratum+ssl[://]randomx[.]xmrig[.]com:443, all written defanged. Four of the five carry an agreement verdict from a second, independent decompiler backend.

The analysis is static only, in that the pipeline read the sample as data throughout and contacted or resolved no recovered endpoint, and no capture of this sample’s traffic was available in this container. The consensus round with the second backend covered the C2 mechanism claims — endpoints, transport, framing, crypto, commands and protocol — rather than the capability taxonomy, so the agreement verdicts concentrate on the protocol.

The sample self-identifies as XMRig 6.26.0 at 0xada39e, with sole xref 0x4ec988, and is a build of that open-source Monero/RandomX miner, a cryptominer that hijacks the machine’s CPU or GPU to mine cryptocurrency for the operator. It is statically linked and stripped, with musl, libstdc++, OpenSSL 3.0.16, libuv and hwloc compiled in and zero dynamic imports. The findings describe the victim as paying in electricity and hardware wear while the mined coins and the pool credit go to the attacker. The behaviour maps to ATT&CK T1496, Resource Hijacking, at confidence 0.95. main at 0x49d630 reproduces upstream XMRig’s documented seven-call shape — Process → Entry::get → App::App → App::exec → App::~App → Process::~Process — and App::exec at 0x5ea710 its ten-step body, including the verbatim literals no valid configuration found, try hxxps://xmrig[.]com/wizard and the dry-run OK line. The donate feature is intact and reachable at 0x608fb0. The analysis looked for persistence, injection, a dropper (a program that writes another program to disk and runs it), a second payload and an embedded operator config, and found none of them.

The sample carries no operator configuration. The operator’s pool host and port, the wallet, and the worker credential are supplied by config.json, argv, or an API PUT. The analysis searched 105,145 strings and found zero Monero addresses, no embedded config blob, and no high-entropy region, meaning no region whose byte randomness would indicate compression or encryption hiding a config.

Binary Ninja VAs at image base appear in the prose, and quoted tool output is at ELF base-0, where elf = binja − 0x400000, so a quotation reads 0x209191 where the prose cites 0x609191.

The recovered Stratum wire format

The C2 channel is the Stratum mining protocol, a persistent TCP connection carrying newline-delimited JSON-RPC. The sample speaks two dialects, Stratum v1 (mining.*) and Monero JSON-RPC 2.0 (login/job), and shares one client.reconnect handler across three C++ vtables with identical layout (0xd30530, 0xd30610, 0xd30798). The client wraps the stream in optional TLS and writes one compact JSON object per line, terminating each line with a single 0x0a at 0x4f9d9e, mov byte [rax+rbx], 0xa, with written length json_len + 1. The sample uses no magic value, no length prefix and no compression. The receive guard is a length greater than 21 and a first byte of { (0x4fa01e). Five URL schemes are byte-confirmed in the table at 0xb126b0: stratum+tcp://, stratum+ssl://, socks5://, daemon+http://, daemon+https://. Default port is 3333 (0x517660), and on connect the client sets TCP_NODELAY and SO_KEEPALIVE with a 60-second idle. All network I/O happens inside one uv_run(uv_default_loop()) at 0x5ea851, so the client is event-driven.

The sample can wrap the channel in TLS using the statically linked OpenSSL 3.0.16, selected by the stratum+ssl:// scheme (confidence 0.90), but the same scheme table offers plaintext stratum+tcp://, and the send path at 0x4f9ca0 applies no encryption or encoding of its own — crypto.algorithm = none, confirmed in the consensus round. There is no bespoke cipher in the transport and no key to recover, so plaintext Stratum from this sample is readable off the wire as it stands. r2 /ck located four cryptographic constant tables, and they belong to OpenSSL and to XMRig’s own mining code. 0xb0fa80 holds the SHA-256 and SHA-224 IV pair, 0xb5d640 holds BLAKE-256 with its consumer at 0x61d300, and 0xba3560 holds Blowfish, with consumer 0x91b960 and an independent capa match. The table at 0xba10e0 matched a known constant table that the analysis could not pin to an algorithm. Its consumer’s call path makes it OpenSSL’s, and the bytes ruled out SHA-512-family, SM3, Camellia, BLAKE and Whirlpool, so the profile records its identity as an open question.

The server can move the client to a different endpoint. A client.reconnect notification relocates the session to an arbitrary new host and port, and validation at 0x4f9ff0 is structural only, with no allowlist and no comparison against the configured pool (confidence 0.90), so the endpoint observed on the wire is not a stable indicator. An embedded HTTP server accepts the same change on an inbound connection. It routes /1/config and /2/config at 0x4e09c0, where GET returns the live configuration and method 4 (PUT), or 3 on the same paths, replaces it, pool endpoint included (T1071.001, confidence 0.88). It is bearer-token authenticated via an access-token key, gated by a restricted flag, and disabled by default.

Table 1: The Stratum methods and their handlers. Methods and handler VAs recovered by decompilation and confirmed in the second-backend consensus round. The table lists twelve methods, each with its direction, its handler VA and its behaviour; the findings document eight protocol messages and six C2 commands at field level.

MethodDirectionHandlerBehaviour
mining.notifyserver→client0x537d80push a work unit
mining.set_difficultyserver→client0x537d80target = int(difficulty × 65536)
mining.set_targetserver→client0x537d80set target directly
mining.set_extranonceserver→client0x537d80rotate extranonce
client.reconnectserver→client0x4f9ff0relocate to arbitrary host:port, no allowlist
jobserver→client0x4f9ff0Monero-dialect work dispatch, on the same shared handler as client.reconnect
mining.subscribeclient→server0x539690session establishment
mining.authorizeclient→server0x5399b0worker and wallet credential cross the wire
mining.submitclient→server0x53a400submit a share
mining.extranonce.subscribeclient→server0x5393c0opt into rotation
loginclient→server0x4f8b30Monero JSON-RPC auth
keepalivedclient→server0x4f4d60keepalive, an XMRig extension

Five synthesised test vectors replay through the recovered dissector, where the keepalived frame is the verbatim literal at 0xaf71b0 and the pipeline built the rest with the recovered framing and then round-tripped them. The vectors therefore exercise the dissector against bytes taken from the same binary, which the findings describe as self-consistency rather than proof against captured traffic, so “can decode a capture” should be read as “replays the derived vectors.” The wallet and worker credential cross the wire only in the mining.authorize params[0] field or the Monero login message, handled at 0x5399b0 and 0x4f8b30.

The recovered endpoints

The pipeline read the two donate endpoints out of the donate-strategy constructor at 0x608fb0:

fn 0x608fb0 size=977 callers=['0x603730'] -- the donate-strategy constructor; adds two pool entries

pointer 0xadcd53; memory.read 0xadcd53 -> 'donate.ssl.xmrig.com'

sub_50b7b0(rdi_7, data_d59c58, 0x1bb, &arg1[4], nullptr, nullptr, 0, 1, 1, 3)

pointer 0xadcd68; memory.read 0xadcd68 -> 'donate.v2.xmrig.com'

sub_50b7b0(rdi_8, data_d59c60, 0xd05, &arg1[4], nullptr, nullptr, 0, 1, 0, 3)

Read as ports, the third operands 0x1bb and 0xd05 give 443 and 3333, the ports the profile tabulates for the two donate pools. The findings report a host that resolves donate[.]v2[.]xmrig[.]com as running XMRig and treat the resolution as a useful detection. Blocking it does not reach the operator’s pool, because the operator’s pool host and port are supplied by config.json, argv, or an API PUT. The profile classifies the five endpoints as mining_pool, telemetry and private_reserved, and holds them out of the active blocklist for that reason.

The two backends read the fifth endpoint differently. Binary Ninja took stratum+ssl[://]randomx[.]xmrig[.]com:443 (0x4eb2ac, from the quoted lea rcx, [rel 0xaf5260]) as help-text documentation; Ghidra took it as the default pool URL substituted during config construction. Re-reading the bytes settles it in Ghidra’s favour, because 0x4ea420 references only this string and is reached from App::App at 0x5ea0e0, the config path. Both backends agreed it is an upstream mining pool.

The analysis ruled out nicehash.com at 0xada6e2 as C2, because it has zero code xrefs and sits in the pool config-key table beside the nicehash boolean, which makes it an auto-detect comparison value.

A byte sweep of the file found 15 network indicators the curated profile does not list, including 1[.]101[.]3[.]4, 1[.]3[.]101[.]110, 1[.]3[.]101[.]111, 1[.]3[.]101[.]112, 1[.]3[.]101[.]113 and 1[.]3[.]111[.]2. The addresses are routable and present in the bytes, and the profile records them as unconfirmed leads because they are absent from the curated endpoint set. The deep-static phase reported that the sample carries the string signature of the gafgyt family, the literal PING\0.

Privileged tuning and host artefacts

The sample runs with only user privilege, and it needs DNS and outbound TCP on 3333 for default stratum+tcp, on 443 for stratum+ssl and for api[.]xmrig[.]com, and on whatever host and port the operator configured. The pool connection can also be routed through a SOCKS5 proxy, selected by a socks5:// URL scheme (T1090, confidence 0.85).

The optional performance features require root and touch several kernel interfaces. The sample writes model-specific registers through /dev/cpu/{cpu}/msr for prefetcher tuning, checks /sys/module/msr/parameters/allow_writes first, requests hugepages for the RandomX dataset by writing /proc/sys/vm/nr_hugepages, and reads the SMBIOS/DMI table from /dev/mem when the sysfs path is unavailable. Beyond root, they need the msr kernel module, and they leave the host artefacts listed in Table 2. The findings state that a defender can detect the /dev/mem read and the MSR writes on a server that is not deliberately mining. The sample also performs detailed host fingerprinting (T1082, confidence 0.90), covering CPU topology via hwloc 2.12.1, motherboard and per-DIMM inventory, hugepages state, battery and AC status, and hypervisor presence, all exposed over the HTTP API at /2/dmi and /2/backends.

Table 2: The host artefacts a mining run leaves behind. Paths referenced or written on the host during execution, plus the login agent field, with the VA of the referencing code and the profile’s confidence. None were independently verified by the second backend.

ArtefactContextVAConfidence
/dev/memSMBIOS/DMI read, needs root0x612cc00.90
/dev/cpu/{cpu}/msrMSR prefetcher tuning, needs root0x6ef4d00.90
/sys/module/msr/parameters/allow_writeschecked before MSR writes0x6ef5c00.90
/proc/sys/vm/nr_hugepageshugepage request, needs root0x61c8100.90
/sys/firmware/dmi/tables/DMImotherboard and DIMM inventory0x612cc00.90
/sys/class/power_supply/BAT{n}/statuspause-on-battery0x61beb00.85
/proc/self/exeself-path for data dir and --background re-exec0x9456d00.80
/sys/bus/pci/dri/drivers/amdgpu/AMD GPU backend detection——
XMRig/6.26.0login agent field, reconstructed0x4f8fab0.60

The pipeline located the agent field but did not trace its assembled value through fmtlib, so the client tool uses a reconstructed XMRig/6.26.0 string.

A --background mode detaches the process with setsid (0x61c370), and no persistence is installed, so the process does not survive a reboot on its own. uv_spawn at 0x9388f0 sits in the linked libuv with no caller anywhere in XMRig’s address range, and the profile records process renaming and masquerading names as further negative findings. Any campaign running it supplies persistence from a separate component.

Publishable indicators

The file carries SHA-256 9d7b6ee78235af4879784a1f3f438b3d1564fc8787ad2f449f628e7b73b51949, MD5 fdf3f419921289e57758215bd85b518b, SHA-1 a0028eefae2190719842d4ef32ef879fd44b8791, and ssdeep 196608:UXhiJVd36ym2YhzpLJPGUdAjp/Su+G/s:pVd36yhYxVAV/Su+. An ssdeep hash stays similar under small edits, so near-identical variants of this build match each other. The publishable indicators are those hashes, the host file paths above and the XMRig/6.26.0 user-agent.

Whether this build differs from upstream

The analysis has not established whether this build differs in code from upstream XMRig 6.26.0, and it has not followed the restricted check’s virtual call to settle whether PUT /*/config is reachable with no access-token configured.

Family
xmrig
First seen
November 14, 2026
Vector
Runs as a cryptominer; the entry vector is not established by static analysis
Format
9602 KB x86_64 ELF 64-bit LSB pie executable
VirusTotal
31/75 engines: miner.bitcoinmi/xmrig
Tags
cryptominer · elf · raw_tcp · x86_64
Sample
By request. Email [email protected]

SHA-256

  • 9d7b6ee78235af4879784a1f3f438b3d1564fc8787ad2f449f628e7b73b51949 as captured

Analysis performed using an automatic malware analysis pipeline using Binary Ninja

← All captures