将tshark筛选器与SIP tcp跟踪一起使用

将tshark筛选器与SIP tcp跟踪一起使用,sip,wireshark,wireshark-dissector,Sip,Wireshark,Wireshark Dissector,我有以下线索: : 在wireshark首选项中,我将以下选项设置为Off: 在TCP Prefs中:允许子分离器重新组装TCP流 在SIP prefs中:重新组装跨越多个TCP段的SIP头 在SIP prefs中:重新组装跨越多个TCP段的SIP主体 我正试图用下面给出的tshark命令分析这个跟踪。但在输出中,我没有显示任何数据包,即使数据包在跟踪中: [rishabh@pc Test]$tshark -T fields -E header=y -e ip.src -e tcp.srcpor

我有以下线索:

:

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

在TCP Prefs中:允许子分离器重新组装TCP流

在SIP prefs中:重新组装跨越多个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包含‘500响应程序’”

但我只需要将其作为sip状态代码进行过滤。我如何做到这一点

请注意,SIP状态代码实际上是500,因此初始筛选器应该可以工作。

找到了解决方案:

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”位置找到了首选项名称