How tharun272004/ids-using-ml works
This is a Flask-based real-time network intrusion detection system. An operator starts packet scanning from the web console; captured packets are aggregated into flows, classified and checked by behavioral detectors, then correlated into a risk result recorded for dashboards and investigation. The app also serves analytics and report generation. README-documented model evaluation is a separate offline capability. Some route and storage wiring is not visible in the excerpts, so uncertain links are omitted or identified as documented.
Main entry points: live_predictor.py Flow aggregation · evaluate_ids.py Offline evaluation · app.py Flask routes · risk_engine.py Unified risk
Components 14
Traffic Capture
- Packet scanner
packet_capture/live_predictor.py - Flow aggregation
packet_capture/live_predictor.py
Detection and Risk
- ML classification
packet_capture/live_predictor.py - DNS tunneling
ml/dns_tunneling.py - C2 beaconing
ml/c2_detector.py - Exfiltration
ml/exfiltration_detector.py - Unified risk
ml/risk_engine.py - Prediction log
data/live_predictions.csv
Web Console
- Flask routes
app.py - Monitoring console
templates/live_monitoring.html - Dashboard
static/js/dashboard.js - PDF reporting
report/generate_report.py
Evaluation
- Offline evaluation
evaluation/evaluate_ids.py
Other components
- Network operator
Connections 18
- Network operator → Monitoring console: starts scanning
README.md - Monitoring console → Flask routes: controls scanner
README.md - Flask routes → Packet scanner: starts scanning
- Packet scanner → Flow aggregation: aggregates packets
packet_capture/live_predictor.py - Flow aggregation → ML classification: classifies flows
packet_capture/live_predictor.py - Flow aggregation → DNS tunneling: analyzes DNS
packet_capture/live_predictor.py - Flow aggregation → C2 beaconing: checks beaconing
packet_capture/live_predictor.py - Flow aggregation → Exfiltration: checks uploads
packet_capture/live_predictor.py - Flow aggregation → Unified risk: correlates signals
packet_capture/live_predictor.py - Unified risk → Prediction log: records alerts
- Flask routes → Prediction log: reads predictions
- Dashboard → Flask routes: requests analytics
static/js/dashboard.js - Flask routes → PDF reporting: generates report
app.py - Offline evaluation → DNS tunneling: evaluates detector
evaluation/evaluate_ids.py - Offline evaluation → C2 beaconing: evaluates detector
evaluation/evaluate_ids.py - Offline evaluation → Exfiltration: evaluates detector
evaluation/evaluate_ids.py - Offline evaluation → Unified risk: evaluates scoring
evaluation/evaluate_ids.py - Offline evaluation → Flow aggregation: benchmarks live path
evaluation/evaluate_ids.py