2014-09-05 333 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機器上。