💡 Inspiration
Traditional honeypots suffer from a fatal dilemma:
- Low-Interaction Honeypots rely on rigid, static command scripts that modern threat actors and automated botnet scanners detect within seconds. Attackers immediately notice broken POSIX pipes, missing flags, non-standard outputs, or unrealistic responses and quickly disconnect.
- Full-Interaction Honeypots require running real isolated virtual machines. These demand constant maintenance, carry severe sandbox breakout / VM escape risks, and bury defenders under gigabytes of raw, unstructured alert noise. We asked ourselves: > "What if an attacker wasn't breaking into a vulnerable operating system, but rather an isolated, generative POSIX simulation that dynamically wastes their time, baits them with honey-tokens, and autonomously synthesizes their tactics into actionable CISO-level threat intelligence?" That vision led to the birth of ShadowHoneypot. --- ## 🎯 What It Does ShadowHoneypot is an end-to-end autonomous cyber deception and threat intelligence platform:
- 🧠 Zero-AI-Leak Bash Simulation: Simulates an authentic enterprise Ubuntu 24.04 LTS database server (
prod-db-internal-01). The shell handles compound commands, pipes, directory traversal, exit codes, and realistic POSIX error streams without breaking character or leaking conversational AI disclaimers. - 🪤 Dynamic Canary Token Baits: Strategically plants high-value honey-tokens across the filesystem (salted
/etc/shadowhashes, developer history with canary AWS keysAKIA_CANARY_TRAP_99, fake PostgreSQL database dumps) to lure attackers into revealing their intent. - 🗺️ Real-Time MITRE ATT&CK Mapping: Every command entered by the adversary is classified on the fly against the enterprise Linux matrix (e.g.,
T1033 User Discovery,T1082 System Info Discovery,T1552.003 Bash History Credentials,T1003.008 Shadow Dumping), calculating a dynamic 0–100 threat score. - 🚨 Canary Tripwire Strobe Alarm: The millisecond an adversary touches or
cats an injected canary secret, the system triggers an emergency alert (Threat Score: 100/100 [CRITICAL]) and pulses a visual strobe alarm on the SOC dashboard. - 📄 Autonomous Incident Intelligence Reports: With a single click, Gemini 3.8 Flash synthesizes raw session telemetry into an executive TLP:AMBER incident report featuring an attack chain timeline, adversary methodology, IOC tables, and hardened remediation commands.
* 🖥️ Dark-Mode SOC Command Center: A glassmorphic FastAPI and Tailwind CSS dashboard providing live attack feed polling, MITRE tactic badges, and deep-dive session forensics.
🏗️ Architecture & System Flow
+-------------------------------------------------------------------------------+
| ADVERSARY / BOTNET RECONNAISSANCE |
+-------------------------------------------------------------------------------+
|
[SSH Port 2222: Fake OpenSSH 9.6p1]
v
+-------------------------------------------------------------------------------+
| ASYNCHRONOUS SSH TRAP DAEMON |
| • Credential Harvesting (Captures user/pass: root:admin123) |
| • Non-blocking PTY terminal emulation with live keystroke echoing |
+-------------------------------------------------------------------------------+
| |
(Raw Keystrokes) (Raw Commands)
v v
+---------------------------------------+ +---------------------------------------+
| GEMINI 3.8 FLASH SHELL ENGINE | | REAL-TIME TELEMETRY ENGINE |
| • Low-latency POSIX simulation | | • MITRE ATT&CK taxonomy classifier |
| • Zero AI conversational leaks | | • Canary token tripwire detector |
| • Realistic Ubuntu 24.04 outputs | | • Dynamic threat scoring (0-100) |
| • Injected AWS canary secrets | | • Forensic JSON audit persistence |
+---------------------------------------+ +---------------------------------------+
\ /
\ /
v v
+-------------------------------------------------------------------------------+
| FASTAPI SOC DASHBOARD & INTELLIGENCE API |
| • Real-time attack feed auto-refresh (Live glass pane) |
| • Canary exfiltration strobe alarm |
| • One-Click Autonomous Incident Intelligence Report via Gemini 3.8 Flash |
+-------------------------------------------------------------------------------+
End-to-End Operational Lifecycle:
- Infiltration & Ingress: The adversary initiates a connection on SSH port
2222. The AsyncSSH daemon captures their credentials, initiates an interactive Pseudo-Terminal (PTY), and displays an authentic Ubuntu 24.04 MOTD banner. - Generative Simulation: As commands are typed, the Gemini 3.8 Flash Shell Engine dynamically evaluates the execution context with sub-second latency, responding with exact Linux STDOUT/STDERR formats without AI pleasantries.
- Telemetry & Tripwires: In parallel, the telemetry engine correlates commands against the MITRE ATT&CK framework and checks against seeded canary tokens.
4. Autonomous Response: The forensic session is audited into JSON storage and reflected immediately in the dark-mode SOC dashboard. An analyst can generate a full TLP:AMBER security assessment in one click.
🛠️ How We Built It
- Core AI Deception Engine: Built in Python using the official Google GenAI SDK (
google-genai). We engineered a strict POSIX behavioral prompt forgemini-3.8-flashwith zero-budget low-latency configuration (thinking_level="low"), ensuring authentic bash execution and sub-second terminal response times. - Asynchronous Trap Daemon: Built on
asyncsshandasyncio, mimicking an authentic OpenSSH 9.6 banner and authentic Ubuntu MOTD. The daemon offloads LLM processing to non-blocking worker threads to maintain responsive PTY keystroke echoing and multi-line command safety. - Threat Scoring & Taxonomy: Developed an in-memory telemetry analyzer tracking the MITRE ATT&CK matrix and cross-referencing commands against known honeypot canary strings.
- SOC Web Dashboard: Developed using FastAPI, Uvicorn, and a responsive Tailwind CSS / JetBrains Mono glassmorphism UI that automatically polls session changes and renders rich markdown security briefs.
* Containerization: Packaged with Dockerfile and docker-compose.yml for unified, single-command deployment.
⚡ Challenges We Ran Into
- PTY Keystroke Echoing & Asyncio Deadlocks: Early prototypes faced terminal freezing when multi-line commands were pasted, because synchronous network calls blocked the asyncio event loop. We resolved this by isolating the shell engine execution inside
asyncio.to_threadand leveraging AsyncSSH's native line editor with PTY support. - Eliminating AI Conversational Leakage: Large language models naturally want to be helpful assistants. Getting Gemini to operate strictly as an Ubuntu 24.04 kernel—returning raw STDOUT/STDERR with exact error formats (
command not found) and authentic salted password hashes without any conversational filler—required rigorous behavioral prompt refinement.
* Transitioning to Gemini 3.8 Flash: When older endpoints were deprecated, we seamlessly migrated to the latest Gemini 3.8 Flash architecture, adjusting latency settings to retain high throughput.
🏆 Accomplishments That We're Proud Of
- 🎯 Indistinguishable Shell Emulation: Emulating bash so convincingly that a tester or exploit scanner cannot distinguish the environment from a real production machine.
- ⚡ Dual-Role Gemini Orchestration: Building a dual-mode application for Gemini: using it both at runtime as an interactive shell engine and post-exploitation as an autonomous cybersecurity threat analyst.
* 🛡️ Zero-Cost Enterprise Defense: Creating a zero-cost, fully functional deception stack that small businesses and blue teams can deploy in minutes without expensive enterprise SIEM licenses.
📚 What We Learned
- Advanced asynchronous network programming and how PTY (Pseudo-Terminal) sessions handle keystroke buffering and CRLF transformations.
- How to structure deception traps to capture early attacker intent through canary tokens before lateral movement occurs.
* How to prompt and optimize modern LLMs for deterministic system emulation rather than conversational chat.
🔮 What's Next for ShadowHoneypot
- 📂 Dynamic File Injection: Allowing defenders to upload custom proprietary files that the engine automatically seeds with honeypot canary tokens.
- 🔔 Automated Webhooks: Instant Slack, Discord, and PagerDuty alerts triggered the millisecond a critical canary token is accessed.
- 🌐 Multi-Protocol Deception: Expanding beyond SSH to simulate vulnerable Redis, MongoDB, and Docker daemon API ports.
Built With
- asyncssh
- cybersecurity
- docker
- docker-compose
- fastapi
- gemini-api
- google-genai
- honeypot
- jinja
- linux
- mitre-attack
- pydantic
- python
- tailwind-css
- threat-intelligence
- uvicorn
- websockets