Show HN: Whosthere: 一个具有现代TUI的局域网发现工具,用Go编写。
Show HN: Whosthere: A LAN discovery tool with a modern TUI, written in Go

原始链接: https://github.com/ramonvermeulen/whosthere

## Whosthere: 局域网发现工具 Whosthere 是一个现代的、基于 Go 语言的工具,用于通过用户友好的终端用户界面 (TUI) 发现和探索您局域网 (LAN) 上的设备。它使用 mDNS、SSDP 和 ARP(无需 root 权限)执行非侵入性扫描,以识别连接的设备。 发现的设备通过 OUI 查找丰富制造商信息。 主要功能包括快速的并发扫描引擎、集成的端口扫描器(具有基于权限的扫描)、以及具有简单 HTTP API 的守护进程模式,用于与其他工具集成。 Whosthere 可以通过 YAML 文件进行高度配置,允许自定义扫描间隔、主题等。 **安装:** 可通过 `brew`、`go install` 或从 GitHub ([https://github.com/ramonvermeulen/whosthere](https://github.com/ramonvermeulen/whosthere)) 编译源代码获得。 **重要提示:** Whosthere 旨在在您拥有明确扫描权限的网络中使用。 未经授权的扫描是不道德的,并且可能违法。

## Whosthere:一款新的局域网发现工具 Ramonvermeulen98 发布了 “Whosthere”,一款使用 Go 编写,并具有现代终端用户界面 (TUI) 的局域网发现工具。Whosthere 旨在无需管理员权限即可探索本地网络,它利用 mDNS、SSDP 扫描、ARP 缓存读取和 OUI 查询来识别设备。 该工具包括可选的端口扫描器、带有简单 HTTP API 的守护进程模式,以及通过 YAML 配置文件进行自定义主题。它受到 lazygit 等流行的 TUI 的启发,旨在提供一种用户友好的方式来映射本地网络。 目前支持 Linux 和 MacOS,Whosthere 可以通过 Homebrew 或 `go install` 获取。然而,有用户报告了端口检测的初始问题,突出了潜在的改进领域。开发者欢迎反馈和新功能建议。
相关文章

原文

Go Report Card Go Version License GitHub Release GitHub Repo stars

Local Area Network discovery tool with a modern Terminal User Interface (TUI) written in Go. Discover, explore, and understand your LAN in an intuitive way.

Whosthere performs unprivileged, concurrent scans using mDNS and SSDP scanners. Additionally, it sweeps the local subnet by attempting TCP/UDP connections to trigger ARP resolution, then reads the ARP cache to identify devices on your Local Area Network. This technique populates the ARP cache without requiring elevated privileges. All discovered devices are enhanced with OUI lookups to display manufacturers when available.

Whosthere provides a friendly, intuitive way to answer the question every network administrator asks: "Who's there on my network?"

demo gif

  • Modern TUI: Navigate and explore discovered devices intuitively.
  • Fast & Concurrent: Leverages multiple discovery methods simultaneously.
  • No Elevated Privileges Required: Runs entirely in user-space.
  • Device Enrichment: Uses OUI lookup to show device manufacturers.
  • Integrated Port Scanner: Optional service discovery on found hosts (only scan devices with permission!).
  • Daemon Mode with HTTP API: Run in the background and integrate with other tools.
  • Theming & Configuration: Personalize the look and behavior via YAML configuration.
brew tap ramonvermeulen/whosthere
brew install whosthere

Or with Go:

go install github.com/ramonvermeulen/whosthere@latest

Or build from source:

git clone github.com/ramonvermeulen/whosthere.git
cd whosthere
make build

Run the TUI for interactive discovery:

Run as a daemon with HTTP API:

whosthere daemon --port 8080

Additional command line options can be found by running:

Whosthere is supported on the following platforms:

Key Action
/ Start regex search
k Up
j Down
g Go to top
G Go to bottom
y Copy IP of selected device
enter Show device details
CTRL+t Toggle theme selector
CTRL+c Stop application
ESC Clear search / Go back
p (details view) Start port scan on device
tab (modal view) Switch button selection
Variable Description
WHOSTHERE_CONFIG Path to the configuration file, to be able to overwrite the default location.
WHOSTHERE_LOG Set the log level (e.g., debug, info, warn, error). Defaults to info.

Whosthere can be configured via a YAML configuration file. By default, it looks for the configuration file in the following order:

  • Path specified in the WHOSTHERE_CONFIG environment variable (if set)
  • $XDG_CONFIG_HOME/whosthere/whosthere.yaml (if XDG_CONFIG_HOME is set)
  • ~/.config/whosthere/whosthere.yaml (otherwise)

When not running in TUI mode, logs are also written to the console output.

Example of the default configuration file:

# How often to run discovery scans
scan_interval: 20s

# Maximum duration for each scan
# If you set this too low some scanners or the sweeper might not complete in time
scan_duration: 10s

# Splash screen configuration
splash:
  enabled: true
  delay: 1s

# Theme configuration
theme:
  # Configure the theme to use for the TUI, complete list of available themes at:
  # https://github.com/ramonvermeulen/whosthere/tree/main/internal/ui/theme/theme.go
  # Set name to "custom" to use the custom colors below
  # For any color that is not configured it will take the default theme value as fallback
  name: default

  # Custom theme colors (uncomment and set name: custom to use)
  # primitive_background_color: "#000a1a"
  # contrast_background_color: "#001a33"
  # more_contrast_background_color: "#003366"
  # border_color: "#0088ff"
  # title_color: "#00ffff"
  # graphics_color: "#00ffaa"
  # primary_text_color: "#cceeff"
  # secondary_text_color: "#6699ff"
  # tertiary_text_color: "#ffaa00"
  # inverse_text_color: "#000a1a"
  # contrast_secondary_text_color: "#88ddff"

# Scanner configuration
scanners:
  mdns:
    enabled: true
  ssdp:
    enabled: true
  arp:
    enabled: true

# Port scanner configuration
port_scanner:
  timeout: 5s
  # List of TCP ports to scan on discovered devices
  tcp: [21, 22, 23, 25, 80, 110, 135, 139, 143, 389, 443, 445, 993, 995, 1433, 1521, 3306, 3389, 5432, 5900, 8080, 8443, 9000, 9090, 9200, 9300, 10000, 27017]

# Uncomment the next line to configure a specific network interface - uses OS default if not set
# network_interface: lo0

When running Whosthere in daemon mode, it exposes an very simplistic HTTP API with the following endpoints:

Method Endpoint Description
GET /devices Get list of all discovered devices
GET /device/{ip} Get details of a specific device
GET /health Health check

Theme can be configured via the configuration file, or at runtime via the CTRL+t key binding. A complete list of available themes can be found here, feel free to open a PR to add your own theme!

Example of theme configuration:

When the name is set to custom, the other color options can be used to create your own custom theme.

Logs are written to the application's state directory:

  • $XDG_STATE_HOME/whosthere/app.log (if XDG_STATE_HOME is set)
  • ~/.local/state/whosthere/app.log (otherwise)

When not running in TUI mode, logs are also output to the console.

For clipboard functionality to work:

Runtime requirements:

  • Linux (X11): X11 client library (e.g., libx11-6 on Ubuntu, libX11 on Fedora/Arch, often pre-installed).
  • Linux (Wayland): Not natively supported. May require XWayland.
  • macOS/Windows: No dependencies.

Build requirements (when compiling from source):

  • Linux: X11 development package (libx11-dev, libX11-devel, or libx11)

Whosthere is intended for use on networks where you have permission to perform network discovery and scanning, such as your own home network. Unauthorized scanning of networks may be illegal and unethical. Always obtain proper authorization before using this tool on any network.

Contributions and suggestions such as feature requests, bug reports, or improvements are welcome! Feel free to open issues or submit pull requests on the GitHub repository. Please make sure to discuss any major changes on a Github issue before implementing them.

联系我们 contact @ memedata.com