Skip to main content

Lightweight subnet audit tool -- see what is alive on your network

Project description

whoson

A lightweight subnet audit tool. Scan a network, see what's alive, and export a topology image -- all from the terminal.

PyPI CI

Install

# Prerequisites: nmap must be installed
brew install nmap        # macOS
sudo apt install nmap    # Debian/Ubuntu
sudo dnf install nmap    # Fedora/RHEL

# Install whoson
pip install whoson

Usage

# Scan a subnet and print a host table
whoson 192.168.1.0/24

# Save a topology diagram as PNG
whoson 192.168.1.0/24 -i topology.png

# Or as JPEG or SVG
whoson 192.168.1.0/24 -i topology.jpg
whoson 192.168.1.0/24 -i topology.svg

# Export as JSON or CSV
whoson 192.168.1.0/24 --json results.json
whoson 192.168.1.0/24 --csv hosts.csv

# Use TCP connect scan instead of ping
whoson 192.168.1.0/24 -t tcp

# SYN stealth scan (requires root)
sudo whoson 10.0.0.0/24 -t syn

# Quiet mode -- only write files, no terminal output
whoson 192.168.1.0/24 -i out.png --json out.json -q

# Combine everything
whoson 192.168.1.0/24 -t tcp -i topology.png --json data.json --csv hosts.csv

Example output

Scanning 192.168.1.0/24  (254 usable addresses, ping scan)
Found 5 hosts in 4.2s

IP              Hostname       Type         MAC                Vendor   Ports
--------------------------------------------------------------------------------
192.168.1.1     router.local   gateway      AA:BB:CC:DD:EE:01  Cisco    -
192.168.1.10    web-srv        server       AA:BB:CC:DD:EE:10  Dell     80,443
192.168.1.15    db-srv         server       AA:BB:CC:DD:EE:15  Dell     3306
192.168.1.50    -              workstation  AA:BB:CC:DD:EE:50  Apple    -
192.168.1.99    hp-printer     printer      AA:BB:CC:DD:EE:99  HP       9100

Host Classification

Type Criteria Color
Gateway IP ends in .1 or .254 Red
Server Open ports: 22, 80, 443, 25, 53, etc. Teal
Printer Open ports: 515, 631, 9100 Green
Workstation Default Blue

Export Formats

Format Flag Description
PNG -i out.png Raster topology image
JPEG -i out.jpg Raster topology image (compressed)
SVG -i out.svg Vector topology image (scalable)
JSON --json FILE Full topology data with metadata
CSV --csv FILE Host list with IP, hostname, type, MAC, vendor, ports

The -i / --image flag detects the format from the file extension (.png, .jpg, .jpeg, .svg).

Scope and Limitations

whoson shows what hosts are alive and classifies them by type. It does not discover actual Layer 2/3 topology -- it cannot determine switch port connections or router adjacencies. The image shows a star topology (all hosts connected to the gateway) because that is all that can be honestly inferred from a scan.

For real topology discovery using CDP/LLDP/SNMP, see LibreNMS, Secure Cartography, or NetDisco.

Dependencies

Runtime: python-nmap + Pillow (2 packages).

System: nmap must be available on PATH.

Development

git clone https://github.com/daniissac/whoson.git
cd whoson
pip install -e ".[dev]"
pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whoson-0.1.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whoson-0.1.0-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file whoson-0.1.0.tar.gz.

File metadata

  • Download URL: whoson-0.1.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for whoson-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fc71173e411309350a6044f2dd5641bb8312dbfafd946843ea383e1a7a0e3e95
MD5 d6d4725820d150e5843f55c4b4b8668d
BLAKE2b-256 ec87dcfc26b37130f1026cb49a52c3dec3e77646a53a22bd4fa8878ce73b623c

See more details on using hashes here.

Provenance

The following attestation bundles were made for whoson-0.1.0.tar.gz:

Publisher: publish.yml on daniissac/whoson

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file whoson-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: whoson-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for whoson-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c26d3cfab8558135d444e1f6eba4c967300319f5c611ab459662aec9ec896d4b
MD5 bad07431f83b28f43ea0941f88798267
BLAKE2b-256 46b746e5af42ccf5c4906ab6618e7a37f6e100ca492de0738c9e96ee288a78a5

See more details on using hashes here.

Provenance

The following attestation bundles were made for whoson-0.1.0-py3-none-any.whl:

Publisher: publish.yml on daniissac/whoson

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page