Someone put a cryptominer on our server. This is the tripwire we built afterward, and how it quietly broke.
We run one cloud server where several AI agents work every day: an MCP server, a wiki, an agent gateway, file transfer. In June 2026 it was cryptojacked. This is what we did, what we built, and what we found when we went back to check on it five months later.
what happened
The way in was a service we had left open to the internet without realising it. Nobody had decided to expose it; it simply was exposed, and we did not know until a miner was running.
We did not try to clean the machine. Once something you did not put there has run on a box, you can no longer vouch for anything else on it, and checking every file costs more than starting over. By 27 June the whole stack was running on a fresh instance and the old one was retired.
The rebuild fixed that box. It did nothing about the reason we had not noticed: nothing on the server was watching for this. So the other thing we did was write a tripwire.
the tripwire
PantaGuard is a single Python script run by a systemd timer every seven minutes. It needs nothing outside the standard library. The first run records a baseline; every run after that compares against it and emails us if anything below shows up. It has been running since 16 June.
| Check | Fires on |
|---|---|
| Odd processes | A process whose binary or arguments live in /tmp, /dev/shm, /var/tmp or /dev/fd, a known miner name, or a process outside a short list holding more than 170% CPU. |
| Unexpected ports | Anything listening on a public address that is not on the allowlist. Loopback is ignored, so local services behind a reverse proxy never trip it. |
| Persistence | A changed, new or removed file among crontabs, /etc/passwd, sudoers, systemd units and every authorized_keys. Hashes are compared with the previous run. |
| Mining pools | An established connection to an outside address on a port that mining pools commonly use. |
| Load | Load average above two and a half times the core count. |
| Containers | A running container started with --privileged. |
the agents
The hard part was not the attackers. It was us. Our agents build, test and deploy things on this server all day, and to a detector, a busy agent looks a lot like an intruder: it runs binaries out of /tmp, opens ports, writes systemd units and spikes the CPU.
On 14 July a wave of false alarms from container runtimes and coding tools pushed us to fix it properly. We now ignore processes whose binary path cannot be read rather than treating an empty path as suspicious, and agents register a tool by its exact process name before running it for long. The rules every agent on the server must follow are short: add single entries to an allowlist when you have to, never remove a detection rule, never add a wildcard, never turn the timer off. Persistence alerts after an agent edits a systemd unit are expected and stay on.
five months later
We went back to the logs to write this note, and they did not look good.
Since 16 June PantaGuard has raised 3,530 alerts and sent 3,311 emails. Every one we went back through was our own work that it could not tell apart from an attack: agents running scripts out of temporary folders, a game engine rendering headless, OCR jobs, services we had forgotten to allowlist. An inbox that gets mail every seven minutes stops being read, and ours did worse than that.
We got so tired of the noise that we cut the mail off. Since 10 November every send has failed, and the script just writes one line to its own log and moves on. Nothing told us the tripwire was now talking to itself. Since 14 November every run has also flagged a headless browser that one of our agents uses: Chrome joins the mDNS multicast group, and 224.0.0.251:5353 does not start with 127., so it counted as a public listener.
Put together: the detector had been crying wolf for months, we had stopped listening on purpose, and for the last five days it had been repeating the same wrong thing every seven minutes to nobody. Had someone come back in that week, we would have learned about it the same way as the first time.
what we take from it
A check that fires on every run is the same as no check. Alert volume needs a budget, and the same finding should not be resent until something about it changes.
Delivery is part of the detector. Turning alerts off is a decision, and it should feel like one. If the alert cannot leave the box, for whatever reason, that has to show up somewhere a person looks; a daily “still alive” summary would have made the silence obvious within a day.
Multicast and link-local addresses are not the public internet. The listener check should only count addresses that are actually reachable from outside.
limits
PantaGuard runs on the machine it watches. Anyone who gets root can stop the timer or edit the script before we hear about it, and the name lists are trivial to avoid: a process name is whatever the process says it is, so a miner called python3 sails past both the miner list and the CPU allowlist. It is a tripwire for the common, noisy kind of compromise, the kind that happened to us, not a defense against someone careful. Real protection is the boring part: not exposing services by accident, keeping keys out of repositories, and checking the firewall rules against what is actually listening.
what changed
Since 15 November PantaGuard mails at once only for the things that mean someone is in: a known miner, a connection to a mining pool, a public port that is not on the allowlist. Each goes out once, when it first appears, and not again unless it goes away and comes back. Everything else waits for one summary a day, sent every morning even when there is nothing to report, so a day without it means something has stopped. Multicast and link-local listeners no longer count. The mail itself is still switched off on our side. Turning it back on is the next step, now that it should arrive about once a day.