Who Is This For?
| Audience | Use case |
|---|---|
| Security operators | Monitor live network traffic, review the IPS block table, and manually unblock IPs |
| SOC analysts | Investigate detected attack events stored in SQLite with full metadata (timestamp, IP, protocol, port, confidence) |
| Students | Learn how a real IDS is structured — from raw packet parsing through ML inference to firewall enforcement |
| Researchers | Retrain the ensemble model on new datasets using CEREBRO.py, or extend the heuristic detectors in ids.py |
Core Capabilities
6 Attack Detectors
Heuristic rules for SYN Flood, DDoS, Port Scan, Exploit attempts, SQL Injection, and UDP Flood — each tuned to avoid false positives on normal browsing traffic.
ML Classification
A VotingClassifier ensemble (Random Forest + MLP + XGBoost) trained with SMOTE balancing on 20,000 synthetic records. Achieves 91.90% accuracy. Predictions are shown inline with confidence percentages, e.g.
SYN Flood (ML: 98.4%).Automatic IP Blocking
The IPS layer calls
New-NetFirewallRule via PowerShell to create inbound block rules. Blocks auto-expire after 60 seconds via a daemon thread. Falls back to “Bloqueo simulado” when not running as Administrator.Telegram Alerts
Every confirmed attack triggers an async HTTP POST to the Telegram Bot API. Runs in a daemon thread so HTTP latency never stalls packet capture.
SOC GUI Dashboard
A PyQt5 window with a live traffic panel, an events table with per-attack-type color coding, an IPS block table with live countdowns, and an embedded Matplotlib chart — all updated via Qt signals across threads.
SQLite Persistence
All detected attacks are written to an
ataques table and all blocks to a bloqueos table in intrusiones.db. Parametric placeholders prevent second-order SQL injection into the IDS’s own database.Key Design Decisions
Graceful degradation — heuristic fallback
Every ML component is loaded inside atry/except block. If any .pkl file is missing, the corresponding variable is set to None and the system continues with heuristic-only detection:
Confidence-gated ML verdicts
The system does not blindly trust the ML model. The 70% confidence threshold governs how labels are composed:Whitelist and CIDR filtering
To avoid false-positive alerts on CDN and cloud traffic, the exploit and SQL injection detectors check every source IP against an explicit set and a list of CIDR ranges before firing:Thread-safe Qt signal architecture
Scapy’sAsyncSniffer runs in its own thread. The PyQt5 UI runs in the main thread. Direct cross-thread widget calls are not safe in Qt. ComunicadorIDS solves this by acting as a signal bus — the sniffer thread emits, the UI slot receives, and Qt’s event loop marshals the call safely:
Admin-aware simulated blocking
If the process is not running with Administrator privileges,New-NetFirewallRule will fail. Rather than crashing or silently ignoring the failure, the system records 'SIMULADO' in the bloqueos table and emits a “Bloqueo simulado” event to the IPS panel, preserving full audit visibility: