All projects
Network Topology Scanner
Scans a network with Nmap, builds the topology as a graph with NetworkX and exports it as interactive HTML with PyVis.
- Type
- Personal project
- Date
- 2026 — Present
- Role
- Sole author
- Source
- GitHub
01Technical summary
A Python tool that turns a network range into a map. Nmap discovers the live hosts and their open ports and services; the results become a NetworkX graph, and PyVis renders that graph as an interactive HTML page you can open in any browser.
It is aimed at inventory and quick auditing of networks you own or are authorized to scan.
02Architecture
Input
NetworkCIDR rangee.g. 192.168.1.0/24
Discovery
Nmapping sweepports · services (-sV)
Python
ClassifierMAC vendor → categoryrisky-port flags
SQLitescan history · diff
Model
NetworkXtopology graph
Output
PyVisinteractive HTML
CSVinventory
03My contribution
Designed and wrote the whole tool: scanning, classification, graph building, exports, history, tests and CI.
04Implementation
- Discovery — Nmap in two phases by default: a ping sweep to find live hosts, then port and service detection (
-sV) on those hosts only. Optional OS detection and a fast preset. - Classification — each host’s MAC vendor maps to a device category (router, firewall, VM, NAS, printer, camera, IoT…). Works on the same L2 segment only, since ARP doesn’t cross routers or VLANs.
- Risk flags — hosts with sensitive ports open (Telnet, SMB, RDP, FTP, VNC) are highlighted in red.
- History — every scan is stored in SQLite and compared with the previous one: new or missing hosts, changed ports.
- Interfaces — CLI, plus an optional local Streamlit web UI with cancellable scans; CSV export for inventory.
- Quality — pytest suite with Nmap mocked (no real network needed) and GitHub Actions running tests and ruff on every push.
05Result / output
An interactive HTML topology map with icons per device category and red flags on risky hosts, a CSV inventory, and a scan-to-scan diff.