【问题标题】:How to capture only TCP traffic with tshark如何使用 tshark 仅捕获 TCP 流量
【发布时间】:2014-05-12 01:47:56
【问题描述】:

我有以下命令:

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"。但这不是一个好的解决方案。

【问题讨论】:

    标签: network-protocols tshark


    【解决方案1】:

    出于某种原因打印 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)"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-21
      • 1970-01-01
      • 2011-10-19
      • 2017-02-11
      • 2018-01-27
      • 1970-01-01
      • 1970-01-01
      • 2011-04-30
      相关资源
      最近更新 更多