The Countermeasure: Detecting and Cutting the Raspberry Worm
The Raspberry Worm โ Part 7
Classification: HIGH ยท Confidence: HIGH (first-party, live)
Six letters have taken the Raspberry Worm apart: the drop, the self-propagation, the public-IRC command channel, the operator's signing key, the conscripted victims, and the rivals it evicts. This one puts the pieces back together for the only purpose that finally matters to a defender โ stopping it. It is a detection-and-response deliverable, and it is not academic. As this letter was being written, the honeypot logged pi:raspberry login attempts timestamped within the same minute, from a rotating set of source addresses, several per minute, each a one-to-three-second scp-push. The worm is not a case study being autopsied. It is arriving right now, at this sensor and countless others, and everything below is meant to be deployed today.
The organising principle comes from Part 4, and it is worth stating first because it determines the shape of everything that follows: detect and correlate on what the operator cannot cheaply change, not on what they change every drop. Part 4 showed the same worm produce thirteen file hashes in four months while its RSA command-signing key never moved. A defence built on hashes is a treadmill; a defence built on the key and the channel holds. So the controls here are ordered by durability โ the network cut first, the key-based detection second, the perishable indicators last and labelled as such.
Every control interrupts a different stage
The value of assembling the whole package, rather than picking one indicator, is that the worm's life has distinct stages and a defence that interrupts any of them stops the infection there. Laid against the worm's own kill chain, the controls form a layered defence in which no single evasion is fatal to the defender:
- Propagation โ the worm reaches a host by guessing
pi:raspberry. Interrupted by: changing the default password (the root prevention), and detected by credential-monitoring at the door. - Delivery โ it pushes itself in over
scpin a sub-three-second session. Interrupted by: disabling password SSH / the scp-then-execute behavioural alert. - Execution โ the dropped script runs and unpacks. Interrupted by: the YARA rule on the operator key, which flags the file whatever its hash.
- Persistence โ it installs to
/opt,rc.local, andauthorized_keys, and locks thepipassword. Interrupted by: the host-IOC sweep for those specific artifacts. - Command-and-control โ it beacons to
#bireton UnderNet 6667. Interrupted by: the egress cut and the IDS signature โ the layer that works even if every earlier layer was missed.
That last property is what makes the package robust: the stages are ordered in time, and the C2 cut sits at the end, so even a host that a defender never caught being infected is still severed from its operator the moment it tries to phone home. A worm that beats the password, the delivery alert, the YARA rule, and the host sweep still dies at the egress rule โ inert, backdoored but uncommandable, a held asset its holder can no longer reach. Defence in depth is not a slogan here; it is the specific reason each layer is worth deploying even though the others exist.
Cut first: block the channel
The single highest-value control against this worm requires no detection at all, and Part 3 already named it: deny outbound TCP to port 6667. The worm's command channel is IRC on UnderNet, and IRC on its standard port is a protocol almost no modern production host โ least of all a Raspberry Pi, a router, or an IoT device โ has any legitimate reason to speak. An egress rule dropping outbound 6667 severs every infected host on the protected network from #biret at once, no matter which of UnderNet's six servers it rolls, and no matter which build it runs. A bot that cannot reach its channel cannot be commanded; the held asset of Part 6 becomes inert.
This is the control to deploy before any of the detection below, because it works even against infections you have not yet found. It does not clean the host โ the backdoor and the lock remain โ but it cuts the operator's hand off the machine, which is the urgent half. On a perimeter firewall or a MikroTik-class edge router, it is one rule: drop outbound tcp/6667, log the matches, and every logged match is a host on your network you now know is compromised.
This estate already runs much of the package, which is why the worm's live arrival here is observed rather than suffered. The honeypot instant-bans every pi:raspberry source on first contact; a tiered escalation ladder promotes repeat offenders; and the edge router carries the blocklists both feed. On a MikroTik-class edge โ the router protecting this network โ the channel cut is a single pair of rules: an address-list of UnderNet's servers and a forward-drop of traffic to them on 6667, or, more simply, a blanket drop of outbound tcp/6667 from the LAN with logging. Something like:
/ip firewall filter add chain=forward protocol=tcp dst-port=6667 \
action=drop log=yes log-prefix="worm-c2-6667" comment="Raspberry Worm C2 cut"
The point of showing it concretely is that the highest-value control in this entire letter is one firewall line, deployable on the commodity router in front of almost any small network, and that a home or small-business defender โ exactly the population Part 5 found conscripted โ could apply it in a minute. The worm's whole design bets that its victims will never look at their outbound traffic. A single logged drop rule on the edge is the cheapest possible way to make that bet lose.
Detect on the durable: the key and the channel
For detection that survives the worm's per-drop mutation, key on the two things Part 4 proved durable.
The command-signing key. Every build of this operator's worm โ all thirteen in four months, despite thirteen different file hashes โ drops the identical RSA public key to /tmp/public.pem and carries it inline. A YARA rule keyed on that public key's distinctive modulus catches the whole campaign, past and future, because changing it would mean re-keying every existing bot:
rule raspberry_worm_biret_operator_key {
meta:
description = "Raspberry Worm (MulDrop fork) - operator RSA command-signing key"
reference = "TI-2026-087C / 087D"
strings:
$key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/ihTe2DLmG9huBi9DsCJ90MJs"
$c2 = "#biret"
$svr = "undernet.org"
condition:
$key or (all of ($c2,$svr))
}
The $key string alone is high-confidence โ it is the operator's cryptographic identity, and no unrelated file carries it. The #biret + undernet.org pair is the fallback for any variant that re-keys but keeps the channel. This one rule does what a list of thirteen hashes cannot: it identifies the operator's worm as a family, on a durable artifact, forward as well as back.
The network rendezvous. On the wire, the worm's registration sequence is fixed and distinctive: a TCP connection to an UnderNet server on 6667, an IRC USER user 8 * :IRC hi registration, a host-derived NICK aโฆ, and a JOIN #biret. A network-IDS signature keyed on the literal JOIN #biret over port 6667 โ or on the specific USER user 8 * :IRC hi registration string โ flags the beacon regardless of build. Combined with the egress block above, network detection gives both the cut and the alarm: the firewall drops the traffic, the IDS names the host.
Detect on the host: the installation fingerprints
For hosts already compromised, or caught in the act, the worm leaves a set of first-party, observed install artifacts โ several of them seen live at this honeypot in the current campaign โ that make excellent host-detection rules.
- The backdoor
authorized_keys. The worm's lineage plants a hardcoded SSH public key. The honeypot has observed the install one-liner run 105 times:cd ~ && rm -rf .ssh && mkdir .ssh && echo "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEArDp4cun2โฆ"writing the key intoauthorized_keys. Anyauthorized_keysfile containing that specificssh-rsa AAAAB3โฆJQAAAQEArDp4cun2โฆkey is a compromised host. (Note the honest distinction of Part 4: thisArDp4backdoor key is the lineage's shared implant, seen across ~98 hosts and multiple Pi-worm relatives; theMIGfkey above is this operator's command-signing key. Detect both โ the first catches the family, the second the specific operator.) - The password lock. The
usermodthat overwrites thepiaccount password to$6$vGkGPKUr$โฆis a durable host artifact: apiaccount whose password hash is that value, or which no longer acceptsraspberry, is compromised. On a fleet, an inability to log intopiwith the known password is itself the alarm. - The persistence. A copy of the worm under a random name in
/opt, referenced from/etc/rc.local, with/tmp/public.pempresent, is the resident footprint./etc/rc.localcontaining a line like/opt/XXXXXXXX(an eight-character random name) on a device that ships no such entry is a strong host indicator. - The DNS tell. An appended
nameserver 8.8.8.8in/etc/resolv.confon a device whose network provides its own resolver is a minor corroborating sign โ the worm's DNS-hardening of Part 3.
None of these are exotic; all are grep-able across a fleet with a configuration-management tool or a simple SSH sweep, and each one is durable in a way the file hash is not.
Watch the door: the credential and the choreography
Detection at the perimeter is cheapest of all, because the worm announces its propagation with a single, unmistakable credential. Every host running the worm's spread loop attempts pi:raspberry, and it does so in a distinctive choreography observed live here: a connection lasting one to three seconds, an scp -t server-side transfer pushing a file into /tmp, and an immediate chmod +x and execute โ get in, drop, run, leave. A honeypot, a canary SSH service, or authentication logging that flags any pi:raspberry attempt is flagging a member of the brood. During the writing of this letter such attempts arrived at a rate of several per minute from a rotating set of addresses โ which is both the measure of how active the campaign is and the reason perimeter credential-monitoring is worth deploying: the signal is loud, constant, and trivial to catch.
The sub-three-second scp-push itself is a behavioural signature. An SSH session that authenticates, performs an scp server-side receive into /tmp or /dev/shm, executes the received file, and disconnects inside a few seconds is the worm's delivery pattern, and it is anomalous enough on a normal host โ where interactive SSH sessions last minutes and rarely scp-then-immediately-execute โ to alert on directly.
False positives, honestly
A detection package is only useful if its false-positive behaviour is understood, and the controls here span the full range from near-perfect to needs-tuning. It is worth being candid about each, because a rule that cries wolf gets disabled, and a disabled rule protects nothing.
- The operator RSA key (YARA) โ effectively zero false positives. The
MIGfโฆmodulus is a specific 1024-bit key held by one operator; no legitimate software carries it. A hit is the worm, full stop. JOIN #biret/USER user 8 * :IRC hion 6667 โ near-zero.#biretis a botnet channel with no legitimate community, and the fixed registration string is the worm's, not a human client's. The only conceivable collision is a researcher deliberately joining the channel.- The host IOCs (backdoor key,
usermodhash,/opt+rc.local) โ zero. These are exact-match artifacts; a device either has that specific key inauthorized_keysor it does not. pi:raspberrycredential attempts โ near-zero as a threat signal, with a caveat: on a network that genuinely runs Raspberry Pis with the default still set, the defender's own legitimate logins would match. The tuning is trivial โ alert on the credential from external sources, or, better, change the default so any use of it is unambiguously hostile.- Egress
tcp/6667drop โ this is the one that needs environmental judgement. IRC is a real, if rare, protocol, and a network with genuine IRC users would break their client with a blanket drop. In the overwhelming majority of environments โ and universally on networks of Pis, routers, IoT, and servers that have no business on IRC โ the rule is pure benefit. Where legitimate IRC exists, the answer is to alert rather than drop on 6667, or to scope the drop to UnderNet's server ranges specifically, preserving detection without collateral. For the conscripted-victim population of Part 5 โ home routers, embedded devices, municipal boxes โ there is no legitimate 6667 traffic at all, and the blanket drop is unambiguously correct.
The ordering by false-positive safety happens to track the ordering by durability: the artifacts hardest for the operator to change (the key, the channel) are also the ones safest to alert on, while the one control that touches a shared protocol (6667) is the one requiring a moment's thought about the environment. That alignment is convenient, and it means a defender can deploy the durable, zero-FP detections aggressively and reserve judgement only for the single protocol-level rule.
The response the detection cannot deliver: remediation and the gap
Every control above protects the defender's estate. None of them fixes the victim โ and Part 5 established that four-fifths of the brood is victims: compromised home routers, telecom devices, and municipal boxes running the loop involuntarily. This is the honest limit of a detection package, and it must be stated rather than papered over. Banning the brood, blocking #biret, and grep-ing your own fleet for the backdoor key does nothing for the conscripted device in Malagueรฑo or Jakarta still scanning on the operator's behalf. Its owner does not read this. Its carrier may never act. The notification gap of Part 5 โ the abyss between those who can see a compromise and those who can fix it โ is not closed by any firewall rule.
What a defender who has done the detection can do, beyond self-protection, is two collaborative things. First, report #biret to UnderNet. The worm's one structural weakness is that it lives in someone else's house; UnderNet's abuse and network-operations teams can monitor the channel, G:line its bots, or kill it, and the channel name is the actionable indicator to hand them. Second, feed the durable IOCs upstream โ the operator key, the channel, the backdoor keys โ to the threat-intelligence sharing and CERT ecosystems that can, in aggregate and over time, drive carrier-level notification to victims. Neither is fast, and neither is guaranteed. But the alternative โ treating the brood purely as attackers to be blocked โ mistakes the victims for the enemy and abandons the one lever, collaborative reporting, that reaches past the perimeter toward the conscripts.
What holds, and what is bounded
What holds, first-party and live: the durable IOCs (the operator RSA key, #biret, port 6667), the observed install one-liner and backdoor key (seen 105 times), the pi:raspberry propagation choreography (observed live, several attempts per minute during the writing of this letter), and the host artifacts (password lock, /opt + rc.local persistence, DNS append) โ all read from this estate's own retained samples and logs.
What is bounded: the detection rules here are derived from what this sensor has captured. A variant that re-keys, changes channels, or alters its install routine would evade the perishable host indicators โ which is precisely why the YARA and network rules are anchored on the most durable artifacts available, and why the egress cut (which needs no signature at all) is placed first. No detection is permanent against an adaptive operator; the ranking by durability is the defence against that adaptation, not an immunity to it.
What is not claimed: that deploying this package eradicates the worm. It protects an estate, names its compromised hosts, and hands the collaborative levers to those who can pull them. Eradication of a self-propagating, victim-built, public-channel botnet is not a thing a detection package delivers; slowing it, seeing it, and cutting it off your own ground is.
The consolidated package (IOCs and rules)
- Network cut (deploy first): egress-deny outbound
tcp/6667; log and treat every match as a compromised internal host. - Durable file IOC (YARA): operator RSA key
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/ihTe2DLmG9huBi9DsCJ90MJsโฆ(dropped as/tmp/public.pem); fallback pair#biret+undernet.org. - Network IDS:
JOIN #biretand/orUSER user 8 * :IRC hiover TCP/6667 to any*.undernet.org. - Host โ backdoor:
authorized_keyscontainingssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEArDp4cun2โฆ(lineage implant, ~98 hosts). - Host โ lock:
piaccount password hash$6$vGkGPKUr$โฆ, orpino longer acceptingraspberry. - Host โ persistence:
/opt/<8-char-random>referenced in/etc/rc.local;/tmp/public.pempresent; appendednameserver 8.8.8.8in/etc/resolv.conf. - Perimeter โ credential: any
pi:raspberryauthentication attempt; sub-3-second scp-push-then-execute session behaviour. - Response: egress-cut; grep fleet for the host IOCs; report
#biretto UnderNet abuse; feed durable IOCs to CERT/sharing channels for victim notification. - Do NOT rely on: file hashes (13 in four months, per-drop mutation) or the automated family label (four builds mislabelled as XMRig, per Part 4).
Cross-references
- TI-2026-087C โ The Channel: the egress-6667 cut and the UnderNet-reporting lever.
- TI-2026-087D โ One Key, Six Names: the durable-over-perishable principle that orders this entire package.
- TI-2026-087E โ The Dispossessed: the remediation gap the detection cannot close, and why the brood is mostly victims.
The worm arrives as this is written, several times a minute, wearing a fresh hash each time and a label that has been wrong four times in four months. None of that helps it against a defence that ignores the hash and the label and reaches instead for the two things it cannot change โ the key it signs with and the channel it lives in. Block the channel, detect the key, grep for the lock, watch the door, and report the house it squats in. The worm was built to own nothing seizable; the countermeasure is built to need nothing but the one thing it cannot stop being โ itself, signed and rendezvoused, the same underneath every disposable skin.