dumpcap 是 Wireshark 套件中的一个命令行工具,用于捕获网络数据包。以下是一些常用的 dumpcap 参数及其详解:
-i
dumpcap -i eth0-w
dumpcap -i eth0 -w capture.pcap-C
dumpcap -i eth0 -w capture.pcap -C 100-G
dumpcap -i eth0 -w capture_%Y-%m-%d_%H-%M-%S.pcap -G 3600-K
-q
-v
-B
dumpcap -i eth0 -B 256-e
-E
dumpcap -i eth0 -E frame.len==1500-f
dumpcap -i eth0 -f "port 80"-n
-N
-r
-s
dumpcap -i eth0 -s 65535-t
dumpcap -i eth0 -t ad-T
dumpcap -i eth0 -w capture.pcapng -T pcapng捕获所有通过 eth0 接口的数据包并保存到 capture.pcap 文件中:
dumpcap -i eth0 -w capture.pcap
捕获 eth0 接口上端口 80 的数据包并保存到 capture_port80.pcap 文件中:
dumpcap -i eth0 -f "port 80" -w capture_port80.pcap
捕获 eth0 接口上的数据包,每个文件最大 100MB,每小时轮转一次:
dumpcap -i eth0 -w capture_%Y-%m-%d_%H-%M-%S.pcap -C 100 -G 3600
通过这些参数,你可以灵活地控制 dumpcap 的行为,以满足不同的捕获需求。更多详细信息和选项,可以参考 dumpcap 的手册页(通过 man dumpcap 查看)。