Weave Network CLI: network discovery, async port scanning, camera detection, and risk analysis.
Project description
Weave Network CLI (WNC)
Modular Python CLI for network discovery, port/protocol scanning, and device (e.g., IP camera) detection, guided by an interactive wizard with live progress.
Quickstart
- Create virtualenv and install deps:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- Run the wizard (basic):
python -m wnc wizard
- Full extended scan with JSON report and risk analysis:
python -m wnc wizard --yes --output scan_report.json --analyze
- Or run commands directly:
python -m wnc scan internal
python -m wnc scan ports --target 192.168.1.10 --top 1000
python -m wnc scan cameras --subnet 192.168.1.0/24
Features
- Interactive wizard with Rich progress bars
- Internal network discovery (interfaces, subnets)
- Host discovery (TCP connect checks)
- Async port scan and banner grabbing (HTTP/HTTPS/SSH/Redis/Memcached) with HTTP title extraction
- Camera heuristics (HTTP/RTSP), ONVIF WS-Discovery, optional ONVIF SOAP info, optional ONVIF password change
- Device fingerprinting from HTTP/RTSP/SSDP/mDNS/ONVIF evidence with confidence scoring
- LAN latency to default gateway and DNS (median/p95 via TCP connect RTTs)
- SSDP/UPnP discovery; mDNS service discovery
- Passive ARP table parsing with MAC OUI vendor hints (no ARP sweep)
- Speedtest and RTT-based rough location
- Risk analyzer that scores and summarizes findings
- Modular scanners in
wnc/scanners/
CLI Flags (wizard)
--extended/--no-extendedrun extended tasks (default: on)--weak-auth/--no-weak-authtest common default credentials for HTTP/RTSP on camera-like hosts (safe, read-only) (default: on)--creds "u1:p1,u2:p2"custom username:password pairs to try for weak-auth--change-passwordattempt ONVIF password change when weak creds found (DANGEROUS; modifies device)--change-user <user>target username for ONVIF password change (defaults to the weak-cred username)--new-password <pw>new password to set (required with--change-password)--wificollect Wi‑Fi info (macOS) including current SSID/BSSID/channel/RSSI and nearby APs--lan-speedmeasure LAN latency to default gateway and DNS (RTT med/p95)--speedtest-runs <1-3>number of speedtest runs--output <path>write full JSON report to path--analyze/--no-analyzerun risk analyzer and include results in report (default: on)--yesnon-interactive; auto-accept prompts
Report (JSON)
When --output is provided, the wizard writes a JSON file including:
subnets,hosts,port_sample_hosts,port_openudp_samples(labeled UDP services per sampled host)cameras,onvif,onvif_info,weak_auth_findings,onvif_password_changessdp,mdns_records,arp,bannersdevices(fingerprinted vendor/product/type with confidence)wifi(macOS current network and nearby APs)lan_speed(gateway and DNS RTT stats, open ports tried)speedtest,location,location_top,location_targets,risk,summary
Docker
Build image:
docker build -t weave-network-cli:latest .
Run the wizard (save report locally):
# Linux: host networking gives best local LAN visibility
# macOS/Windows: --network host is not supported the same way; container can still reach LAN via bridged networking
docker run --rm \
--name wnc \
--network host \
-v "$PWD:/data" \
weave-network-cli:latest wizard --yes --extended --output /data/scan_report.json
Other commands:
docker run --rm --network host weave-network-cli:latest scan internal
docker run --rm --network host weave-network-cli:latest scan ports --target 192.168.1.10 --top 200
docker run --rm --network host weave-network-cli:latest scan cameras --subnet 192.168.1.0/24
Limitations in container:
--wifi(macOS Wi‑Fi details) will not work inside Docker.- Host network mode is recommended on Linux for local discovery.
npm (Node wrapper)
You can use an npm wrapper to invoke WNC without installing Python. It prefers Docker (and falls back to local Python if available).
Run via npx:
npx @thephotocodegrapher/wnc wizard --yes --extended --output ./scan_report.json
Or install globally:
npm i -g @thephotocodegrapher/wnc
wnc wizard --yes --extended --output ./scan_report.json
Notes:
- Requires Docker for best experience; on Linux, host networking is used automatically when available.
- On macOS/Windows, Docker networking differs; discovery still works via bridged networking.
Python API
Use WNC programmatically without packaging to PyPI. Import sync helpers from wnc:
from wnc import internal_subnets, hosts, ports, cameras, wizard
subs = internal_subnets()
print("Subnets:", subs)
if subs:
live = hosts(subnet=subs[0])
print("Live hosts:", live[:10])
if live:
open_ports = ports(live[0], top_n=100)
print("Open ports:", [(r.port, r.service) for r in open_ports])
cams = cameras(subs[0])
for c in cams[:5]:
print("Camera:", c.ip, c.vendor, c.evidence[:3])
# Run the interactive wizard non-interactively and save a JSON report
wizard(yes=True, extended=True, output="scan_report.json")
Available helpers in wnc:
internal_subnets() -> List[str]hosts(subnet, limit=None) -> List[str]ports(host, top_n=200, ports=None) -> List[PortResult]cameras(subnet) -> List[CameraCandidate]wizard(...same flags as CLI...) -> None
Notes
- ICMP ping typically requires elevated privileges. This tool uses fast TCP connect checks to infer live hosts.
- Scans are best-effort and may miss hosts with strict firewalls.
- ONVIF SOAP device information is unauthenticated by default and best-effort (short timeouts).
- ONVIF password change is disabled by default; only runs with
--change-passwordand requires--new-password. Behavior varies by vendor.
License
This project is released under the PolyForm Noncommercial License 1.0.0. You may use, copy, modify, and redistribute the software for noncommercial purposes.
- Noncommercial means not intended for or directed toward commercial advantage or monetary compensation.
- For commercial use, please contact the authors to obtain a commercial license.
See the full text in LICENSE.
Maintainer
Project Meta
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file weave_cli-1.1.0.tar.gz.
File metadata
- Download URL: weave_cli-1.1.0.tar.gz
- Upload date:
- Size: 38.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b7ae72eb7df6d68935cfc7c0b2f2b6c3b8d0dd9139b9b8c8deb5c2b80361a22
|
|
| MD5 |
2f3648cab7e71c83faa6070d5af9e8b5
|
|
| BLAKE2b-256 |
6ecf64d8feb16c0517b582f86d32d4293ccc038b347f708e08b19462c51d3979
|
File details
Details for the file weave_cli-1.1.0-py3-none-any.whl.
File metadata
- Download URL: weave_cli-1.1.0-py3-none-any.whl
- Upload date:
- Size: 47.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
415f72154c2db4028e4bea01ef180c245a41256363e135788746d3bf54ee6cb3
|
|
| MD5 |
db7a3fc008b7653f173501f78a903e49
|
|
| BLAKE2b-256 |
d2cf0942f7ea06f4e9bf9da897164c7f8ac2a6bd88129f3f5d5cd7aa3b4e3a29
|