krain-seckrain-sec

krain-secdocsguide

Deploy beside the real site

Operator docs for running krain-sec as a sidecar honeypot. Customers stay on :80 / :443. Scanners and curious intruders get believable bait. See also the project README.

Package · krain-sec · License AGPL-3.0 · Source h3ma209/krain-sec

At a glance

Real site stays boring. Decoys look juicy. Scrapers find bait — Google and Bing keep ranking the real product.

:80/:443real site
4decoy surfaces
~23MBAlpine image
AGPLopen source

Overview

Make the real site look boring. Give scanners something shinier.

Your real website should look uninteresting to scanners. krain-sec parks a louder, juicier fake beside it — fake SSH, fake MySQL, fake Grafana, and a fake Aetheris SOC / admin console — giving commodity scanners and curious intruders believable dead ends to investigate.

Scanners probe whatever looks open, juicy, or misconfigured. When familiar ports present convincing decoys, opportunistic probes can spend their time and noise there instead of immediately reaching real admin services.

krain-sec is designed to consume scanner time with rabbit holes, decoy ports, planted secrets, tarpits, and dead ends while your real site on 80/443 stays boring. Customers reach the real site. Commodity scanners and curious intruders encounter the bait.

  • Boxes keep getting hit by everything from script kiddies to sharper scanners. Full enterprise deception stacks are expensive and heavy to run. krain-sec is something small teams and solo ops can actually deploy: one container, low RAM, make prod, done.
  • Only on servers you own. Not “hack back” — controlled deception for engaging opportunistic probes without touching the source.

Traffic

Two traffic paths

Same VPS, two stories. Normal visitors never enter the bait. Attackers and scanners chase the shiny doors.

Customers

Normal visitor

They only need the real website. Nothing juicy, nothing to chase.

  1. 01

    Visitor opens your site

    Browser hits the public URL on :80 / :443 like any normal website.

  2. 02

    Traffic stays on the real app

    HTTP/HTTPS goes to your real service. No decoy ports involved.

  3. 03

    They never see the bait

    Fake SSH, MySQL, Grafana, and the SOC console stay off this path. Customers just use the product.

Probes

Attacker / scanner

They hunt familiar open doors. The loud bait pulls them away from the real site.

  1. 01

    They scan the VPS

    Tools probe common ports — :22, :3306, :3000, :8080 — looking for misconfigs and admin surfaces.

  2. 02

    Bait answers first

    krain-sec owns those standard ports. The real site on :80 / :443 looks boring next to shiny decoys.

  3. 03

    They dig into fiction

    Fake SOC login, WebRTC probe, planted secrets, SSH shells, and tarpits keep them busy inside the decoy — not on production.

After the bite

What happens after they bite

One path. They chase the decoy. Your real site stays boring.

  1. 01

    They scan

    Find open bait ports like :8080

  2. 02

    Hit Aetheris

    Looks like a real admin / SOC dashboard

  3. 03

    WebRTC runs

    May reveal IP past some VPNs

  4. 04

    They dig deeper

    Fake logins, files, SSH, MySQL, Grafana

  5. 05

    Stuck in bait

    Rabbit holes · you see the activity

Remember

Meanwhile :80 / :443 stay the real website — customers never enter this path. WebRTC attribution is opportunistic, not guaranteed against every VPN or hardened browser.

Topology

Deployment options

Choose one topology before changing ports or publishing lure URLs. Same-VPS deployment prioritizes immediate scanner discovery. A separate VPS prioritizes isolation.

Shared host

Same VPS

Run krain-sec beside your real website or service. The honeypot takes the standard bait ports, while real administrative services move to alternate ports. Your public website stays on 80/443.

Best for

Small deployments that want immediate diversion on the same public IP without paying for another server.

Setup

  • Move real SSH from :22 to a private or allowlisted port such as :2222.
  • Move any real service already using :3306, :3000, or :8080 before starting the decoys.
  • Leave the public website on :80 / :443; krain-sec does not replace or proxy it.
  • Start krain-sec and verify each standard bait port answers from outside the VPS.
  • Keep the container isolated from production networks, secrets, and volumes.

Ports

  • Real website → :80 / :443
  • Real SSH → e.g. :2222
  • Fake SSH → :22
  • Fake MySQL → :3306
  • Fake Grafana → :3000
  • Fake SOC console → :8080

Trade-off: Fastest scanner discovery, but requires careful port moves and shares host resources with production.

Dedicated decoy

Separate VPS

Run krain-sec on another server with its own public IP and, preferably, a believable subdomain. Your production ports and services do not need to move.

Best for

Teams that prefer stronger isolation or cannot change ports on the production server.

Setup

  • Provision a small dedicated VPS and keep it separate from production private networks.
  • Point a believable bait hostname, such as console.example.com, to the decoy IP.
  • Expose the honeypot ports on the decoy VPS; leave production ports unchanged.
  • Set HONEYTOKEN_BASE_URL to the public bait hostname and run make prod.
  • Publish safe discovery references so crawlers and targeted visitors can find the decoy.

Ports

  • Production website → unchanged
  • Production SSH / DB → unchanged
  • Fake SSH → decoy-IP:22
  • Fake MySQL → decoy-IP:3306
  • Fake Grafana → decoy-IP:3000
  • Fake SOC console → decoy-IP:8080

Trade-off: Better isolation and no production port changes, but costs another VPS and needs deliberate URL discovery to connect crawlers with the bait.

People

Who this is for

Small teams & solo operators

primary

Primary audience. You run a real site on a VPS and want scanners chasing convincing decoys instead of your app. One small container beside it. No SOC required.

Blue teams / SOC labs

Decoy asset that lights up when scanners or humans poke it — without standing up a fat SIEM.

Detection engineers

Use decoy interactions as supporting signals for rules and pipelines while diversion remains the primary job.

Researchers & students

Study deception and light attribution (WebRTC probe, beacons) without touching a real IdP.

Homelab / purple team

Safe attacker playground on an isolated VLAN or throwaway VPS.

  • Not a real SSO portal, SIEM, or production auth stack.
  • Not a replacement for patching, backups, TLS, or locking down the real app.
  • Not an APT jail — optimized for noisy, high-volume, and curious adversaries.

Adversaries

Who it attracts

Internet scanners

Probing familiar ports such as SSH, MySQL, Grafana, and HTTP across public IP ranges.

Crawlers & bots

Extracting bait URLs from robots.txt, sitemaps, HTML comments, and frontend metadata, then following them into decoy paths.

Credential stuffers

Banging on the fake Aetheris console login.

Curious humans

Downloading “break-glass” packs, runbooks, and planted keys.

Hands-on attackers

Following planted credentials, fake SSH history, emergency files, and canary PDFs deeper into believable rabbit holes.

Ports

Bait owns the classic ports.

When krain-sec shares the production VPS, move real SSH and MySQL elsewhere first. Put the pots on :22 and :3306 so scanners find decoys on the ports they always try. A separate honeypot VPS does not require production port changes.

Lure strategy

Maximize attacker, crawler, and bot discovery

Open ports attract network scanners automatically. Crawlers and hands-on attackers need discoverable trails: believable URLs, consistent identities, and clues that lead from one decoy to another. The objective is more time inside fake systems—not more traffic to production.

Network scanners

Make routine port scans encounter the decoys before they find anything useful.

  • Keep bait on familiar ports: SSH :22, MySQL :3306, Grafana :3000, and the SOC console :8080.
  • On a shared VPS, move real administrative services away from those ports before exposing the honeypot.
  • On a separate VPS, allow the public decoy ports through its firewall and keep production networks unreachable.
  • Use consistent hostnames and service banners so the ports look like parts of one believable environment.

Crawlers & bots

Create discoverable URL trails that automated crawlers can extract and follow.

  • Give the honeypot a believable hostname such as console.example.com and valid TLS when possible.
  • Reference the bait URL in robots.txt, sitemap.xml, HTML comments, data attributes, or static frontend configuration.
  • A raw IP must appear inside a complete URL, such as http://203.0.113.10:8080, or most crawlers will not treat it as a destination.
  • Cross-link decoy pages, documents, downloads, and forbidden-looking paths so one discovery leads to several rabbit holes.

Hands-on attackers

Reward manual investigation with believable clues that lead deeper into fake systems.

  • Keep names, host banners, fake users, and company identity consistent across HTTP, SSH, PDFs, and planted files.
  • Plant fake credentials, shell history, emergency runbooks, backups, and internal-looking links that point only to decoys.
  • Mix convincing failures with occasional progress; endless immediate denial makes the environment look fake.
  • Use request delays, infinite directories, and canary documents as deeper branches—not as the first thing every visitor sees.

Safe frontend references

Where to put lures on the real website

Goal: hostile scrapers that read HTML / robots find the bait; customers and mainstream search crawlers keep treating your real site as the only product. Put only the public decoy URL in inert frontend text or metadata that never triggers a browser request.

HTML commentsuse

<!-- legacy ops console: https://console.example.com/internal/ --> Visible to source scrapers, ignored by users and usually ignored as a ranking signal.

Static JSON / config script typeuse

<script type="application/json"> with an opsConsole URL. Not executed, not fetched, still scrapeable.

data-* attributes on non-linksuse

e.g. data-legacy-console="https://console.example.com" on a footer span — not an <a href>.

robots.txt Disallow lines for bait pathsuse

Advertise “forbidden” decoy paths so naughty crawlers try them. Keep real product paths Allow’d for Googlebot / Bingbot.

Separate bait sitemap (optional)use

A decoy-only sitemap hosted on or pointing at the honeypot host — not mixed into the real site’s primary sitemap of customer pages.

Visible nav / footer linksavoid

Customers click them; search engines may treat them as real site structure.

meta refresh, 3xx redirects, JS location changesavoid

Hurts UX and looks like cloaking or soft-404 games to search engines.

iframes, <img>, fetch(), XHR to the honeypotavoid

Makes browsers (and sometimes bots) request bait from the real origin story.

<!-- legacy operations console:
     https://console.example.com/internal/ -->

<script type="application/json" id="public-config">
  { "opsConsole": "https://console.example.com" }
</script>

<!-- robots.txt on the real site — keep product paths crawlable -->
# User-agent: *
# Allow: /
# Disallow: /internal/ops-console/
# Disallow: /backup/admin/

An IP works only inside a complete URL, for example http://203.0.113.10:8080. Prefer a believable hostname with TLS on the decoy. Do not submit the honeypot URL in Search Console / Bing Webmaster as if it were your brand.

Keep real users, Google, and Bing out of the lure

Do not redirect customers, embed honeypot images, iframes, fetches, or scripts, expose real credentials, or publish private production addresses. Do not hide keyword links for ranking tricks. Inert comments and decoy-only metadata catch scrapers; clean public HTML and sitemaps keep SEO intact.

Ship it

Deploy steps

  1. 01

    Choose where it runs

    Use the same VPS for immediate scanner diversion, or a separate VPS for stronger isolation.

  2. 02

    Prepare the ports

    Same VPS: move real SSH and other conflicting services first. Separate VPS: production ports stay unchanged.

  3. 03

    Clone & configure

    Copy .env.example to .env and set HONEYTOKEN_BASE_URL to the public bait hostname or IP-based URL.

  4. 04

    Start the honeypot

    Run make prod. Confirm the decoy services are reachable from the internet.

  5. 05

    Publish crawler lures on the real site

    Drop bait URLs in inert places crawlers scrape (comments, static config, data attrs) — not in nav, sitemaps, or pages Google/Bing should rank. Details in the Lures section above.

  6. 06

    Keep search engines and SEO clean

    No cloaking redirects, no hidden SEO links, no honeypot as a normal sitemap page. Real site stays crawlable; decoy host stays separate.

Reference

What's in the box

Decoy surfaces and supporting gear. Full interactive tour on /features.

SOC console (Aetheris)

:8080

Presents as a real internal admin / SOC dashboard — login screen, JWT session, ops-looking UI — so credential stuffers and curious humans treat it like the prize.

  • Built to feel like a live admin console, not a thin login stub.
  • Before authentication, the login page embeds a WebRTC probe (STUN / ICE candidate discovery).
  • That path can reveal network addresses that bypass some VPN / proxy setups, and may expose a closer-to-real client IP when the browser cooperates.
  • Attribution is opportunistic supporting signal — not guaranteed against every VPN, browser hardening, or network policy.

SSH decoy

:22

Fake interactive shell that looks like a production jump box: banner, MOTD, shell history, and “emergency” files in a virtual home.

  • Move real admin SSH off :22 before publishing bait.
  • Planted paths and history push curious operators deeper into the decoy story.

MySQL decoy

:3306

Speaks a real-looking MySQL handshake so scanners fingerprint a database, then always returns Access denied.

  • Keeps automated DB scanners occupied on the familiar :3306 surface.
  • No real schemas, credentials, or data paths behind it.

Grafana decoy

:3000

Grafana-like UI with a healthy /api/health response so it looks like a live observability stack — login never succeeds.

  • Familiar dashboards and API shape attract scanners hunting misconfigured Grafana.
  • Auth stays fake; nothing connects to real metrics or production systems.

Honeytokens & canaries

tokens

Break-glass credentials, fake AWS keys, SSH keys, and PDF runbooks that deepen the story and light up when someone follows the bait.

  • Planted secrets look operational enough to be worth stealing.
  • Touching a canary is supporting evidence that the diversion worked.

Crawler lures

lures

robots.txt and sitemap.xml that advertise “forbidden” paths scanners love to hit.

  • Bait URLs in robots, sitemaps, HTML comments, and frontend metadata.
  • Crawlers and directory busters follow the map into rabbit holes.

Tarpits

tarpits

Waste automated scanning time with a fake log archive, gzip bomb, infinite indexes, request lag, and per-IP rate limits.

  • 1–9s artificial lag and rate limits slow noisy tooling.
  • Designed for bots and scanners — not to “hack back” at the source.

Activity visibility

logs

Local records of which decoys drew attention — HTTP, SSH, tokens, WebRTC probes, MySQL, Grafana.

  • Bounded, local retention (seven days by default).
  • Supporting evidence for diversion — not a SIEM replacement.

Sidecar-safe

sidecar

Runs beside the real site in an isolated Docker network with a read-only filesystem and soft-fail if a decoy port cannot bind.

  • Internal network cannot reach your DB or LAN.
  • Compose isolation, caps, and soft-fail keep the real site’s uptime first.

Tiny footprint

tiny

~23MB Alpine image with a static Go binary — no real DB or Grafana stack — capped so it cannot starve the site.

  • Default resource cap: 256MB RAM / 0.5 CPU.
  • Small enough for a solo VPS beside production.

Commands

Quick start

git clone https://github.com/h3ma209/krain-sec.git
cd krain-sec
cp .env.example .env          # edit HONEYTOKEN_BASE_URL when you go public
make prod                     # build + start the decoys

Hit the bait locally

  • Console (Aetheris) → http://127.0.0.1:8080
  • SSH → ssh admin@127.0.0.1
  • MySQL → 127.0.0.1:3306
  • Grafana → http://127.0.0.1:3000

Logs

Daily JSONL under ./logs — auth, HTTP, SSH, honeytokens, WebRTC, decoys. Retention default: 7 days. Passwords appear in auth-*.jsonl only — not stdout. Treat everything in there as hostile input.

Guardrails

Safety

  • Real SSH not on port 22 before you publish bait SSH.
  • No shared secrets or DB volumes between honeypot and real site.
  • Leave Compose isolation on (internal network, caps, read-only).
  • Still harden the real website.
  • Treat all captured attacker input as hostile data.

FAQ

FAQ

Does this replace real security hardening?

No. krain-sec gives commodity scanners believable decoys to investigate; it does not replace patching, backups, TLS, or locking down your real app. Treat it as bait that makes the real site look boring — not a shield.

Who is this good for?

Anyone whose VPS website keeps getting poked and wants the interesting-looking doors to be fake. Built for small teams and solo operators — also useful in labs for blue teams, detection engineers, researchers, and purple-team homelabs. Not a real SSO, SIEM, or production auth stack.

How is this different from “detect + log” honeypots?

Goal is controlled diversion, not only collecting alerts. krain-sec gives commodity scanners shinier fake doors — rabbit holes, decoy ports, planted secrets, and tarpits — that can hold opportunistic probes inside bait. Customers stay on 80/443 while decoy traffic remains isolated.

What does the Aetheris SOC console do?

It acts like a believable admin / SOC dashboard so probes treat it as the prize. Before login, a WebRTC probe may surface addresses beyond some VPN egress IPs. That signal is opportunistic — not guaranteed.

Is this legal to run?

Only on infrastructure you own or explicitly control. Not “hack back.” Bait passwords are fake — never reuse them for real access. krain-sec is licensed under AGPL-3.0.

Can I see what happens inside the decoys?

Yes. krain-sec keeps local activity records showing HTTP, SSH, honeytoken, WebRTC, MySQL, and Grafana interactions. They help you understand which bait worked, are retained for seven days by default, and never leave your server automatically.

Will it take down my cheap VPS?

Designed not to. Static Go on Alpine (~23MB), hard-capped at 256MB RAM / 0.5 CPU, internal network, read-only filesystem. Soft-fail: if SSH/MySQL/Grafana can’t bind, the HTTP bait keeps running.