如何指定 tshark 脚本在什么接口上捕获

How to specify tshark script what interface to capture on

我运行这个命令的目的是捕获端口 5060 上的所有 SIP 流量

C:\windows\system32>"C:\Program Files\Wireshark\tshark.exe" -f "tcp port 5060 or udp port 5060" -b filesize:25000 -b files:1200 -w c:\shark\capture.pcap

正在 'Local Area Connection* 9'

拍摄

不幸的是,我不想捕获“Local Area Connection* 9”上的流量,而是捕获 VoIPsys 上的流量。如下所示,当我打开 Wireshark 时,此选项可用于 select:

我也不明白为什么sharkt默认选择“Local Area Connection* 9”

manual 明确表示

It will use the pcap library to capture traffic from the first available network interface and displays a summary line on the standard output for each received packet.

因此,你得到了这个界面。 为了使用其他接口,您可以使用“-D”开关列出接口,并使用带有“-i”选项的接口

作为一种无需命令行的更简单方法,您可以 select 在顶部栏中“捕获”,然后在打开 GUI 时选择“选项”。

使用您要跟踪的界面 selected,您可以添加过滤器。如果您只查找 5060 SIP 流量,只需在“端口 5060”框中输入并按开始。这只会通过您想要的过滤 protocol/port/IP 等进行捕获。

我经常使用它们,如果您需要,可以在这里找到列表:https://wiki.wireshark.org/CaptureFilters

谢谢。