AI-Augmented Adaptive Honeypot Framework
MIRAGE is an adaptive honeypot framework that traps, profiles, and deceives attackers using four coordinated deception protocols. Unlike passive honeypots that only log, MIRAGE actively wastes attacker resources, fingerprints their tools, extracts TTPs, plants trackable credentials, and alerts defenders in real time.
Key capabilities:
- πͺ Multi-protocol service emulation (SSH, Telnet, HTTP, FTP, MySQL, Redis)
- β³ Progressive time dilation that wastes attacker compute
- π Ghost network that fakes an entire corporate infrastructure
- πͺ€ Canary tokens that track stolen credentials across the internet
- π€ AI-powered attacker profiling and incident report generation
- π Real-time SOC dashboard with attack map and session drilldowns
- π Telegram alerting with structured, de-duplicated SOC notifications
This is a defensive security tool. No code in this repository attacks or exploits any system. The fake credentials, shells, and services exist solely to deceive attackers who have already targeted the honeypot. All testing is performed against localhost or controlled environments.
Attacker (internet)
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 1: Exposure Surface β
β SSH:22 HTTP:80 FTP:21 MySQL:3306 β
β Redis:6379 Telnet:23 HTTPS:443 β
β (Cowrie + OpenCanary in Docker) β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 2: Detection Engine β
β Fingerprint tools Β· Score threat β
β Classify intent Β· Decide protocol β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Layer 3: Protocol Router β
β Routes attacker to appropriate trap β
ββββ¬βββββββββββ¬βββββββββββ¬βββββββββββββ¬ββββββββ
β β β β
βΌ βΌ βΌ βΌ
DORMAMMU MIRAGE HYDRA CANARY
Time Service Ghost Token
dilation emulation network tracking
β β β β
ββββββββββββ΄βββββββββββ΄βββββββββββββ
β
βββββββββββββΌββββββββββββ
βΌ βΌ βΌ
AI Engine Dashboard Alerting
Profiler React UI Telegram
Every command response gets progressively slower, wasting attacker compute while logging everything.
Command #1: ~0.3s delay
Command #10: ~0.8s delay
Command #30: ~1.8s delay
Command #50: ~2.8s delay (max 5s)
Formula: delay = 0.3 + (cmd_count Γ 0.05) + random(0, 0.2)
When attackers run network scans, MIRAGE responds with a fake corporate network: 15 ghost hosts (gateway, db-primary, redis-cache, jenkins, gitlab, k8s-master, etc.) with consistent hostnames, IPs, MAC addresses, and port/service mappings.
After 3 commands, fake credential files appear in the virtual filesystem:
/root/.aws/credentialsβ fake AWS keys with embedded tracking ID/var/www/html/.envβ fake database password with tracking ID/root/.ssh/id_rsa_backupβ fake SSH key with tracking ID
If the attacker uses these credentials anywhere, the tracking ID enables attribution.
Cowrie (SSH/Telnet) and OpenCanary (HTTP, FTP, MySQL, Redis) provide realistic service frontends that log every interaction.
| Layer | Technology |
|---|---|
| SSH/Telnet honeypot | Cowrie (Docker) |
| Multi-protocol honeypot | OpenCanary (Docker) |
| Protocol engine | Python 3.11, asyncio, asyncssh |
| Backend API | FastAPI + uvicorn |
| Real-time comms | WebSocket |
| Frontend dashboard | React 18, Vite |
| AI profiling | Ollama (local LLM) |
| IP intelligence | AbuseIPDB |
| Alerting | Telegram Bot API |
| Containerization | Docker Compose (6 services) |
- Docker & Docker Compose
- Python 3.11+ (for simulation scripts)
- Ollama (optional, for AI profiling)
# Clone the repository
git clone https://github.com/your-org/mirage.git
cd mirage
# Configure environment
cp .env.example .env
# Edit .env with your Telegram token, AbuseIPDB key, etc.
# (Optional) Install Ollama for AI profiling
curl -fsSL https://ollama.ai/install.sh | sh
ollama pull qwen3:2b
# Launch all services
make up
# Verify everything is running
make ps| Service | URL |
|---|---|
| SOC Dashboard | http://localhost:3000 |
| Backend API | http://localhost:8000 |
| SSH Honeypot (Cowrie) | ssh root@localhost -p 22 |
| Interactive Shell (Demo) | ssh root@localhost -p 2222 |
make simulateThis sends a realistic multi-phase attack scenario (randomly chosen from 5 scenarios) to the backend. Watch the dashboard and Telegram for real-time events.
mirage/
βββ backend/ # FastAPI backend
β βββ Dockerfile
β βββ requirements.txt
β βββ main.py # API + WebSocket server
β βββ models.py # Pydantic event schemas
β βββ alerting.py # Telegram alerter (anti-spam)
β βββ storage.py # JSONL log read/write
β βββ pdf_report.py # PDF report generation
β
βββ protocols/ # Deception protocol engine
β βββ router.py # Protocol routing logic
β βββ interactive_server.py # asyncssh demo shell (port 2222)
β βββ Dockerfile
β βββ dormammu/
β β βββ dormammu.py # Shell trap + command handling
β β βββ virtual_fs.py # Fake filesystem layer
β β βββ time_dilation.py # Progressive delay formula
β βββ hydra/
β β βββ ghost_network.py # Fake internal network (15 hosts)
β βββ canary/
β β βββ canary_tokens.py # Token generation + planting
β β βββ token_store.py # Token β session mapping
β βββ mirage_svc/
β βββ service_router.py # Routes to fake services
β βββ fake_mysql.py # MySQL protocol emulation
β βββ fake_redis.py # Redis protocol emulation
β βββ fake_http.py # Fake admin panel
β
βββ ai_engine/ # AI-powered analysis
β βββ profiler.py # LLM-based session profiling
β βββ classifier.py # Rule-based tool fingerprinting
β βββ report_generator.py # Incident report builder
β βββ ip_enrichment.py # AbuseIPDB integration
β βββ threat_intel.py # Threat intelligence enrichment
β
βββ dashboard/ # React frontend
β βββ Dockerfile
β βββ package.json
β βββ src/
β βββ App.jsx
β βββ components/
β βββ EventFeed.jsx # Live event stream
β βββ SessionView.jsx # Per-session drilldown
β βββ AttackMap.jsx # Leaflet geolocation map
β
βββ logger/ # Log aggregation
β βββ watcher.py # Tails Cowrie JSON β backend
β βββ normalizer.py # Event format normalization
β
βββ alerting/ # Telegram notifications
β βββ bot.py # Interactive Telegram bot
β βββ templates.py # SOC-grade alert templates
β
βββ cowrie/ # Cowrie SSH honeypot config
β βββ cowrie.cfg
β βββ userdb.txt
β
βββ opencanary/ # OpenCanary config
β βββ Dockerfile
β βββ opencanary.conf
β
βββ tests/ # Test suite
β βββ simulate.py # Attack scenario simulator
β βββ smoke_test.sh # End-to-end smoke test
β βββ test_dormammu.py
β βββ test_canary.py
β βββ test_backend.py
β βββ test_ai_engine.py
β
βββ docs/ # Documentation
β βββ PROTOCOLS.md # Protocol design deep dive
β βββ DEPLOYMENT.md # Deployment guide
β βββ TESTING.md # Testing strategy
β βββ DEMO_SCRIPT.md # Hackathon demo walkthrough
β
βββ reports/ # Generated incident reports (gitignored)
βββ docker-compose.yml # Service orchestration
βββ Makefile # Dev commands
βββ .env.example # Environment variable template
βββ ARCHITECTURE.md # Technical architecture doc
βββ CHANGELOG.md # Version history
βββ SECURITY.md # Security policy
βββ LICENSE # MIT License
βββ README.md # β You are here
| Method | Endpoint | Description |
|---|---|---|
POST |
/event |
Ingest a honeypot event |
GET |
/events |
List events (with filters) |
GET |
/sessions |
List all attacker sessions |
GET |
/report/{session_id} |
Generate incident report |
GET |
/report/{session_id}/pdf |
Download PDF report |
GET |
/export/events |
Export events as JSON/CSV |
WS |
/ws |
Real-time event stream |
GET |
/health |
Liveness check |
Full API docs available at http://localhost:8000/docs (Swagger UI) when running.
# Run backend locally (hot reload)
make backend-dev
# Run dashboard locally (hot reload)
make dashboard-dev
# Run unit tests
make test
# Run smoke test against live stack
make test-smoke
# View logs
make logs