← Back to projects


PERSONAL PROJECT
Network Scanner (FastAPI + React)
Real-time network scanner — FastAPI backend + WebSocket + React/Vite UI
Context
Personal network security project: a full-stack local network scanner capable of identifying live hosts and open ports on a LAN segment, streaming results in real time via WebSocket, and classifying each service by risk level. Built in two layers: a Python FastAPI backend with concurrent threads, and a React/Vite frontend displaying results live.
Features Built
- Host discovery: local subnet resolution and ping sweep to list all live hosts
- Concurrent port scanning via ThreadPoolExecutor — all top ports probed in parallel per host
- 45-service detection table (HTTP, SSH, RDP, MSSQL, Redis, MongoDB, Docker, K8s...)
- Risk classification (high / medium / low) per port via RISK_MAP (Telnet, RDP, exposed DBs...)
- Real-time WebSocket streaming — results pushed to frontend as each host completes
- React/Vite frontend: live host cards, risk-colour-coded port badges, scan progress indicator
Stack & Technologies
- Python 3 + FastAPI — REST API and WebSocket backend
- uvicorn — ASGI server for FastAPI
- ThreadPoolExecutor — Concurrent port scanning (stdlib concurrent.futures)
- WebSockets — Real-time backend → frontend streaming
- React 18 + Vite — Live-updating SPA frontend
- CORS middleware — Cross-origin backend/frontend integration
How It Works
- 1Host discoveryBackend resolves the local subnet and pings each IP to build the list of live hosts.
- 2Concurrent port scanFor each live host, a ThreadPoolExecutor probes the TOP_PORTS list in parallel — open ports and service names collected.
- 3Risk classificationEach open port is looked up in RISK_MAP and tagged high / medium / low based on known exposure risk.
- 4WebSocket streamingResults pushed to frontend in real time as each host finishes scanning — no need to wait for the full scan.
- 5React renderingFrontend receives JSON events via WebSocket and renders host cards with colour-coded port badges on the fly.
Technical Highlights
- Transport
- WebSocket (FastAPI + uvicorn)(Real-time streaming)
- Concurrency
- ThreadPoolExecutor(Parallel port probing per host)
- Port coverage
- 45 services(KNOWN_SERVICES dict)
- Risk levels
- 3 levels(High / Medium / Low via RISK_MAP)
- Dependencies
- Minimal(fastapi, uvicorn, websockets + React/Vite)