TomandClaude Opus 5.5 b8328f6998
Build and deploy / build (push) Successful in 1m28s
Build and deploy / deploy (push) Successful in 20s
Release / image (push) Successful in 1m48s
Release / release (push) Successful in 7s
Add changelog entry for 0.1.1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 12:52:49 +01:00
2026-11-15 12:50:10 +01:00
2026-11-15 12:52:49 +01:00
2026-11-14 16:19:44 +01:00
2026-11-15 12:50:10 +01:00

Flypaper

An HTTP tarpit for scanning bots. Instead of blocking the bots that probe your server for /.env, /.git/config or /wp-login.php, Flypaper lets them in and answers with an endless HTML page, a few bytes at a time. While a scanner waits, it isn't scanning someone else, and the dashboard shows you who knocked: country, network provider and what they were after.

How it works

flowchart LR
    bot["Scanner bot"] -->|"GET /.env<br/>Host: 203.0.113.7"| proxy["Reverse proxy"]
    proxy -->|"known site"| apps["Your apps"]
    proxy -->|"unknown host or trap path<br/>+ X-Real-IP"| flypaper["Flypaper"]
    flypaper -.->|"endless HTML,<br/>a few bytes at a time"| bot
    flypaper --> db[("SQLite:<br/>catches, settings")]
    you["You (LAN)"] -->|"dashboard, port 8081"| flypaper
  • Your reverse proxy sends everything it has no site for (its catch-all server) to Flypaper's trap port 8080.
  • Every request there gets 200 OK and an endless page in random chunks with random pauses, within limits per IP, overall and per catch.
  • Each catch is logged and stored with its origin (DB-IP GeoIP); the dashboard on port 8081 shows maps and tables.

More: how it works and all features.

Quick start

docker run -d --name flypaper --restart unless-stopped \
  -p 8080:8080 -p 127.0.0.1:8081:8081 \
  -v flypaper-data:/data \
  gitea.anticarnist.de/tom/flypaper:latest

Or with Compose:

services:
  flypaper:
    image: gitea.anticarnist.de/tom/flypaper:latest
    container_name: flypaper
    restart: unless-stopped
    ports:
      - "8080:8080"             # trap
      - "127.0.0.1:8081:8081"   # dashboard
    volumes:
      - flypaper-data:/data

volumes:
  flypaper-data:

Port 8080 is the trap, port 8081 the dashboard (keep it in your LAN), and /data holds the database, login keys and GeoIP files. Images exist for linux/amd64 and linux/arm64. Open http://localhost:8081: the first visit sets the admin password (changeable later on the settings page). Try the trap with curl -N http://localhost:8080/.

On Unraid, use the template: docs/unraid.md.

Connect your reverse proxy

Make Flypaper the target of your proxy's catch-all (default) server on port 8080, so every request for a host you don't serve lands in the trap. The proxy must set X-Real-IP; Flypaper trusts proxies in private networks by default. Turn off response buffering so the drip reaches the bot.

Plain nginx, with Flypaper on the same host:

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_buffering off;
        proxy_read_timeout 1h;
    }
}

Nginx Proxy Manager, Caddy, Traefik and bait paths on your real domains: docs/reverse-proxy.md.

Configuration

Nothing is required. The most useful optional environment variables:

Variable Purpose
Flypaper__Admin__Password Fixes the dashboard password instead of setting it on first visit
Flypaper__Http__TrustedProxies__0 Proxy IP or CIDR allowed to set X-Real-IP (default: private networks)
Flypaper__Http__KnownHosts__0 Host that is caught only on trap paths
TZ Time zone for the dashboard

Trap paths, limits and retention are changed on the dashboard's settings page. All variables and settings: docs/configuration.md.

Security

  • Keep the dashboard port 8081 internal; never forward it from your public proxy.
  • Set the admin password right after the first start: until then, anyone who reaches the dashboard can set it.
  • The limits protect your own bandwidth and sockets, keep them below what your proxy can handle.

Development

dotnet build                              # .NET 10 SDK
dotnet test
dotnet run --project src/Flypaper.Web     # dashboard :5248 (password "dev"), trap :5247

Details and project layout: docs/development.md.

Versions

Use :latest for the newest release or pin :X.Y.Z; changes are listed in CHANGELOG.md, tags and updates in docs/releases.md. The author's own Unraid deployment lives in deploy/unraid/.

Attribution and license

IP Geolocation by DB-IP (CC BY 4.0), world map from Natural Earth (public domain). Flypaper is MIT licensed; third-party data keeps its own license.

S
Description
Self-hosted tarpit that traps and slows down scanning bots, with event logging and analysis.
Readme MIT
1.5 MiB
0 Stars 1 Watchers 0 Forks
2026-12-03 22:27:35 +01:00
Languages
C# 80.1%
HTML 13.1%
CSS 5%
JavaScript 1.4%
Dockerfile 0.3%