A containerized SSH honeypot that traps brute-force bots by slowly feeding them randomized SSH banners, delaying their attacks and gathering data.
- Sends authentic SSH banners, custom messages, or random gibberish
 - Detects and analyzes attack patterns
 - Generates detailed summary reports
 - Exports data in TXT, JSON formats, or directly to AbuseIPDB API
 
docker compose up --build -d
docker exec endlessh python endlessh.py reportOutput example:
# ============================================================
#            SSH HONEYPOT ATTACK ANALYSIS REPORT
# ============================================================
# 
# 📊 OVERVIEW:
#    Total Sessions: 156
#    Total Auth Attempts: 487
#    Unique IP Addresses: 42
#    Average Session Duration: 45.3s
#    Longest Session: 312.7s
# 
# 🎯 TOP ATTACKING IPs:
#    192.168.1.100   -  23 attempts
#    10.0.0.45       -  18 attempts
#    172.16.0.33     -  15 attempts
# 
# 👤 MOST COMMON USERNAMES:
#    admin           -  89 attempts
#    root            -  67 attempts
#    user            -  34 attempts
# 
# 🔐 MOST COMMON PASSWORDS:
#    123456          -  45 attempts
#    password        -  38 attempts
#    admin           -  29 attempts
# 
# 🚨 ATTACK PATTERNS:
#    brute_force     -  23 incidents (severity: 8.2)
#    dictionary_attack -  18 incidents (severity: 7.1)
#    rapid_connections -  12 incidents (severity: 8.9)Monitor activity every 5 seconds:
docker exec -it endlessh python endlessh.py monitorMonitor with custom interval (10 seconds):
docker exec endlessh -it python endlessh.py monitor 10Output example:
# Real-time monitoring started (Press Ctrl+C to stop)
# --------------------------------------------------
# 
# [14:25:30] New Activity:
#   🔗 New session: 192.168.1.100
#   🔐 Auth attempt: 192.168.1.100 - admin:password123
#   🔐 Auth attempt: 192.168.1.100 - root:admin
#   🚨 Attack pattern: 192.168.1.100 - brute_forceExport to default file (attack_data.json):
docker exec -it endlessh python endlessh.py exportExport to custom file:
docker exec -it endlessh python endlessh.py export my_attack_data.jsonExport to TXT file for any blacklist:
docker exec -it endlessh python export_to_blacklist.pyTo automatically report all IPs to AbuseIPDB you need to setup api key in config.yaml:
abuseipdb_api_key: "IMSERT YOUR API KEY HERE"and then configure a cron to run it daily:
30 23 * * * docker exec endlessh /usr/bin/python3 report_abuseipdb.pyThese attack patterns are currently detected:
- 
Brute Force (severity: 8)
- Multiple authentication attempts in single session
 - Triggers when ≥3 authentication attempts
 
 - 
Dictionary Attack (severity: 7)
- Use of common passwords
 - Triggers when ≥2 common passwords used
 
 - 
Username Enumeration (severity: 6)
- Attempting suspicious usernames
 - Triggers when ≥2 suspicious usernames used
 
 - 
Rapid Connections (severity: 9)
- Multiple connections from same IP
 - Triggers when ≥5 connections in 1 hour
 
 - 
Long Session (severity: 4)
- Unusually long session duration
 - Triggers when session >5 minutes
 
 
The honeypot simulates these shell commands:
whoami- Returns "user"pwd- Returns current directoryls- Lists fake filesps/ps aux- Shows fake processesuname -a- Shows fake system infocat /etc/passwd- Shows fake user accountsifconfig/ip addr- Shows fake network confignetstat -an- Shows fake network connectionscd- Changes fake directoryhistory- Shows fake command historyexit/logout- Closes session
These logs are generated:
connections.log- Standard connection logshoneypot.db- SQLite database with detailed attack data- Console output/docker log - Real-time activity information
 
For high-traffic environments I recommend:
- Adjusting 
min_delayandmax_delayfor faster responses - Reducing 
session_timeoutfor resource management 
Common issues and solutions:
- Port already in use: Change the port in config.yaml
 - Database locked: Ensure only one instance is running
 - High CPU usage: Increase delays or implement rate limiting
 - Permission denied: Ensure proper file permissions
 
Heavily inpired by skeeto/endlessh
- New Attack Patterns: Add detection logic to 
AttackPatternDetector - More Shell Commands: Extend 
FakeShellHandler - Protocol Support: Enhance 
SSHProtocolHandler - Custom Responses: Modify response generation logic
 - Integration: Add webhooks or API endpoints
 - IP Limiting: Implement connection limits per IP
 - DB Improvements - Use database connection pooling and async database operations