0

我有以下跟踪:

在此处输入图像描述

在 wireshark 首选项中,我将以下选项设置为 Off :

在 TCP Prefs 中:允许 subdissector 重新组装 TCP 流

在 SIP 首选项中:重新组装跨越多个 TCP 段的 sIP 标头

在 SIP prefs 中:重新组装跨越多个 TCP 段的 sIP 主体

我正在尝试使用下面给出的 tshark 命令分析此跟踪。但是在输出中我没有显示任何数据包,即使数据包在跟踪中:

[rishabh@pc Test]$tshark -T fields -E header=y -e ip.src -e tcp.srcport -e ip.dst  -e tcp.dstport -R "sip.Status-Code eq 500" -r "4.cap"
ip.src  tcp.srcport ip.dst  tcp.dstport
[rishabh@pc Test]$ 

如何修改过滤器以捕获突出显示的数据包?

我发现,如果我打开所有上述 Wireshark 选项,TCP 数据包将显示为: 在此处输入图像描述

也许 tshark 默认允许重组,因此它无法将数据包过滤为 SIP 消息。我还可以使用 tshark 过滤器捕获数据:“tcp contains '500 Responder'”

但我只需要将其过滤为 sip 状态代码。我如何实现这一目标?

请注意,SIP 状态代码确实是 500,因此初始过滤器应该可以工作。

4

1 回答 1

2

找到了解决方案:

tshark 允许您设置重组首选项的设置。偏好是:

Whether subdissector can request TCP streams to be reassembled
TRUE or FALSE (case-insensitive)
tcp.desegment_tcp_streams: TRUE

Whether the SIP dissector should reassemble headers of a request spanning multiple TCP segments. To use this option, you must also enable "Allow subdissectors to reassemble TCP streams" in the TCP protocol settings.
TRUE or FALSE (case-insensitive)
sip.desegment_headers: TRUE

Whether the SIP dissector should use the "Content-length:" value, if present, to reassemble the body of a request spanning multiple TCP segments, and reassemble chunked data spanning multiple TCP segments. To use this option, you must also enable "Allow subdissectors to reassemble TCP streams" in the TCP protocol settings.
TRUE or FALSE (case-insensitive)
sip.desegment_body: TRUE

在 tshark 中将这些标志与 -o 选项一起使用,可以自定义首选项。我使用以下 tshark 命令解决我的问题:

/home/atsuser/Tools/wireshark/tshark -T fields -E header=y -e ip.src -e tcp.srcport -e ip.dst -e tcp.dstport -e frame.number -r 4.cap -o sip.desegment_headers:FALSE -o sip.desegment_body:FALSE -o tcp.desegment_tcp_streams:FALSE -R "sip.Status-Code eq 500"

我在 Windows 机器上的“%USERPROFILE%\Application Data\Wireshark”位置找到了首选项名称。

于 2014-09-08T20:17:48.847 回答