并導出 JSON 設(shè)備清單)
Whosthere 快速上手一條命令掃描局域網(wǎng)并導出 JSON 設(shè)備清單【免費下載鏈接】whosthereLocal Area Network discovery tool with an interactive Terminal User Interface (TUI) written in Go. Discover, explore, and understand your LAN in an intuitive way. Knock Knock.. whos there? 項目地址: https://gitcode.com/gh_mirrors/wh/whosthereWhosthere 是一款用 Go 編寫的局域網(wǎng)發(fā)現(xiàn)工具LAN 掃描器內(nèi)置交互式 TUI 終端界面。無需管理員權(quán)限它并發(fā)使用 mDNS、SSDP 和 ARP 三種方式探測設(shè)備還能通過 OUI 查詢自動補全設(shè)備廠商信息。本文帶你 3 分鐘完成安裝并用一條命令掃描局域網(wǎng)、導出設(shè)備 JSON 清單 安裝 Whosthere 局域網(wǎng)掃描器的 3 種方法方法一HomebrewmacOS / Linuxbrew install whosthere方法二Nix / Arch# NixOS nix profile install nixpkgs#whosthere # Arch Linux (yay) yay -S whosthere-bin方法三從源碼構(gòu)建git clone https://gitcode.com/gh_mirrors/wh/whosthere cd whosthere make build構(gòu)建邏輯很簡單就一條go build命令見 Makefile。一條命令掃描整個局域網(wǎng)裝好后進入 CLI 模式執(zhí)行單次掃描whosthere scan -t 5參數(shù)說明-t 5即--timeout5s本次掃描的最長等待時間見 scan.go不加參數(shù)時mDNS、SSDP、ARP 三種掃描器和子網(wǎng) Sweeper 全部默認開啟執(zhí)行時終端會顯示 Scanning network... 動畫結(jié)束后以表格形式列出所有發(fā)現(xiàn)的設(shè)備IP、MAC、廠商、設(shè)備名。想看看更多可用參數(shù)運行whosthere --help即可。導出 JSON 設(shè)備清單重點想自動化處理設(shè)備信息加上--json --pretty并重定向到文件whosthere scan -t 5 --json --pretty devices.json生成的devices.json中每個設(shè)備都包含完整字段序列化邏輯在 device.go{ ip: 192.168.1.23, mac: aa:bb:cc:dd:ee:ff, displayName: living-room-speaker, manufacturer: Apple Inc., sources: [arp-cache, mdns], firstSeen: 2026-10-04T00:00:00Z, lastSeen: 2026-10-04T00:00:05Z, extraData: {} }幾個實用字段manufacturer通過 MAC 前綴 OUI 查得的設(shè)備廠商sources該設(shè)備是由哪些掃描器發(fā)現(xiàn)的displayName來自 mDNS/SSDP 的設(shè)備友好名稱有jq的話還能秒查清單jq .[].ip devices.json # 只列出所有 IP jq .[] | select(.manufacturer Apple Inc.) devices.json # 篩選蘋果設(shè)備快速調(diào)整掃描參數(shù)需求命令 / 配置關(guān)閉某個掃描器whosthere scan --mdnsfalse --ssdpfalse指定掃描的子網(wǎng)配置target_subnets: [10.0.0.0/24]調(diào)整掃描超時--timeout10sWhosthere 支持命令行參數(shù)、環(huán)境變量WHOSTHERE__前綴、YAML 配置文件三級覆蓋配置文件默認位于~/.config/whosthere/config.yaml完整示例見 README.md默認值定義在 config.go。?? 友情提醒請只在你有權(quán)限的網(wǎng)絡(luò)如家庭網(wǎng)絡(luò)上使用。小結(jié)場景命令交互式探索whosthere單次掃描whosthere scan -t 5導出 JSON 清單whosthere scan -t 5 --json --pretty devices.json從安裝到導出清單只需 3 條命令。想持續(xù)監(jiān)控網(wǎng)絡(luò)還可以試試后臺守護模式whosthere daemon --port8080通過 HTTP API 獲取設(shè)備數(shù)據(jù)把它接入你自己的腳本里吧【免費下載鏈接】whosthereLocal Area Network discovery tool with an interactive Terminal User Interface (TUI) written in Go. Discover, explore, and understand your LAN in an intuitive way. Knock Knock.. whos there? 項目地址: https://gitcode.com/gh_mirrors/wh/whosthere創(chuàng)作聲明:本文部分內(nèi)容由AI輔助生成(AIGC),僅供參考