projects/steelhaze
Eneuss / SteelHaze
Network Security Monitor
A Raspberry Pi that watches my network and flags new devices and known CVEs.
overview
SteelHaze is a self-hosted network security monitor for home and small-office networks, built for a Raspberry Pi as my final-year dissertation, which was awarded First Class. It scans the network, watches traffic, flags anomalies, looks up known CVEs and shows everything on a web dashboard. One command starts both the monitor loop and the dashboard.
What it does
- Finds devices: an nmap scan of the local subnet every 30 seconds, plus passive detection (an ARP sniffer and the kernel ARP cache) to catch devices that don't respond to nmap, such as IoT, AP-isolated or stealthy hosts.
- Monitors traffic: bytes and packets per device, captured with Scapy.
- Checks for known vulnerabilities: every 30 minutes a deep scan runs a full port scan, detects service versions and queries the National Vulnerability Database. A new device triggers an immediate scan.
- Flags anomalies: high traffic, new unknown devices, stealth (passive-only) devices and CVE findings.
- Keeps history per network: each Wi-Fi network (by SSID) gets its own SQLite database, and the active one switches automatically when you roam to a different network.
- Dashboard: pages for devices, traffic and anomalies over the last 24 hours, open ports and CVEs per host, and charts of devices per day, CVE severity, top traffic and anomalies per day. You can mark devices as known and give them names.
- Optional Telegram alerts: real-time alerts for new or stealth devices and HIGH or CRITICAL CVEs, scheduled PDF reports at 08:00 and 20:00, and an on-demand report by sending
/reportto the bot. - Optional e-paper display: a Waveshare 2.13" screen shows the SSID, subnet, external IP, device and unknown-device counts, anomalies and CVEs.
How it's built
- Python, with Flask for the dashboard and its JSON API, and vanilla JavaScript with Chart.js for the pages.
- python-nmap for active scans, Scapy for the passive ARP and traffic sniffers, and netifaces to read the default interface, gateway and subnet.
- requests for the NVD CVE API and Telegram, and fpdf2 with matplotlib for the PDF reports.
- SQLite for storage, one database file per network, in WAL mode so the dashboard can read while the monitor writes. Everything runs in one Python process.
- Active and passive discovery work together: a device that stops answering nmap but still sends ARP traffic is downgraded to passive instead of being dropped.
- The deep scan makes all its NVD requests before opening the database, to keep locks short, and only clears old results for hosts it found, so a device that is offline during a scan keeps its CVE history. The NVD lookup is a keyword search on product and version, so matches are likely rather than exact.
- It runs as root, because Scapy needs raw sockets and nmap needs elevated privileges to read MAC addresses. Without root the dashboard still loads, but MAC addresses, passive detection and traffic stats stay empty.
- The optional parts fail safely: with no Telegram config or no display connected, the monitor runs exactly the same.