Insights
Anatomy of a credential-stealing intrusion on our own production host
A root login we did not make, a base64-launched harvester in /tmp, a backdoor SSH key planted at 15:48 — and the hour-by-hour forensics, containment, and hardening that followed.

At 15:19 UTC on 2026-11-02 we got a message that pryzm.at was down. It was not. It had never gone down. What we actually found was worse: a credential-stealing script had been running on our production host for two days and eighteen hours, an unknown IP had authenticated to root with a password at 09:12 that morning, and a fourth SSH key had appeared in authorized_keys at 15:48 — ninety minutes before we started looking. This post is the honest technical rundown of what we found, what we did, and what we are still fixing. No heroics, no zero-days: a stolen password, a public SSH port, and the boring work of cleaning up afterwards.
- Host
- vps01612308
- Root login
- 09:12 CEST
- Harvester runtime
- 2d 18h
- Backdoor key added
- 15:48
- Host load before → after
- 9.17 → 0.61
The alert was wrong, and that mattered
The report was "pryzm.at is down". Before touching anything we did the least glamorous thing available: we measured. From inside the gateway container, `https://pryzm.at/` returned HTTP 200 in 59ms. We ran twenty sequential probes over a minute — all 200, all under 120ms. The nginx access log showed real external visitors getting 200s during the exact window the report covered: a browser on 109.243.71.214, TelegramBot, ClaudeBot.
So the site was up. What was actually happening was degradation layered on top of a compromise. The nginx error log had only a handful of real failures in twelve hours: one 502 on `/efss/pryzm-og.svg` at 12:50 (the EFSS upstream on :8090 had just been recreated), two 504s on `/origami/api/*` at 12:53, a handful of 500s on `/efss/api/browse` and a 503 on `/efss/api/upload`. Everything else was 200.
This is worth stating plainly because it is the part most incident write-ups skip: the first instinct — "the site is down, restart things" — would have destroyed the single most valuable artifact we had. Restarting the gateway, bouncing the containers, and reinstalling would have erased the process table, the open file descriptors, the timing evidence, and the exact shape of the compromise. We had to be slow for about ten minutes before we were allowed to be fast.
- Baseline first: HTTP status, latency distribution, and the access log, before any mutation
- Distinguish "site down" from "site degraded" — they have opposite responses
- A 200 from inside the host is not proof of external health, but a 200 in the access log from a real foreign IP is
What we found on the host
The Docker socket was mounted into the gateway container, which gave us a path to the host without the SSH key. The first sweep produced a number that did not make sense: load average 9.17 on a small VPS, with 91% of swap in use. `docker stats` pointed at `jaisiu-openclaw-gateway-1` burning roughly 390% CPU — nearly four cores — while the gateway's own health check reported healthy, zero restarts, and no OOM kill.
Thread-level accounting inside the container told the real story. The node process had accumulated 331,074 user jiffies and 2,786 system jiffies in fourteen minutes of wall time. The libuv worker threads were all in state R. This was not a slow leak; this was a saturated thread pool.
But the second-hottest process on the host was the one that mattered. PID 3600174: `python3 /tmp/h2.py`, 99.8% CPU, elapsed 2 days 18 hours.
- Load average 9.17 / 7.56 / 7.01 on an 11 GiB host with 1 GiB of swap
- Gateway container recreated 15:16:05Z, healthy, RestartCount 0, OOMKilled false
- All 19 containers healthy — except pryzmat-mongodb-1, which had restarted 75 times since 2026-10-23
The harvester: what /tmp/h2.py actually did
The script was 2,288 bytes. It is not obfuscated and it is not clever. It walks a fixed list of roots — `/root`, `/opt`, `/home`, `/srv`, `/var/lib`, `/data`, `/app`, `/usr/local` — and collects every `.db`, `.sqlite`, and `.sqlite3` file larger than 8 KB. For each one it opens the database read-only, reads the table list, and for any table whose name contains `channel`, `provider`, `providerconnection`, `connection`, `token`, `config`, `setting`, `account`, or `credential`, it dumps the first 60 rows and runs a regex over the JSON for `sk-`, `apiKey`, `api_key`, `AIza`, `base_url`, or `baseUrl`.
Then it does the part that makes it malware rather than a script: it base64-encodes the match and prints it with a machine-readable marker — `@@HUNT <kind> <path> <base64>`. It walks the same class of files in text form: `/root/.env`, `/root/.env.local`, `/etc/environment`, and every `config*.json` and `*.yaml` it can glob under `/opt`, `/app`, `/srv`, and `/home`.
Its siblings do the same job with different targets. `/tmp/c2.py` explicitly reaches for `/home/*/.openclaw/openclaw.json`, `/home/*/.9router/db/*.sqlite`, `/home/*/.local/share/opencode/auth.json`, `/home/*/.cli-proxy-api/*.json`, `/root/.config/litellm/*.yaml`, and `/var/lib/docker/volumes/*/_data/*.db`. Others (`cred.py`, `ep.py`, `kf.py`, `pv.py`, `xp.py`, `ocs.py`, `ocs2.py`, `h4.py`) were created between 21:49 on Oct 30 and 00:43 on Oct 31 — a two-hour window of iterative targeting against exactly the paths where our agent credentials live.
The launcher matters just as much. The parent process command line was a base64 blob that decoded to a single pipeline: `base64 -d > /tmp/h2.py; nohup python3 /tmp/h2.py > /tmp/h2.out; cat /tmp/h2.out`. It was `bash -c`, parented to PID 1, detached from any terminal — so it survived every logout and would survive a shell restart. The `nohup` and the PID-1 parent are the signature of something that intends to keep running.
- Ten scripts in /tmp, all credential-harvesters, created 2026-10-30 21:49 → 2026-10-31 00:43
- Targets: OpenClaw config, 9router SQLite DBs, opencode auth.json, cli-proxy-api JSON, LiteLLM YAML, Docker volume DBs, every .env on the box
- Output format is machine-readable (`@@HUNT` / `@@F` markers, base64 payloads) — designed for exfiltration, not for local use
- Launched via base64-decoded `bash -c` with `nohup` and a PID-1 parent: survives logout, survives shell restart
How it got in: the 09:12 login
The host had `PermitRootLogin yes` and `PasswordAuthentication yes`. On 2026-11-02 at 09:12:16 CEST, sshd logged `Accepted password for root from 113.247.11.15 port 17281`. The session disconnected three seconds later. That IP is not ours — our known addresses are in the 83.4.x.x range (83.4.123.2, 83.4.161.111, 83.4.125.12) plus one historical 161.120.177.213. 113.247.11.15 appears exactly once in the entire auth log.
A three-second session is odd. It looks like a check rather than a visit: authenticate, verify access, disconnect, and come back later for the real work. The brute-force pressure on this box was constant — 2,325 failed password attempts logged on the day of the incident, with 107.172.23.112 accounting for 151 of them and 3.143.67.100 for 96.
We cannot prove from the auth log alone that the password was stolen rather than guessed, but the shape strongly suggests reuse of a leaked credential. Either way the lesson is the same and it is not subtle: a root account that accepts a password over the public internet is a single point of failure for every secret on the machine.
- PermitRootLogin yes + PasswordAuthentication yes on a public IP
- Unauthorized root password login from 113.247.11.15 at 09:12:16 CEST, 3 seconds long, single occurrence in the log
- 2,325 failed password attempts on the day — fail2ban was running but not banning effectively
The 15:48 backdoor key
At 15:48 on the day of the incident — ninety minutes before we started investigating — `/root/.ssh/authorized_keys` was modified. It had held two keys since 2026-07-27: `piotro@prizm-laptop` and `jaisiu-docker@root`. After the modification it held four, and one of them was malformed: two keys concatenated onto a single line, so the second one was silently inert.
The fourth line was a clean, valid ED25519 key with the comment `jaisiu-gateway-2026-08-16T13-30Z` and fingerprint `SHA256:4G6GnwSM9XIn7Mt9cP9LHX5sg7nt4OL2JycVJXy30Oc`. We searched for it three ways: no matching `.pub` file exists anywhere on the host, no script in our infrastructure references that comment, and the key is absent from the Jul 27 backup. An attacker-planted persistence key. It would have survived every credential rotation we could have performed.
The third line deserves a note too. Piotr's personal key `jaisiu-docker@piotrossh-ed25519` was there, but concatenated with a duplicate of the `jaisiu-docker@root` key on the same line — a botched append, not an attack. We restored it correctly as one line. Being precise about which of the four keys was hostile mattered: removing all four would have locked the gateway out of the host entirely.
- authorized_keys went from 2 lines (Jul 27 baseline) to 4 lines (Nov 2, 15:48)
- Attacker key: AAAAC3NzaC1lZDI1NTE5AAAAIAScWXf0D3QNPA+W8bzIjtsj5PH+owDqJ4l3VBgDBWM+ — no private key on host, no infra reference, absent from backup
- Line 3 held two legitimate keys concatenated — restored correctly as a single line rather than deleted
Containment, in order
Everything below happened under operator approval, and in this order, because the order is the part that matters.
First, forensics. We copied all ten scripts plus the output file into `/root/incident-forensics/20261102T155114Z/`, computed SHA-256 hashes for each, and captured the running process's `/proc/<pid>/status`, `/proc/<pid>/environ`, and its file-descriptor listing. We also snapshotted the compromised `authorized_keys` and the relevant auth.log lines. Then we made that directory read-only. The point of this ordering is simple: if we had killed the process first, the evidence of what it was doing would have been gone.
Second, kill. PID 3600174 and its PID-1 parent 3600171, `kill -9`.
Third, quarantine. All ten scripts and `h2.out` moved to `/root/incident-forensics/quarantined-malware/` with mode 000, so they are preserved but not executable.
Fourth, authorized_keys. The compromised four-line file was saved as `authorized_keys.compromised.20261102T155130Z`. We restored the two-key Jul 27 baseline, re-added Piotr's personal key correctly as one line, and confirmed the attacker key was gone.
Fifth, SSH lockdown. `PermitRootLogin prohibit-password` and `PasswordAuthentication no`, validated with `sshd -t` before reload, then `systemctl reload ssh` rather than a restart so live sessions survived.
Sixth, persistence hunt. We checked every user's crontab, `/etc/cron.d`, systemd units modified in the last month, `/etc/rc.local`, `/etc/profile.d`, shell rc files, `/etc/passwd` for new users, SUID binaries created since October, `/etc/ld.so.preload`, and every listening socket. The result was clean: every cron entry was one of our own Jaisiu ops jobs, no new users, no malicious units, no preload rootkit, no backdoor ports. The remaining `/tmp/*.py` files were all our own operator scripts — Stripe setup, SMTP diagnostics, OrigamiMail database inspection — with no harvesting signatures.
One caveat worth recording: a broad grep for harvesting patterns across the repository hit `src/agents/credential-anonymizer.ts` and `src/logging/redact.ts`. Those are our own redaction code. A scanner that only reports "suspicious regex matches" will eventually cry wolf; you have to look at what it found.
- Forensics snapshot + SHA-256 hashes BEFORE any destructive action
- Quarantine over deletion — preserved for investigation, chmod 000 to neutralise
- sshd -t validate before reload; reload instead of restart to protect live sessions
- Full persistence sweep came back clean: no cron, no systemd units, no new users, no SUID, no preload, no backdoor listeners
The CPU spin was not the malware
Killing the harvester dropped load average from 9.17 to 1.52 — a large win, and an easy conclusion to draw incorrectly. But the gateway was still at 294% CPU, and we had assumed the malware was responsible for both. It was not.
The gateway was running in host network mode, and one of its threads had been stuck at 99.8% CPU for the entire 2 days 18 hours the harvester was alive. We assumed those were the same problem. They were not: the gateway had been recreated at 15:16 on the day of the incident, and the harvester had been running since Oct 30. Different lifetimes, different causes.
The actual driver was our own `jaisiu-openclaw-cli-1` container, which runs `node dist/index.js tui`. It held an ESTABLISHED connection to the gateway's fleet port on :18789 and polled the fleet list every three seconds — forty requests a minute, from a single session. We proved it by A/B: with the CLI running, ten "Fleet list request" entries in thirty seconds; with it stopped, one. Restarting the CLI brought the poll back within seconds.
This also produced a measurement trap we want to warn about, because it nearly sent us the wrong way. `docker stats --no-stream` reported the gateway at 0.19%, then 2.95%, then 0.35%, then 0.08%, then 93.59% — for the same process, over twenty-five seconds. It samples a single short window and the container's CPU accounting is noisy. The authoritative method is to read `/proc/<pid>/stat` twice, a fixed interval apart, and difference the jiffies. That gave the clean answer: 0 jiffies over 20 seconds, 0% CPU, zero fleet polls. If you have spent an hour chasing a CPU spike that a single `docker stats` reading would have "confirmed", switch to jiffies.
- CLI container running: 10 fleet-list requests / 30s · stopped: 1 / 30s — A/B confirmed the poller
- jaisiu-openclaw-cli-1 is an interactive TUI with RestartPolicy=no; it had been orphaned with a /bin/bash child stuck in do_select
- Authoritative idle proof: gateway PID 7, 0 jiffies over 20s = 0% CPU
- A 3-second poll interval for a UI that shows a list is a real performance bug, independent of this incident
Where things stand
Host load average went from 9.17 / 7.56 / 7.01 to 0.61 / 1.86 / 3.67. The gateway is at 0% CPU. pryzm.at, /efss/, and /api/health all return 200 with roughly 28-31ms time-to-first-byte — faster than they were during the incident window, because the host is no longer saturated. All nineteen containers are healthy. Zero password authentications have succeeded since the lockdown went in; the last legitimate one was 16:10 from 83.4.123.2.
The containment is done. The incident is not. Root was compromised for at least six hours by an IP we cannot attribute, and the harvester was reading every `.env` and credential database on the box. The honest conclusion is that we have to treat every secret on this host as potentially stolen until we have rotated it: Discord, GitLab, YouTrack, the LLM provider keys, OpenClaw, EFSS, the SMTP relay, MongoDB, the gitlab-runner token. We are working through that list.
Two more things are on the list and we want to be upfront about them. The root password needs rotating even though password authentication is now off — the credential itself is burned. And fail2ban is running on this box but is not banning effectively; there were 2,325 failed password attempts on the day of the incident and we are not confident the jail configuration is doing what it should.
- Load 9.17 → 0.61 · gateway 390% → 0% · site TTFB ~28ms · all containers healthy
- Open follow-ups: rotate every host credential, rotate the root password, verify fail2ban jail config
- Known remaining defect: the TUI's 3-second fleet poll should become an event push, not a poll