Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
snitch — 一个更美观的网络连接检查方式 | Kitploit
工具/GitHubGitHub/karol-broda/snitch
通用工具数据包嗅探与分析网络映射信息收集DNS 分析
GitHubkarol-broda/snitch

snitch

一个更美观的网络连接检查方式

查看仓库
3.5k552个月前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

snitch

一个更友好的 ss / netstat 替代品,适合人类使用。通过简洁的 TUI 或格式化表格检查网络连接。

snitch demo

安装

homebrew

root@kitploit:~
brew install snitch

感谢 @bevanjkay 将 snitch 添加到 homebrew-core

go

root@kitploit:~
go install github.com/karol-broda/snitch@latest

nixpkgs

root@kitploit:~
nix-env -iA nixpkgs.snitch

感谢 @DieracDelta 将 snitch 添加到 nixpkgs

nixos / nix (flake)

root@kitploit:~
# try it
nix run github:karol-broda/snitch

# install to profile
nix profile install github:karol-broda/snitch

# or add to flake inputs
{
  inputs.snitch.url = "github:karol-broda/snitch";
}
# then use: inputs.snitch.packages.${system}.default

home-manager (flake)

将 snitch 添加到你的 flake inputs 并导入 home-manager 模块:

root@kitploit:~
{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    home-manager.url = "github:nix-community/home-manager";
    snitch.url = "github:karol-broda/snitch";
  };

  outputs = { nixpkgs, home-manager, snitch, ... }: {
    homeConfigurations."user" = home-manager.lib.homeManagerConfiguration {
      pkgs = nixpkgs.legacyPackages.x86_64-linux;
      modules = [
        snitch.homeManagerModules.default
        {
          programs.snitch = {
            enable = true;
            # optional: use the flake's package instead of nixpkgs
            # package = snitch.packages.x86_64-linux.default;
            settings = {
              defaults = {
                theme = "catppuccin-mocha";
                interval = "2s";
                resolve = true;
              };
            };
          };
        }
      ];
    };
  };
}

可用主题:ansi, catppuccin-mocha, catppuccin-macchiato, catppuccin-frappe, catppuccin-latte, gruvbox-dark, gruvbox-light, dracula, nord, tokyo-night, tokyo-night-storm, tokyo-night-light, solarized-dark, solarized-light, one-dark,

arch linux (aur)

root@kitploit:~
# with yay
yay -S snitch-bin

# with paru
paru -S snitch-bin

shell 脚本

root@kitploit:~
curl -sSL https://raw.githubusercontent.com/karol-broda/snitch/master/install.sh | sh

默认安装到 ~/.local/bin(如果可用),否则安装到 /usr/local/bin。可通过以下方式覆盖:

root@kitploit:~
curl -sSL https://raw.githubusercontent.com/karol-broda/snitch/master/install.sh | INSTALL_DIR=~/bin sh

macos: 安装脚本会自动移除二进制文件上的隔离属性(com.apple.quarantine),使其无需 gatekeeper 警告即可运行。若要禁用此行为,请设置 KEEP_QUARANTINE=1。

docker

预构建的 OCI 镜像可从 GitHub 容器镜像仓库获取:

root@kitploit:~
# pull from ghcr.io
docker pull ghcr.io/karol-broda/snitch:latest          # alpine (default)
docker pull ghcr.io/karol-broda/snitch:latest-alpine   # alpine (~17MB)
docker pull ghcr.io/karol-broda/snitch:latest-scratch  # minimal, binary only (~9MB)
docker pull ghcr.io/karol-broda/snitch:latest-debian   # debian trixie
docker pull ghcr.io/karol-broda/snitch:latest-ubuntu   # ubuntu 24.04

# or use a specific version
docker pull ghcr.io/karol-broda/snitch:0.2.0-alpine

或者,通过 nix flake 在本地构建:

root@kitploit:~
nix build github:karol-broda/snitch#snitch-alpine
docker load < result

运行容器:

root@kitploit:~
# basic usage - sees host sockets but not process names
docker run --rm --net=host snitch:latest ls

# full info - includes PID, process name, user
docker run --rm --net=host --pid=host --cap-add=SYS_PTRACE snitch:latest ls
flag用途
--net=host共享宿主机的网络命名空间(查看宿主机连接所必需)
--pid=host共享宿主机的 PID 命名空间(获取进程信息所需)
--cap-add=SYS_PTRACE从 /proc/<pid> 读取进程详细信息

注意: 不需要 CAP_NET_ADMIN 和 CAP_NET_RAW。snitch 从 /proc/net/* 读取数据,这不需要特殊的网络能力。

二进制

从 releases 下载:

  • linux: snitch_<version>_linux_<arch>.tar.gz 或 .deb/.rpm/.apk
  • macos: snitch_<version>_darwin_<arch>.tar.gz
root@kitploit:~
tar xzf snitch_*.tar.gz
sudo mv snitch /usr/local/bin/

macos: 如果被提示“无法打开,因为无法验证开发者”,请运行:

root@kitploit:~
xattr -d com.apple.quarantine /usr/local/bin/snitch

快速开始

root@kitploit:~
snitch              # launch interactive tui
snitch -l           # tui showing only listening sockets
snitch ls           # print styled table and exit
snitch ls -l        # listening sockets only
snitch ls -t -e     # tcp established connections
snitch ls -p        # plain output (parsable)

命令

snitch / snitch top

带有实时更新连接列表的交互式 TUI。

root@kitploit:~
snitch                  # all connections
snitch -l               # listening only
snitch -t               # tcp only
snitch -e               # established only
snitch -i 2s            # 2 second refresh interval

快捷键:

root@kitploit:~
j/k, ↑/↓      navigate
g/G           top/bottom
t/u           toggle tcp/udp
l/e/o         toggle listen/established/other
s/S           cycle sort / reverse
w             watch/monitor process (highlight)
W             clear all watched
K             kill process (with confirmation)
/             search
enter         connection details
?             help
q             quit

snitch ls

一次性表格输出。如果输出超过终端高度,会自动使用分页器。

root@kitploit:~
snitch ls               # styled table (default)
snitch ls -l            # listening only
snitch ls -t -l         # tcp listeners
snitch ls -e            # established only
snitch ls -p            # plain/parsable output
snitch ls -o json       # json output
snitch ls -o csv        # csv output
snitch ls -n            # numeric (no dns resolution)
snitch ls --no-headers  # omit headers

snitch json

用于脚本编写的 JSON 输出。

root@kitploit:~
snitch json
snitch json -l

snitch watch

按固定间隔输出 JSON 数据帧。

root@kitploit:~
snitch watch -i 1s | jq '.count'
snitch watch -l -i 500ms

snitch upgrade

检查更新并就地升级。

root@kitploit:~
snitch upgrade              # check for updates
snitch upgrade --yes        # upgrade automatically
snitch upgrade -v 0.1.7     # install specific version

过滤器

以下快捷标志适用于所有命令:

root@kitploit:~
-t, --tcp           tcp only
-u, --udp           udp only
-l, --listen        listening sockets
-e, --established   established connections
-4, --ipv4          ipv4 only
-6, --ipv6          ipv6 only

解析

DNS 与服务名称解析选项:

root@kitploit:~
--resolve-addrs     resolve ip addresses to hostnames (default: true)
--resolve-ports     resolve port numbers to service names
--no-cache          disable dns caching (force fresh lookups)

DNS 查询会并行执行并缓存以提高性能。在调试或地址频繁变化时,可使用 --no-cache 绕过缓存。

如需更精确的过滤,可结合 ls 使用 key=value 语法:

root@kitploit:~
snitch ls proto=tcp state=listen
snitch ls pid=1234
snitch ls proc=nginx
snitch ls lport=443
snitch ls contains=google

输出

带样式的表格(默认):

root@kitploit:~
  ╭─────────────────┬───────┬───────┬─────────────┬─────────────────┬────────╮
  │ PROCESS         │ PID   │ PROTO │ STATE       │ LADDR           │ LPORT  │
  ├─────────────────┼───────┼───────┼─────────────┼─────────────────┼────────┤
  │ nginx           │ 1234  │ tcp   │ LISTEN      │ *               │ 80     │
  │ postgres        │ 5678  │ tcp   │ LISTEN      │ 127.0.0.1       │ 5432   │
  ╰─────────────────┴───────┴───────┴─────────────┴─────────────────┴────────╯
  2 connections

纯文本输出(-p):

root@kitploit:~
PROCESS    PID    PROTO   STATE    LADDR       LPORT
nginx      1234   tcp     LISTEN   *           80
postgres   5678   tcp     LISTEN   127.0.0.1   5432

配置

可选配置文件位于 ~/.config/snitch/snitch.toml:

root@kitploit:~
[defaults]
numeric = false      # disable name resolution
dns_cache = true     # cache dns lookups (set to false to disable)
theme = "auto"       # color theme: auto, dark, light, mono

[tui]
remember_state = false   # remember view options between sessions

记住视图选项

当 remember_state = true 时,TUI 将保存并恢复:

  • 过滤开关(tcp/udp、listen/established/other)
  • 排序字段和方向
  • 地址和端口解析设置

状态保存到 $XDG_STATE_HOME/snitch/tui.json(默认为 ~/.local/state/snitch/tui.json)。

CLI 标志始终优先于已保存的状态。

环境变量

root@kitploit:~
SNITCH_THEME=dark          # set default theme
SNITCH_RESOLVE=0           # disable dns resolution
SNITCH_DNS_CACHE=0         # disable dns caching
SNITCH_NO_COLOR=1          # disable color output
SNITCH_CONFIG=/path/to     # custom config file path

系统要求

  • Linux 或 macOS
  • Linux:从 /proc/net/* 读取数据,需要 root 或 CAP_NET_ADMIN 才能获取完整进程信息
  • macOS:使用系统 API,获取完整进程信息可能需要 sudo
下载工具
mono