Simple NetMon
A local, privacy-respecting network monitor for Windows, in the spirit of
Sniffnet and GlassWire. It accounts
network traffic per application and per remote host/site, keeps a
persistent local history, visualises it in a browser dashboard, and can
block an application using the built-in Windows Firewall.
Everything runs and stays on your machine. There is no cloud component and no
telemetry — by design (see THREAT_MODEL.md).

Overview tab: live per-second throughput, plus top applications and remote hosts. (Screenshot from the cross-platform dev build with synthetic traffic.)
Why this architecture (the important decision)
Most Sniffnet-style tools capture raw packets with libpcap/Npcap and then try to
map flows back to processes. On Windows that means shipping the Npcap driver
(whose free licence forbids bundling it in your installer) and polling
GetExtendedTcpTable, which misses short-lived connections.
Simple NetMon instead builds on Windows-native ETW providers:

| Concern |
Source |
Benefit |
| Per-process byte accounting |
Microsoft-Windows-Kernel-Network |
PID + size + 5-tuple delivered by the provider — no driver, no Npcap |
| Site attribution |
Microsoft-Windows-DNS-Client |
Reads what the OS resolver returned, so it survives DoH/DoT |
| Blocking |
INetFwPolicy2 COM API |
Uses the built-in firewall — no kernel callout driver to sign |
Consequences: no Npcap dependency or licence issue, no cgo, the whole
thing cross-compiles to a single .exe, and it needs only Administrator
rights (not a signed kernel driver).
The trade-off: no per-packet payload inspection and no PCAP export. For a
GlassWire-style “which app/site is using my bandwidth” tool that is the right
call. Raw-capture mode (Npcap) could be added later behind a flag if deep
inspection is ever needed.
Features
- Live throughput chart (per-second in/out) over Server-Sent Events.
- Per-application usage with block/unblock buttons.
- Per-host / per-site usage with hostname resolution (DNS-Client ETW +
lazy reverse-DNS fallback).
- Persistent history in local SQLite, rolled up hourly, with an hourly
usage-history chart and selectable ranges (1h / 24h / 7d / 30d).
- Simple firewall: block an app (inbound+outbound), list managed rules,
and a one-click Remove all NetMon rules panic button. Every rule is
tagged
Simple NetMon so cleanup is complete even after a crash.
- Retention control and a Delete all history button (the privacy story).
- Strict Content-Security-Policy; loopback-only bind by default.
Project layout
cmd/netmon entrypoint: wiring, flags, graceful shutdown
internal/model shared types
internal/capture ETW Kernel-Network capture (+ dev stub w/ synthetic traffic)
internal/dns IP->site resolver: DNS-Client ETW + reverse-DNS cache
internal/procinfo PID -> executable resolver
internal/store SQLite persistence, hourly rollups, retention, purge
internal/firewall Windows Firewall COM control (+ in-memory dev stub)
internal/monitor pipeline: enrich, live stats, flush, prune
internal/server local HTTP dashboard (REST + SSE) with embedded web UI
internal/platform elevation check + open-browser
internal/etwutil shared ETW session/consumer boilerplate (Windows)
Non-Windows builds compile against stubs (*_other.go) that synthesise traffic
and an in-memory firewall, so the UI and storage can be developed and demoed on
Linux/macOS without privileges. The real capture/firewall engines are
Windows-only (//go:build windows).
Build
Requires Go 1.24+.
# Windows release binary (from any OS — no cgo, no Npcap)
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w" -o dist/netmon.exe ./cmd/netmon
# Local dev build (synthetic traffic, in-memory firewall)
go build -o dist/netmon ./cmd/netmon
Run
On Windows, run as Administrator (ETW capture and firewall control require
it):
netmon.exe
Then open the dashboard (auto-opens by default) at http://127.0.0.1:8888/.

Flags:
| Flag |
Default |
Meaning |
-addr |
127.0.0.1:8888 |
dashboard bind address (keep it loopback) |
-db |
%LOCALAPPDATA%\SimpleNetMon\netmon.db |
usage database path |
-retention |
90 |
days of history to keep |
-no-open |
false |
don’t launch a browser |
Limitations / roadmap
- ETW accounting counts payload send/recv events; it is excellent for usage
attribution but is not a packet-level analyzer.
- Site names past TLS are best-effort: DoH-only apps and ECH-encrypted SNI can
leave a host as an IP/
(unresolved) — that is expected, not a bug.
- Not yet implemented (natural next steps): GeoIP/ASN via MaxMind GeoLite2,
alert rules (“ask on new app”), tray/background service with privilege
separation (run capture in an elevated service, UI unprivileged), code
signing.
Licence
Multi-licensed by area:
A distributed binary is AGPL-3.0: it links GPL-3.0 (golang-etw) and embeds
the AGPL-3.0 dashboard. If you serve Simple NetMon to users over a network,
AGPL-3.0 §13 requires offering them the source. See NOTICE.md.
Legal
Monitor only systems and networks you are authorised to monitor. Unauthorised
interception of communications may violate wiretapping and privacy laws in your
jurisdiction. Provided without warranty.
评论