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
# Windows: download from https://nmap.org/download.html and add to PATH

# 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 ping-only scan (faster, but no port/MAC info without root)
whoson 192.168.1.0/24 -t ping

# SYN stealth scan (faster than tcp, 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 (sudo for MAC/vendor info)
sudo whoson 192.168.1.0/24 -i topology.png --json data.json --csv hosts.csv

Example output

Scanning 192.168.1.0/24  (254 usable addresses, tcp 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

Scan Types

Type Flag Root Ports MAC/Vendor Speed
TCP connect (default) -t tcp No Yes With sudo Moderate
SYN stealth -t syn Yes Yes Yes Fast
Ping only -t ping No No With sudo Fastest

Use sudo for MAC/vendor detection on any scan type. Without root, you still get IP, hostname, and open ports (on tcp/syn scans).

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.2.0.tar.gz (16.5 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.2.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for whoson-0.2.0.tar.gz
Algorithm Hash digest
SHA256 662bf64a7e9ecff545f2c0b5b105679e98b5e50e527d11dbadecee9ff6d403a4
MD5 be28df32ee2f67c7b146bc9558990f94
BLAKE2b-256 665c00cdf81a4c8cec497886ec29cea44865e48c8694c83673279434f416ede6

See more details on using hashes here.

Provenance

The following attestation bundles were made for whoson-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: whoson-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6acd3b38cbf987b0071e2b33de08eb36dfd6ededa67dc37c7e05525761f8886a
MD5 71280f46a584569dcd7354981ea4bf98
BLAKE2b-256 85d59a55e58d85f87f1324b8924b06769bdcff7a71f6f03eac7011fee6a1107c

See more details on using hashes here.

Provenance

The following attestation bundles were made for whoson-0.2.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