2014-09-05 338 views
0

我有以下跟踪:使用tshark的过滤器SIP TCP跟踪

enter image description here

在Wireshark的喜好,我有以下选项设置为关:

在TCP偏好设置:允许subdissector到重新组装的TCP流

在SIP首选项:重新组装SIP报头跨越多个TCP段

在SIP首选项:重新组装跨越多个TCP段的sIP主体

我想用下面给出的tshark命令分析这个跟踪。

[[email protected] 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 
[[email protected] Test]$ 

如何修改过滤器捕获突出显示的数据包:但在输出,即使包有没有在跟踪我没有表现出任何数据包?

我发现,如果切换在所有的上述的wireshark选项TCP数据包被示出为: enter image description here

也许tshark的允许重组默认并且因此不能将数据包过滤器作为SIP信息。另外我可以使用tshark过滤器捕获数据:“tcp包含'500响应者'”

但是我需要将它作为sip状态码进行过滤。我如何实现这一目标?

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

回答

1

找到了解决办法:

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" 

我发现偏好名的位置“%USERPROFILE%\应用数据\ Wireshark的”我的Windows机器上。