selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Knock-Knock logo

Self-host Knock-Knock

v3.0.0

Multi-protocol honeypot with live attack dashboard

ReleaseOpen SourceMIT
Updatedlast week
LanguagePython
Setup difficultyAdvanced
MobileResponsive
Stars
214
Ports
8080 (web dashboard), 22 (SSH honeypot), 21 (FTP honeypot), 23 (Telnet honeypot), 25 (SMTP honeypot), 80 (HTTP honeypot), 445 (SMB honeypot), 587 (SMTP submission honeypot), 3389 (RDP honeypot), 5060 (SIP honeypot (TCP/UDP))
Requires
MaxMind GeoIP databases (GeoLite2-ASN, GeoLite2-City), Redis
Docker
ghcr.io/djkurlander/knock-knock
Install with Docker Compose
Knock-Knock desktop dashboard showing live attack feed, globe view, and statistics panelsMobile feed pane showing live attack attemptsMobile globe view paneMobile usernames paneMobile passwords paneMobile statistics paneMobile trivia pane

What is Knock-Knock?

This project is a honeypot platform that simulates vulnerable network services to attract and study automated attack traffic. It emulates common protocols like SSH, FTP, remote desktop, mail, and voice services, then presents the captured intrusion attempts in a browser-based dashboard with live maps, ranked lists of usernames and passwords, and geographic breakdowns. The system uses MaxMind geolocation to enrich each connection attempt, stores data in SQLite with Redis for real-time updates, and exposes a FastAPI web interface. It can aggregate feeds from multiple sensors into one view and publishes a blocklist of offending addresses that works with popular firewall tools. Deployment options include containerized setups with Docker Compose or traditional service units on major Linux distributions. A server with a public address and root privileges is needed, and the real SSH daemon must be relocated off the standard port.

Should you self-host Knock-Knock?

Knock-Knock scores 48/100 on selfhost.directory (how scoring works) and ranks #49 of 78 in Security. It has 214 GitHub stars.

It shipped 5 stable releases in the past year. The latest, v3.0.0, came out on 26 July 2026. New versions land roughly every 5 weeks.

Setup is advanced: plan for several services and some ongoing maintenance. An official Docker image is available. It is MIT-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is pentagi (83/100, 32 653 stars). It scores higher overall, so compare the two before you pick. See Knock-Knock vs pentagi side by side.

Features

  • 3D globe visualizations
  • Attack trivia
  • Auto-ban repeat offenders
  • Credential leaderboards
  • Extensible protocol framework
  • Geographic attack analysis
  • HTTPS Support
  • IP blocklist feed
  • Knock-knock jokes
  • Live attack feed
  • Multi-protocol honeypot
  • Multi-server aggregation
  • Protocol statistics
  • Self IP redaction
  • Visitor logging

Knock-Knock README

How to install Knock-Knock

Install Knock-Knock with Docker Compose

Docker, Docker Compose, Linux server with root access, public IP

Pull and start (uses pre-built image from ghcr.io)

docker compose up -d

Recommended for Linux servers. Uses host networking so honeypots see real attacker IPs. Requires moving real SSH off port 22.

How to configure Knock-Knock

  • AGGREGATOR_HOSTAggregator hostname/IP for feeder mode

    Aggregator hostname/IP for feeder mode

  • AGGREGATOR_PORT9999Aggregator port for feeder mode

    Aggregator port for feeder mode

  • BAN_DURATION30Auto-ban duration in days (0 = permanent)

    Auto-ban duration in days (0 = permanent)

  • COMPOSE_FILEdocker-compose.host.ymlDocker Compose file to use (docker-compose.host.yml for host networking, docker-compose.yml for bridge)

    Docker Compose file to use (docker-compose.host.yml for host networking, docker-compose.yml for bridge)

    values: docker-compose.host.yml, docker-compose.yml

  • ENABLE_APIfalseEnable the /api docs page (requires separate knock-api service)

    Enable the /api docs page (requires separate knock-api service)

    values: true, false

  • ENABLE_BLOCKLISTfalseEnable the /blocklist feed page (requires hourly feed-builder cron)

    Enable the /blocklist feed page (requires hourly feed-builder cron)

    values: true, false

  • ENABLED_PROTOCOLSSSH,TNET,FTP,RDP,SMB,SIP,HTTP,SMTPComma-separated list of protocols to run (SSH,TNET,FTP,RDP,SMB,SIP,HTTP,SMTP,MQTT,NRED,MODB)

    Comma-separated list of protocols to run (SSH,TNET,FTP,RDP,SMB,SIP,HTTP,SMTP,MQTT,NRED,MODB)

    values: SSH,TNET,FTP,RDP,SMB,SIP,HTTP,SMTP,MQTT,NRED,MODB

  • ENABLE_SSLfalseEnable HTTPS for the web dashboard

    Enable HTTPS for the web dashboard

    values: true, false

  • EXCLUDE_PANELSComma-separated list of dashboard panels to hide

    Comma-separated list of dashboard panels to hide

    values: FEED, GLOBE, LOC, USER, PASS, ISP, IP, LAST, STATS, TRIVIA, JOKES, ABOUT

  • INGEST_PORT9999TCP port to receive knock streams in aggregator mode

    TCP port to receive knock streams in aggregator mode

  • KNOCK_CERTFILEcerts/cert.pemPath to SSL certificate file

    Path to SSL certificate file

  • KNOCK_KEYFILEcerts/key.pemPath to SSL private key file

    Path to SSL private key file

  • LOG_UNHANDLED_HTTPfalseLog unhandled HTTP 404s to web server log

    Log unhandled HTTP 404s to web server log

    values: true, false

  • LOG_VISITORSfalseLog dashboard visitors to data/visitors.db

    Log dashboard visitors to data/visitors.db

    values: true, false

  • MAX_KNOCKSAuto-ban IPs after N total knocks (global, per-protocol, or mixed)

    Auto-ban IPs after N total knocks (global, per-protocol, or mixed)

    values: e.g. 5000, 5000,RDP:1000,SIP:NONE

  • MAXMIND_ACCOUNT_IDMaxMind account ID for GeoIP database downloads

    MaxMind account ID for GeoIP database downloads

  • MAXMIND_LICENSE_KEYMaxMind license key for GeoIP database downloads

    MaxMind license key for GeoIP database downloads

  • MODB_VENDORSchneider ElectricModbus device vendor identity

    Modbus device vendor identity

  • REDACT_SELF_DOMAINSDomains to redact from knock output

    Domains to redact from knock output

  • REDACT_SELF_HOSTSHostnames to redact from knock output

    Hostnames to redact from knock output

  • REDACT_SELF_IPSIP addresses to redact from knock output (self-protection)

    IP addresses to redact from knock output (self-protection)

  • REDIS_DB0Redis database number

    Redis database number

  • REDIS_HOSTlocalhostRedis host

    Redis host

  • SAVE_KNOCKSfalseSave individual knock records to SQLite (true=all, comma-separated=selective)

    Save individual knock records to SQLite (true=all, comma-separated=selective)

    values: true, false, comma-separated protocol list

  • SIP_OK_DIALPLAN+,bare,00,011,9Which dialed forms the fake PBX answers vs rejects

    Which dialed forms the fake PBX answers vs rejects

    values: all, none, comma-separated prefixes

  • SMB_QUARANTINE_DIRDirectory to save files uploaded by attackers

    Directory to save files uploaded by attackers

  • SMTP_FINGERPRINTpostfixMTA fingerprint to emulate

    MTA fingerprint to emulate

    values: postfix, exim, sendmail, exchange

  • SMTP_HOSTNAMEreverse DNS of server IPOverride SMTP banner hostname

    Override SMTP banner hostname

  • SMTP_SAVE_HEADERSfalseCapture redacted raw SMTP DATA headers into database

    Capture redacted raw SMTP DATA headers into database

    values: true, false

  • SOURCE_IDhostnameShort name for this server shown in the dashboard

    Short name for this server shown in the dashboard

  • SSH_PROFILEopenssh_8_9_ubuntuSSH banner/fingerprint profile to emulate

    SSH banner/fingerprint profile to emulate

  • TRACE_KNOCKfalseLog each knock to stdout/journal

    Log each knock to stdout/journal

    values: true, false

  • WEB_PORT8080Port the web UI listens on

    Port the web UI listens on

  • WEB_WORKERS2Number of uvicorn worker processes (systemd only)

    Number of uvicorn worker processes (systemd only)

Knock-Knock releases & version history

More in Network Security

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…