tshark,监听端口不起作用

tshark,监听端口不起作用

如何监听端口?只需连接到主机(IP,例如 google.com):

sudo tshark -i eth0 -H IP  // not working
sudo tshark -i eth0 -H "IP"  // not working
sudo tshark -i eth0 host IP  // not working

和端口:

sudo tshark -i eth0 host IP and port 80 // not working

答案1

-H 是指定一个类似于系统的 /etc/hosts 文件的格式的主机文件。

如果这不是您想要使用的,请查看 -f 标志。这允许您使用 tcpdump 样式的前置或后置过滤器 - 具体取决于它放置的位置。

这里有一些例子:

tshark -f "host 192.168.1.1" -i eth0 -w outputfile.pcap
tshark -i eth0 -f "host 192.168.1.1" -w outputfile.pcap

dumpcap -f "host 192.168.1.1" -i eth0 -w outputfile.pcap
dumpcap -i eth0 -f "host 192.168.1.1" -w outputfile.pcap

tcpdump -i eth0 "host 192.168.1.1 and port 80" -w outputfile.pcap

此外,根据您的机器所看到的流量,您可以查看 dumpcap 或 tcpdump。

相关内容