dumpcap
是 Wireshark 套件中的一个命令行工具,用于捕获网络数据包。以下是一些常用的 dumpcap
参数:
-i, --interface=
-w, --file=
-C, --maxsize=
-G, --seconds=
-W, --write-format=
-q, --quiet
-v, --verbose
-n, --no-syslog
-t, --timestamp
-tt, --timestamp-type=
-f, --filter=
-F, --field-format=
-B, --buffer-size=
-c, --count=
-e, --extend
-E, --extract-as=
-G, --gap-interval=
-I, --immediate-mode
-k, --keep-alive
-L, --list-interfaces
-M, --mtu=
-N, --no-arp
-O, --omit-duplicate-cksummed-packets
-P, --print-packet
sudo dumpcap -i eth0 -w capture.pcapng -C 100 -G 3600 -f "port 80"
这个命令会在 eth0
接口上捕获流量,将数据包写入 capture.pcapng
文件,每个文件最大 100 MB,每 3600 秒创建一个新文件,并且只捕获 HTTP 流量(端口 80)。
dumpcap
通常需要 root 权限,因为它需要访问底层网络接口。更多详细信息和参数说明,可以参考 dumpcap
的官方文档或使用 man dumpcap
查看帮助信息。