Honeypot capture

mirai

C2 verifiedProtocol documented

Executive summary

sample.bin is a DDoS bot and worm of the Mirai lineage that reaches its operator over raw TCP at addresses stored in the file. It is a 108,016-byte ELF executable for 32-bit ARM, captured by a honeypot sensor network and read as data, never executed, and no recovered address was contacted.

ARM here means the processor family found in routers, cameras and other embedded devices. That hardware is rarely patched, rarely monitored and permanently online. A DDoS bot enrols such a machine into a fleet that floods a target with traffic on command, renting the victim’s bandwidth to the operator. A worm spreads on its own, copying itself to further machines with no user action.

The family identification follows from how the recovered pieces fit together, namely the seven-entry method table, the canonical Mirai attack descriptor [duration][vector][targets: ip/prefix][options] parsed at sub_a8e8, the credential scanner reporting to a loader host, the busybox-staged second payload, and the Mirai anti-OOM and process-killer hygiene. The strings /bin/busybox, assword and ncorrect are diagnostic of the family and are carried by its builds. Two things diverge from stock Mirai: the configuration string table is encrypted with a custom RC4-variant where stock Mirai uses a single-byte 0x22 XOR, and the command channel runs under ChaCha20 with XXTEA-wrapped per-session keys where stock Mirai speaks plaintext. Kinryu Labs assesses the family at 0.85 confidence.

Sample at a glance

PropertyObserved value
Familymirai
TypeDDoS bot, worm
File typeELF 32-bit LSB executable, ARM, EABI4 version 1 (SYSV), statically linked, stripped
Platformlinux / arm, 32-bit, little-endian
Size108,016 bytes
SHA-2567619b5aba6a23f92ce022261c8b019f19d3db182e9e11d093e6e201ea484ee02
SHA-1528d739b8b6cb02090f34c9510e6301ad1f88746
MD5f1560304979cd5e6739946e4962a98ad
Packingnone
Privilege neededuser
Command and controlraw TCP, 1 operator host stored in the file

Recovered endpoints

Table 1: Four recovered endpoints, three of them on the operator’s two hosts Host strings and roles read from the static image and independently confirmed by Ghidra. Kinryu Labs recorded each value in the Conf column, and the STUN row carries none.

ValuePortProtoRoleVAConfVerified
order[.]cozykoala[.]st2052–16387 (random)TCPprimary C20x211000.92no
street[.]cozykoala[.]st14296–63487 (random)TCPloader / report0x211140.85no
street[.]cozykoala[.]st/dlr.[arch]80HTTPloader fetch0xf5300.80yes
stun[.]l[.]google[.]com19302UDPpublic STUN bootstrap0x21128—yes

Binary Ninja’s annotation on the primary C2 string reads:

decrypted ‘order.cozykoala.st’ with the position-indexed keystream of key 0x2169c — Binary Ninja @ 0x21100

Both port ranges live in the same custom-encrypted config as the host strings, and their numeric table bytes were not statically decoded. Ghidra confirmed the hosts and their roles and marked the port sub-claims unverifiable. The two host rows are unverified overall. The loader fetch appears to use a fixed tcp/80, read from the verified row at 0xf530, distinct from the table-driven primary channel.

order[.]cozykoala[.]st also appears in one other analysed capture. The same host reused across separate captures ties them to one operator’s infrastructure and puts this sample in a wider campaign.

The STUN contact goes to a shared service rather than to one of the operator’s own hosts. The sample sends a standard binding request to Google’s public STUN server, with magic cookie 0x2112A442 confirmed at 0x133a0, and reads its public address back from an XOR-MAPPED-ADDRESS field (var_20 ^ 0x42a41221). Blocking that server would not disrupt the operator and could break legitimate traffic.

The encrypted command channel

The command channel is one long-lived raw TCP connection. The bot opens the socket at 0xcfdc with sub_16408(2, 1, 0) /* socket(AF_INET, SOCK_STREAM, 0) */, sets it non-blocking, and drives it with a poll() loop at 0xd17c. On teardown the bot sleeps one second and reconnects at 0xd2d8. There is no interval beacon and no kill switch.

Each frame carries a two-byte big-endian length prefix, byteswapped explicitly at 0xd7fc, and the bot assembles a body of at most 0x2000 bytes at 0xd7d8. A frame whose length is zero is a keepalive. The body is ChaCha20, 20 rounds, with the sigma constant expand 32-byte k at 0xae74 and quarter-round rotates of 16/12/8/7, XORed in place at 0xabfc. The 32-byte key and 12-byte nonce are generated fresh per connection and carried in the registration message, with the block counter starting at 1. That session key is wrapped in XXTEA — delta 0x9e3779b9 at 0x14424 and 0x14510 — under the static 16-byte ASCII key MomGetTheCamera! at 0x20458, and the registration carries an HMAC-SHA256 tag keyed with the session key, built at 0xb08c. All three layers were confirmed by Ghidra.

The protocol spec documents two message types, and three test vectors round-trip through the recovered dissector. The format is understood well enough to decode live traffic. One piece of the handshake is not yet byte-exact: the outer encoding applied by sub_14118 and sub_141bc around the XXTEA-wrapped key blob. The XXTEA core and its static key are recovered. A defender who isolates the wrapped-key field can still unwrap it, but fully automated key recovery from a raw registration capture waits on that framing.

The seven flood handlers

Seven opcodes index the method table at 0x2a0e4, dispatched at 0xa8a0, and all seven handlers were confirmed by Ghidra reading the table bytes directly: 0xa3a8 a UDP flood over a raw IP_HDRINCL path, 0xa0dc a UDP/VSE-style flood, 0x9d98 a UDP variant, 0x9680 a TCP flood with crafted flags, 0x87f0 and 0x8290 further TCP variants, and 0x8e70 a TCP/STOMP-style flood that opens a real connection before flooding — the largest handler at 2,056 bytes. Ghidra confirmed the handlers as flood code, but the static read covered the per-vector packet construction only at summary depth.

The spreading path

The scanner at sub_f73c — the largest function in the image at 7,184 bytes — sweeps telnet and drives a credential state machine at sub_f1c4, and the bot sends each successful login to the second host in the format visible in the send call:

sub_1627c(result, &var_21, 1, 0x4000); ... send \x00|ip(4)|port(2)|ulen|user|plen|pass /* harvested-login report to entry 2 */ — Binary Ninja @ 0xf38c

From there the loader at 0xf530 issues GET /dlr.[arch] HTTP/1.0 with User-Agent Wget and no Host header, then writes and executes the stage through /bin/busybox echo -ne ... at 0xf604.

Anti-OOM hardening and the process kill list

At 0xcec4 the sample opens /proc/self/oom_score_adj and /proc/self/oom_adj from config entries 0x10 and 0x11 and writes -1000 (entry 0x13) and -17 (entry 0x12). Those writes make the kernel OOM killer spare the process. It then walks /proc and kills processes named in config entry 7, which decrypts to a list running from init and systemd through telnetd to mini_httpd. Kinryu Labs records 0.70 confidence for that process-kill behaviour, inferred from the config entry at 0x21230.

The config cipher and the sandbox blocklist

Config entry 8 holds a blocklist of VM, sandbox and analysis-tool names — qemu, virtualbox, vmware, cuckoo, joebox, anubis, fireeye, virustotal, wireshark, tcpdump — checked at 0x21450. A defender running this sample in an off-the-shelf sandbox should expect less of its behaviour to be visible.

The custom RC4-variant at 0x11c40 (arithmetic S-box fill, RC4 key schedule, five LCG rounds, LFSR-masked keystream output) decrypts one config entry at a time and re-encrypts it after use. Plaintext for an entry never persists in memory between uses. The annotation on the C2-host retrieval names the decryption and re-encryption addresses:

char* r0_42 = sub_11c0c(1, nullptr) /* retrieve config entry 1 = C2 host, unlocked at 0xcffc, re-locked 0xd0f4 */ — Binary Ninja @ 0xd010

Config entry 6 decrypts to an operator banner, written to stdout at 0xce64: all u mfkers viva mexicooo — sample-derived data, quoted here as an attribution signal.

Runtime requirements

The sample needs only user privilege for its core function, and the process-kill and OOM-adjust paths work best as root. The binary is statically linked, with no shared-library or interpreter dependency. The network requirements are outbound TCP to the two cozykoala.st hosts, outbound udp/19302 for STUN, and outbound tcp/23 and tcp/2323 for telnet scanning; denying any one of them blocks that path.

Host indicators

Table 2: The five indicators recorded for this sample Values and virtual addresses read from the static image; busybox in a process list exists only while the sample runs, so finding it marks a live infection rather than a past one.

KindValueContextVAConf
file/proc/self/oom_score_adjOOM-killer evasion0x213580.85
file/proc/self/oom_adjOOM-killer evasion0x213740.85
filedlr.[arch] (arm4, arm5, arm7, mips, mpsl)second-stage payload path from the loader host0x20fd80.80
process_namebusyboxstage execution0xf6040.75
user_agentWgetloader HTTP request0xf5780.90

The file hashes to SHA-256 7619b5aba6a23f92ce022261c8b019f19d3db182e9e11d093e6e201ea484ee02, SHA-1 528d739b8b6cb02090f34c9510e6301ad1f88746 and MD5 f1560304979cd5e6739946e4962a98ad, which a defender can use to pivot to the same sample in other repositories and sandboxes.

What static analysis did not settle

The outer encoding at sub_14118 and sub_141bc was not mapped to byte exactness, and the per-vector packet construction for the seven flood handlers was read only at summary depth. Runtime questions remain open, including the addresses the primary C2 host currently resolves to, whether it still answers on the recovered port, and the timing, retry and post-execution behaviour the sample shows.

Supported commands

CommandHandlerOperation
0x000xa3a8attack vector 0: UDP flood (socket(2,2,0)=SOCK_DGRAM, IP_HDRINCL raw path; IPPROTO 0x11=UDP)
0x010xa0dcattack vector 1: UDP/VSE-style flood (IPPROTO 0x11, SOCK_DGRAM)
0x020x9d98attack vector 2: UDP flood variant (IPPROTO 0x11)
0x030x9680attack vector 3: TCP flood with crafted flags (builds TCP header, option bytes 2..18/0x11/0x12)
0x040x87f0attack vector 4: TCP flood variant (TCP header builder, flag options 0x11/0x12)
0x050x8e70attack vector 5: TCP/STOMP-style flood (largest handler, 2056 B; opens a real connection via sub_15f74 then floods, option set 2..0x13)
0x060x8290attack vector 6: TCP flood variant (flag options incl. 0x13, len option 0x200)

Message formats

registration (client to server)

OffsetSizeFieldDescription
08preamblefixed handshake 00 00 00 02 43 00 00 00
8varwrapped_session_key32-byte ChaCha20 key, XXTEA-wrapped under ‘MomGetTheCamera!’ (length-tagged)
-varwrapped_session_nonce12-byte ChaCha20 nonce, XXTEA-wrapped (length-tagged)
-varfingerprint_fieldsChaCha20-encrypted host attributes (arch ‘armv7l’, /proc-derived fields), each length-tagged
-32hmacHMAC-SHA256(session_key, session_key || nonce) integrity tag

command (server to client)

OffsetSizeFieldDescription
02lengthbody length, big-endian, max 0x2000; 0 = keepalive
2varbodyChaCha20(key, counter=1, nonce) ciphertext of the attack descriptor

Command-and-control parameters

ParameterValue
Transportraw TCP
Length field2 bytes at offset 0, big-endian
Embedded cipherCHACHA20 (stream)
Key sourceruntime
Reconnect1 s, none backoff

Indicators of compromise

Network indicators

IndicatorServiceDescription
hxxp[://]street[.]cozykoala[.]st/dlr.<arch>http/80Payload host

Host indicators

IndicatorTypeDescription
/proc/self/oom_score_adjfilewritten with -1000 to evade the OOM killer (config entry 0x10/0x13) †
/proc/self/oom_adjfilewritten with -17 to evade the OOM killer (config entry 0x11/0x12) †
busyboxprocess nameloader executes the downloaded stage via ‘/bin/busybox echo -ne …’ †
Wgetuser agentloader HTTP request User-Agent (no Host header, HTTP/1.0) †
dlr.<arch> (arch in {arm4,arm5,arm7,mips,mpsl})filesecond-stage payload path requested from the loader host †

† Read from the primary disassembly only; not independently confirmed.

File indicators

IndicatorTypeDescription
7619b5aba6a23f92ce022261c8b019f19d3db182e9e11d093e6e201ea484ee02SHA-256mirai sample as captured
528d739b8b6cb02090f34c9510e6301ad1f88746SHA-1same file
f1560304979cd5e6739946e4962a98adMD5same file

Appendix: MITRE ATT&CK

IDTechniqueObserved behaviour
T1016System Network Configuration DiscoveryResolves its own public IP via a STUN binding request to stun.l.google.com:19302
T1027Obfuscated Files or InformationEntire configuration string table encrypted with a custom RC4-variant (arithmetic S-box fill + RC4 KSA + 5 LCG rounds + LFSR-masked PRGA) and re-locked in …
T1095Non-Application Layer ProtocolPersistent raw-TCP command channel to order[.]cozykoala[.]st on a random high port from the entry-4 list
T1105Ingress Tool TransferDownloads an architecture-specific second stage via GET /dlr. and executes it through ‘/bin/busybox echo -ne | busybox’
T1110.001Password GuessingTelnet scanner with a credential state machine; harvested logins reported to street[.]cozykoala[.]st
T1489Service StopScans /proc and kills rival/service processes named in entry 7 (init, telnetd, watchdog, busybox, …)
T1497.001System ChecksChecks a decrypted blocklist of VM/sandbox/analysis-tool names (qemu, virtualbox, vmware, cuckoo, joebox, anubis, fireeye, virustotal, wireshark, tcpdump, …) …
T1498Network Denial of ServiceSeven UDP/TCP flooding attack vectors selected by opcode from the method table
T1499Endpoint Denial of ServiceSeven UDP/TCP flooding attack vectors selected by opcode from the method table
T1562.001Disable or Modify ToolsWrites -17/-1000 to /proc/self/oom_adj and /proc/self/oom_score_adj so the kernel OOM killer spares it
T1573.001Symmetric CryptographyChaCha20 (20-round) stream cipher over the channel with a per-session key, framed by a 2-byte big-endian length
Family
mirai
First seen
December 1, 2026
Vector
Runs as a ddos-bot/worm; the entry vector is not established by static analysis
Format
105 KB arm ELF 32-bit LSB executable
VirusTotal
26/72 engines: trojan.mirai/ddos
Tags
arm · ddos-bot · elf · raw_tcp · worm
Sample
By request. Email security@kinryu.sh

SHA-256

  • 7619b5aba6a23f92ce022261c8b019f19d3db182e9e11d093e6e201ea484ee02 as captured

Analysis performed using an automatic malware analysis pipeline using Binary Ninja

← All captures