2014-05-11 30 views
0

我有以下命令:如何捕獲僅TCP流量與tshark的

tshark -n -r ./file.dump -Y "(tcp.flags.syn==1 or tcp.flags.ack==1 and tcp.flags.fin==0)" 

出於某種原因,打印和ICMP消息。

如何告訴tshark只打印tcp數據包?

我唯一想到的是grep它grep "TCP"。但這不是一個好的解決方案。

回答

2

出於某種原因打印ICMP消息。

Wireshark/TShark解析ICMP消息的有效載荷;如果它們碰巧包含TCP段的一部分,則將被解析,所以包將包含這些標記)。

如何告訴tshark只打印tcp數據包?

tshark -n -r ./file.dump -Y "not icmp and (tcp.flags.syn==1 or tcp.flags.ack==1 and tcp.flags.fin==0)"