Dev.to AI πŸ€– Ai πŸ‘ 2 πŸ“– 6 min read

We let hackers into a haunted server: building Haunted Honeypot with Kiro

In its first four days on the internet, our server was attacked by 274 different addresses. They tried to log in 1,826 times, and 55 of them got in. Nobody told them the server existed. They found it on their own, becaus

We let hackers into a haunted server: building Haunted Honeypot with Kiro

In its first four days on the internet, our server was attacked by 274 different addresses. They tried to log in 1,826 times, and 55 of them got in. Nobody told them the server existed. They found it on their own, because bots scan the whole internet all day.

That was the plan. The server is a trap.

Haunted Honeypot is our entry for Kiroween 2026, in the Frankenstein category. It pretends to be a forgotten municipal records server, records-srv-09, decommissioned in 2013. It lets attackers in, records everything they do, explains the attack in plain English, and writes the rules to protect a real server from it. We built it with Kiro, spec-first, and this post is about how that went: what worked, what broke, and what the bots did once they were inside.

The Live Monitor: attempts, unique attackers and break-ins in real time

What we built

Four parts, stitched together like Frankenstein's creature:

  1. The Trap: a fake SSH server on port 22. It accepts the weak passwords bots love, such as root / 123456, and records every keystroke.
  2. The Ghost Shell: it answers commands like whoami, uname -a and cat /etc/passwd from a fake filesystem. Nothing the attacker types is ever executed. It can ask Gemini to improvise replies to unusual commands, with a scripted fallback.
  3. The Brain: it reads the session logs, maps each move to MITRE ATT&CK techniques, rates the session Class 1, 3 or 5, writes a plain-English lab note, and saves dangerous links in a safe "defanged" form like hxxp://198[.]51[.]100[.]77/xmrig.
  4. Containment: it turns what attackers did into a hardening checklist and ready-to-run rules for a real server, such as turning off password logins or blocking outgoing crypto-mining ports.

All of it shows up in a dashboard themed as a "Frankenstein Lab Cam": dripping green titles, copper rivets, a blinking REC dot. Attack sessions are "tapes" you can replay keystroke by keystroke.

Replaying an attack tape keystroke by keystroke

Planning with Kiro specs

We started with specs, not code. A Kiro spec is three files: requirements.md (what it must do), design.md (how) and tasks.md (a checklist Kiro works through). We wrote five:

  • trap-core: the fake SSH server and ghost shell
  • ghost-llm: the Gemini improvisation, with a daily limit and a fallback
  • brain: log ingestion, ATT&CK mapping, severity, lab notes and the API
  • dashboard: the Lab Cam interface
  • tape-navigation: triage for thousands of tapes, added after real traffic arrived

Specs mattered here because the parts never call each other directly. The trap writes log files, the Brain reads them, and the dashboard asks the Brain through an API. If those hand-offs are vague, each part works alone and the whole thing fails. Writing the contracts down first meant Kiro built each part against the same agreement.

The tape-navigation spec is a good example of specs evolving. After a few days live, the tape list was too long to scroll, and finding a specific kind of attack meant opening tapes one by one. So we wrote a new spec: filters by severity, date and technique, review marks, keyboard shortcuts, and a badge for attackers who keep coming back.

Filtering tapes by severity, review status and technique

Steering, a hook and property tests

Steering files are documents Kiro reads on every task. We had four:

  • security.md: the one rule that matters most in a honeypot. Attacker input is data, never code. No eval, no exec, no subprocess on anything an attacker sends; safe YAML loading; escaped rendering in the dashboard.
  • product.md: the lab's vocabulary (specimen, tape, lab voltage, containment), so the UI, the API and the lab notes all use the same words.
  • design.md: the colours, fonts and spacing of the Lab Cam theme, which Kiro applied to every page.
  • tech.md: the stack and conventions. We added a rule here after Kiro corrupted two files on Windows (more on that below), and it did not happen again.

An agent hook runs every time a Python file in the trap or its tests is saved: Kiro runs ruff (style), bandit (security) and pytest. The trap is the only code attackers touch, so a security mistake there gets flagged the moment it is written, not in review.

Property-based tests check rules against thousands of random inputs instead of a few hand-picked ones, using Hypothesis in Python and fast-check in TypeScript. For example: "no input crashes the shell or reaches subprocess", and "two attackers' sessions never leak into each other". The project ended with over 500 automated tests.

We also used Claude (Anthropic) as an assistant alongside Kiro, for planning, reviews, debugging and deployment.

What broke, and what we learned

"All tests pass" can still mean broken. The Brain passed its tests and the dashboard passed its tests, but together the dashboard crashed. The Brain sent severity as "Class 5 β€” Critical" while the dashboard expected "Class_5". The fix: save real API responses as fixtures and test the dashboard against them. Lesson: test the hand-offs between parts, not just the parts.

An AI edit can corrupt a file quietly. A bulk edit on Windows turned every i in main.tsx into m and every line break into an invisible null character. Another turned β€” into Ò€”. The tests did not catch the first, because no test imports main.tsx. git diff --stat did: a source file showed up as Bin (binary). We added a steering rule, and it did not happen again.

Deployment has its own bugs. On a Google Cloud VM, the web server crashed because an empty domain setting turned its config into something else. Later, rebuilt dashboards never appeared, because a shared Docker volume only fills on first creation. Each one took a few minutes to fix once we read the logs line by line, and much longer when we guessed.

Port 22 has to belong to the trap. That means moving your own admin login somewhere else first, without locking yourself out. We moved it to a hidden port reachable only through Google's private tunnel.

What the attackers actually did

The first bots arrived within minutes of the trap going live. A few patterns stood out:

  • Keyboard-walk passwords. 1qaz2wsx# and qazxsw are columns of a keyboard typed top to bottom. Admin.123456 and Dell123 target devices left with factory-style passwords.
  • Log in, then leave. One bot guessed the root password, logged in, and disconnected after one second without typing anything. That is typical of a password checker: it confirms the login works and reports it, so a second wave can come back later.
  • Low and slow. One address returned again and again, every few minutes, with one password per visit. Tools like fail2ban ban an address after several failures in a short window; one guess at a time stays under that line. Seeing it needs a view of each attacker across many sessions, not one session at a time, which is what the repeat-attacker badge in our dashboard is for.

Each of these became a tape with an ATT&CK label: T1110 for brute force, T1078 for a successful login with a valid account, and T1105 and T1496 when our own test attack downloaded and ran a crypto-miner, the way real bots do.

Containment: hardening steps generated from what attackers did

Try it yourself

The code is open source under the MIT licence, .kiro folder included, so you can read every spec, steering file and hook we used: github.com/lovettemancho-hue/haunted-honeypot. The README has a Docker Compose quick start.

The biggest thing Kiro changed for us was the order of work. Writing requirements and contracts first felt slow for a day, then saved us every day after: when parts disagreed, the spec said which one was wrong.

If you run a server on the internet, it is already being knocked on. A honeypot is a safe way to see who is knocking.

Built by Mancho Lovette Feseng and Favour N. Emmanuel for Kiroween 2026.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.