SubnetLens
github.com/ostefani/subnetlens- Category
- Cybersecurity
- Rank
- No. 1426Tools index
Previous survey · No. 1371 ·
- Pricing
- Open Source
- Type
- TOOL
- Use case
- Security & Identity
- Interfaces
- CLI
- GitHub
- 32 stars
- Latest release
- v1.5.12
- Date
About
A concurrent network scanner written in Go that discovers live hosts via TCP, ICMP, ARP, and mDNS, then scans open ports, resolves vendors from MAC/OUI data, and heuristically fingerprints operating systems. It ships as a single binary with both a Bubbletea-based TUI and a plain-text CLI mode for scripting.
What it does
SubnetLens is a command-line tool you point at a local IPv4 range, a single address, or a start-to-end span. It finds which machines are there by pinging where it has root, knocking on common TCP ports where it does not, reading the ARP table (the local map from IP to hardware address), and listening for devices announcing their services. Every machine that answers then gets a port check, a vendor name looked up from its hardware address, and a best guess at its operating system taken from SSH, web server and TLS greetings. Results stream into a live terminal screen or print as plain text.
Why it's ranked here
A small Go scanner with more care underneath than its size suggests: it sizes its socket use against the operating system's open-file limit and queues work instead of crashing, CI runs vet, the tests and the race detector on every pull request, and the scan engine accepts plug-in discovery, scanning and classification stages. MIT licensed, one binary, and the basic TCP path needs no root. The limits are just as concrete: IPv4 only, TCP ports only, no structured export yet, and the operating system guess is keyword matching. It is a good way to take stock of a home or lab network, not a security audit tool.
What's good
It holds back 64 file handles for the process, treats the rest as a shared socket budget, and prints a warning with the estimated peak demand when your concurrency settings would exceed it, so a big scan slows down rather than failing with too many open files. Ping gets two tries before it falls back to TCP. The active ARP sweep paces its requests two milliseconds apart. Plain mode prints each host as soon as its name, hardware address and vendor are known, then flushes the stragglers at the end. The IEEE vendor list ships in the repository, and randomized hardware addresses, a phone privacy feature, are labelled as such.
Tradeoffs
IPv6 targets are rejected with an error. Operating system detection is a first-match keyword list over SSH, web server and TLS banners: an SSH server that only says OpenSSH reads as generic Linux/Unix, and a host with none of those services reads as Unknown. Output is a terminal screen or fixed-width text; JSON and CSV export are still unchecked on the roadmap. UDP scanning and a watch mode that alerts on changes are reserved for a planned proprietary Pro edition. Ping and ARP need sudo or Administrator, ARP on Windows needs the Npcap driver, and passive service listening is marked untested on Windows.
How to use it well
For anyone who wants a readable picture of their own home or lab network. Run it with sudo so ping and ARP discovery are on; without root, a host only counts if it accepts a connection on a probe port, unless you add the all-alive flag, which also counts hosts that refuse. Use plain mode with banners for text you can grep, lower the timeout on a fast wired network, and raise discovery concurrency for larger ranges. It does not cover continuous monitoring, alerting or machine-readable reports; scan only networks you are allowed to.
Technical notes+
main.go injects GoReleaser ldflags into cmd/root.go, which defines a single Cobra scan subcommand (timeout 500 ms, concurrency 100, discovery concurrency 0 meaning reuse) and calls scanner.PrepareScanOptions before choosing the Bubble Tea UI or runPlain. In scanner/socket_budget.go the budget is the open-file soft limit minus reservedFileDescriptors (64), enforced by a channel semaphore, with estimated peak demand of scan slots plus discovery slots times (len(tcpProbePorts)+1). scanner/engine.go wires every stage through an engineDependencies struct of function adapters and merges observation streams into a HostRegistry; extra DiscoveryModule, HostScanner and HostClassifier implementations attach via options. scanner/discovery.go tries ICMP twice per host, then tcpProbeOpenPort or tcpProbeAlive under --all-alive, rejects IPv6 in expandTargets, and skips the ICMP preheat above 4096 targets (200 workers). transports/arp/sweep.go sleeps 2 ms between ARP sends. fingerprint/detect.go is ordered keyword tables: TLS summary on ports 443, 8443, 993 and 995 for device, SSH greeting for OS, then HTTP Server headers on 80, 8080, 443 and 8443. .github/workflows/ci.yml runs go vet, go test, go test -race and go build on stable Go.
Observed
- License
- MIT
- Language
- Go, module declares go 1.25.0
- Interfaces
- CLI built on Cobra, with a Bubble Tea terminal UI and a plain-text mode
- Install
- Build from source with go build or go install; release binaries versioned via GoReleaser ldflags
- Platform support
- Linux, macOS and Windows; Windows ARP requires Npcap; mDNS not tested on Windows
- Privileges
- TCP scan runs unprivileged; ICMP and ARP need root or Administrator
- Address family
- IPv4 only; IPv6 targets are rejected
- Port scanning
- TCP connect only; UDP listed for a planned proprietary Pro edition
- Output formats
- Terminal UI or plain text; JSON/CSV export not implemented
- CI
- go vet, go test, go test -race and go build on pushes and pull requests to main
- Vendor data
- IEEE OUI CSV bundled in the repository for offline vendor lookup
Read from README.md, go.mod, LICENSE, main.go, cmd/root.go, scanner/engine.go, scanner/discovery.go, scanner/portscan.go, fingerprint/detect.go, transports/arp/sweep.go, scanner/socket_budget.go, .github/workflows/ci.yml.
What it can do
Discover live hosts on a network using TCP, ICMP, ARP, and mDNS probes
Network subnet range → List of live hosts
Scan discovered hosts for open ports
Host IP address → List of open ports
Resolve device vendor from MAC address using OUI data
MAC address → Vendor name
Heuristically fingerprint device operating system
Scan results → Guessed OS type
Tags
Tech Stack
Media
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.