在 Debian 系统上查看或确认 dumpcap(Wireshark 的命令行抓包工具)相关信息,常见需求包括:是否安装、版本、路径、权限、依赖等。下面按常见场景说明。
which dumpcap
或
command -v dumpcap
如果返回路径(如 /usr/bin/dumpcap),说明已安装。
在 Debian 中,dumpcap 属于 wireshark-common:
dpkg -S dumpcap
输出示例:
wireshark-common: /usr/bin/dumpcap
dumpcap --version
示例输出:
Dumpcap (Wireshark) 4.0.11 (Git v4.0.11 packaged as 4.0.11-1~deb12u1)
whereis dumpcap
或
ls -l $(which dumpcap)
常见路径:
/usr/bin/dumpcap
dumpcap 需要 抓包权限,否则普通用户无法使用。
ls -l /usr/bin/dumpcap
你可能看到类似:
-rwxr-xr-x 1 root root ...
或(推荐方式)
-rwxr-xr-x 1 root wireshark ...
Debian 通常使用 Linux capabilities 而不是 setuid:
getcap /usr/bin/dumpcap
正常输出示例:
/usr/bin/dumpcap = cap_net_admin,cap_net_raw+eip
如果没有输出,说明没有抓包权限。
sudo usermod -aG wireshark $USER
然后 重新登录 或:
newgrp wireshark
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
apt-cache depends wireshark-common
或
ldd $(which dumpcap)
sudo apt update
sudo apt install wireshark-common
安装过程中会询问:
Should non-superusers be able to capture packets? ✅ 选 Yes
which dumpcap
dumpcap --version
getcap /usr/bin/dumpcap
groups
如果你是想:
可以告诉我你的具体使用场景,我可以给你更针对性的命令。