How karuna-ss/blacktrace works
BlackTrace is a host-based intrusion detection system: it captures network traffic, turns packet windows into features, scores them with an Isolation Forest, and exposes results to a monitoring dashboard. A separate training path fits and saves the model from a balanced CSV dataset. The dashboard polls the latest inference and presents threat status, trends, and attacker-IP information. Evidence is limited to the supplied excerpts and source index; the README is empty, so undocumented capabilities and unshown connections are omitted.
Main entry points: feature_extraction.py Packet capture and windows · app.py Inference API · model_training.py Model training · IsoForest.pkl Isolation Forest model
Components 11
Traffic capture
- Packet capture and windows
Backend/Intrusion/sliding_window/feature_extraction.py - Packet decoding
Backend/Intrusion/scapy/packets.py - Traffic feature CSV
Backend/Data/Intrusion.csv
Detection and training
- Balanced training data
Backend/Data/Intrusion_fixed_balanced.csv - Model training
Backend/Detection/model_training.py - Isolation Forest model
Backend/models/IsoForest.pkl - Inference runner
Backend/Detection/model_inference.py
Inference service
- Inference API
Backend/app.py
Monitoring interface
- Threat monitoring dashboard
Frontend/js/dashboard.js
Other components
- Network traffic
- Security analyst
Connections 9
- Network traffic → Packet capture and windows: supplies traffic
Backend/Intrusion/sliding_window/feature_extraction.py - Packet capture and windows → Packet decoding: decodes packets
Backend/Intrusion/sliding_window/feature_extraction.py - Packet capture and windows → Traffic feature CSV: writes features
Backend/Intrusion/sliding_window/feature_extraction.py - Balanced training data → Model training: provides samples
Backend/Detection/model_training.py - Model training → Isolation Forest model: saves model
Backend/Detection/model_training.py - Isolation Forest model → Inference API: loads model
Backend/app.py - Packet capture and windows → Inference API: provides latest features
Backend/app.py - Inference API → Threat monitoring dashboard: serves latest inference
Frontend/js/dashboard.js - Security analyst → Threat monitoring dashboard: monitors alerts