Whether troubleshooting network activity, identifying potential attacks, or performance-tuning network links, a common task in analyzing traffic is to identify statistical information. Using this statistical data, we can narrow our focus on specific protocols or data exchanges, instead of trying to assess a larger set of packets.
Fortunately, TShark can collect and display statistical information for live or stored packet captures, supplying basic analysis information and detailed protocol information. By specifying the Z Flag with TShark, you can specify one or more of several supported statistics reporting options. The format of the statistics reporting options uses the following convention:
-z Major name, minor name, option(s), filter
In this example where -z Is the command-line option to TShark, instructing it to expect a statistics reporting option, and Major And Minor name Are one of several available statistics reporting options. Following the minor statistics reporting name are one or more options specific for the selected statistics option. At the end of each statistics reporting option, you can specify a filter string that will cause the statistics reporting to be applied only to the packets matching the specified filter. As of Wireshark 0.99.4, 30 unique statistics reporting options are available. We've provided detailed explanations of several of the most commonly used statistics reporting options in the following section.
Chapter 9 • Other Programs Packaged with Wireshark
A
Tip_
By default, TShark will print a one-line summary for each packet received. When examining statistical information by using the -z Option, you may want to suppress this information and show only the statistics reporting by adding the -q Option as well.
Protocol Hierarchy Statistics
Syntax: -z io, phs[,Filter]
Description: The protocol hierarchy statistics (PHS) option reports a summary of the protocols identified in the packet capture, and the number of packets and bytes for each protocol. Optionally, specify a display filter to report protocol hierarchy and traffic statistics for an identified group of frames.
Example: The following is an example of using the TShark statistics function to display a report of all bytes and frames for each protocol detected during a live capture on the first available interface, disabling name resolution and the packet summary output, and reporting the collected statistics after ending the capture by typing Ctrl + C.
C:\Program Files\Wireshark>tshark - nqz io, phs <cntrl-c>
===================================================================
Protocol Hierarchy Statistics Filter: frame
Frame eth ip
Udp dns data isakmp
Tcp http
Llc ipx
Ipxsap
Frames:560 bytes:115233 frames:560 bytes:115233 frames:558 bytes:115005 frames:53 bytes:10383 frames:21 bytes:3215 frames:8 bytes:4 96 frames:24 bytes:6672 frames:505 bytes:104622 frames:107 bytes:81798 frames:2 bytes:228 frames:2 bytes:228 frames:2 bytes:228
===================================================================
Protocol Statistics by Interval
Syntax: -z Io, stat, interval[,filter][,filter][,filter]... Description: The protocol statistics by interval option reports a summary of the number of frames and bytes recorded in the capture file for each specified interval duration. The interval must be specified in a duration of seconds as a whole or a fractional number of seconds. The output of the statistics reporting will contain one or more columns; by default, with no display filter specified, the first column will indicate the statistics for the entire contents of the packet capture. If one or more display filters are specified, the results of each will be displayed in the first and successive columns. This allows you the quickly examine the nature of traffic for the entire packet capture, and the results of one or more display filters.
The protocol statistics by interval option can also report statistics based on calculations, including count() , sum() , min() , max() , and avg() using the following convention in the place of a display filter:
Where <field> is the name of a display field you wish to apply the calculations on, and <filter> is a display filter that includes the specified field name. Note that you can only perform the calculations on fields that are integers or relative time fields, and the display filter must include the named field in the filter syntax. Example: The following example demonstrates TShark statistics by interval reporting while reading from a stored packet capture file named Kismet-Sep-06-2005.dump in five-minute (300 second) intervals for both the entire capture file (denoted with the globally matching display filter frame) and the results of the display filter ip. addr eq 10.18.129.130, while suppressing the standard display output.
C:\>tshark - r Kismet-Sep-06-2 005.dump - z io, stat,300,"frame","ip. addr eq 10.18.12 9.130" - q
IO Statistics interval: 300.000 secs Column #0: frame
Column #1: ip. addr eq 10.18.129.130
[COUNTJSUMJMINJMAX|AVG](<fleld>)<fllter>
Column #0
Column #1
Time
|frames| bytes |frames| bytes
000.000-300.000
82
5874
0
0
300.000-600.000
248
18104
8
928
|
600.000-900.000
|
1171
|
86793
|
9
|
1044
|
|
900.000-1200.000
|
1247
|
93774
|
10
|
1160
|
|
1200.000-1500.000
|
1377
|
102314
|
6
|
696
|
|
1500.000-1800.000
|
2128
|
819636
|
4
|
464
|
|
1800.000-2100.000
|
1357
|
102840
|
8
|
928
|
|
2100.000-2400.000
|
1587
|
116295
|
10
|
1160
|
|
2400.000-2700.000
|
1565
|
179061
|
2
|
232
|
|
2700.000-3000.000
|
1450
|
98959
|
7
|
812
|
|
3000.000-3300.000
|
1436
|
101291
|
4
|
464
|
|
3300.000-3600.000
|
1826
|
218948
|
7
|
812
|
|
3600.000-3900.000
|
517
|
48140
|
0
|
0
|
Tip_
When specifying display filters using command-line tools, use the alphabetic comparison operators (eq, ne, lt, gt). This will prevent your shell from interpreting meta-characters such as the exclamation mark.
The next example of statistics interval reporting reports the average frame size (using the display filter frame. pkt_len), the smallest frame size, and the maximum frame size in five-minute intervals.
C:\>tshark - r wireless-rwc-1.cap - qz
Io, stat,300,AVG(frame. pkt_len)frame. pkt_len, MIN(frame. pkt_len )frame. pkt_len, MAX(frame. pkt_len)frame. pkt_len
IO Statistics Interval: 300.000 secs
Column #0: AVG(frame. pkt_len)frame. pkt_len Column #1: MIN(frame. pkt_len)frame. pkt_len Column #2: MAX(frame. pkt_len)frame. pkt_len
| Column #0 | Column #1 | Column #2
Time | AVG | MIN | MAX
000.000-300.000 71 58 82
300.000-600.000 73 58 116
600.000-900.000 74 54 608
|
900.000-1200.000
|
75
|
58
|
388
|
|
1200.000-1500.000
|
74
|
58
|
132
|
|
1500.000-1800.000
|
385
|
58
|
1532
|
|
1800.000-2100.000
|
75
|
58
|
1432
|
|
2100.000-2400.000
|
73
|
58
|
388
|
|
2400.000-2700.000
|
114
|
58
|
1532
|
|
2700.000-3000.000
|
68
|
58
|
116
|
|
3000.000-3300.000
|
70
|
58
|
360
|
|
3300.000-3600.000
|
119
|
52
|
1532
|
|
3600.000-3900.000
|
93
|
58
|
336
|
Conversation Statistics
Syntax: -z conv, Type [, filter]
Description: The conversation statistics reporting option will display the conversations between stations in the capture file of the specified type, matching the specified display filter or all traffic if the display filter is omitted. Currently supported conversation types are:
■ eth Ethernet
■ fc Fiber channel
■ fddi FDDI
■ ip IP addresses
■ ipx IPX addresses
■ tcp TCP/IP socket pairs
■ tr Token ring
■ udp UDP/IP socket pairs
This option is useful to assess the conversations between stations on the net-work. This is a common technique for analyzing traffic for signs of worm activity, since an infected station will often scan large quantities of hosts to look for additional infection targets, as opposed to stations that are not infected, which typically restrict their conversations to a small number of hosts.
Example: This example reads from the capture file defcon. dump and collects statistics for IP conversations, using the display filter ip. addr eq 216.250.64.68, which will restrict the statistics to conversations from this host (output of this command has been trimmed for space).
$ tshark - r defcon. dump - nqz conv, ip,"ip. addr eq 216.250.64.68"
IPv4 Conversations Filter:ip. addr eq 216.250.64.68
| <- | | -> | | Total |
|Frames Bytes| |Frames Bytes| |Frames Bytes|
|
216.250.64.68
|
<->
|
192.168.2.215
|
85
|
8887
|
98
|
19007
|
183
|
27894
|
|
216.250.64.68
|
<->
|
192.168.2.237
|
69
|
7076
|
42
|
8555
|
111
|
15631
|
|
216.250.64.68
|
<->
|
192.168.2.23
|
60
|
6064
|
4
|
795
|
64
|
6859
|
|
216.250.64.68
|
<->
|
192.168.2.212
|
51
|
4687
|
2
|
453
|
53
|
5140
|
|
216.250.64.68
|
<->
|
192.168.0.173
|
35
|
3859
|
16
|
3099
|
51
|
6958
|
|
216.250.64.68
|
<->
|
192.168.2.14 9
|
19
|
1791
|
26
|
4493
|
45
|
6284
|
|
216.250.64.68
|
<->
|
192.168.2.102
|
18
|
2933
|
20
|
3852
|
38
|
6785
|
|
216.250.64.68
|
<->
|
192.168.1.12 0
|
29
|
2657
|
9
|
1257
|
38
|
3914
|
|
216.250.64.68
|
<->
|
192.168.2.72
|
9
|
864
|
22
|
5472
|
31
|
6336
|
|
216.250.64.68
|
<->
|
192.168.0.153
|
20
|
1871
|
9
|
3658
|
29
|
5529
|
|
216.250.64.68
|
<->
|
192.168.41.150
|
25
|
2348
|
3
|
348
|
28
|
2696
|
|
216.250.64.68
|
<->
|
192.168.2.248
|
12
|
2370
|
15
|
3459
|
27
|
5829
|
|
216.250.64.68
|
<->
|
192.168.2.192
|
14
|
1454
|
13
|
2460
|
27
|
3914
|
|
216.250.64.68
|
<->
|
192.168.2.185
|
10
|
1087
|
17
|
5907
|
27
|
6994
|
|
216.250.64.68
|
<->
|
192.168.2.103
|
16
|
1690
|
10
|
1759
|
26
|
3449
|
|
216.250.64.68
|
<->
|
192.168.3.2
|
19
|
1735
|
6
|
1973
|
25
|
3708
|
|
216.250.64.68
|
<->
|
192.168.2.7
|
13
|
1208
|
11
|
4155
|
24
|
5363
|
|
216.250.64.68
|
<->
|
192.168.0.12 7
|
11
|
1123
|
12
|
2094
|
23
|
3217
|
|
216.250.64.68
|
<->
|
192.168.2.121
|
18
|
1752
|
5
|
1150
|
23
|
2902
|
Packet Length Distribution
Syntax: -z plen, tree[,Filter]
Description: The packet length distribution reporting option will identify the distribution of frames in the capture file by 20-byte increments, identifying the rate and percentage of each packet length group. This feature can be helpful in network troubleshooting, where large quantities of small packets can place additional burden on networking equipment that leads to reduced throughput. Example: The following example reads from the dc11.dump capture file and reports the distribution of packet sizes. This particular capture has an unusually large quantity of frames between 40 and 79 bytes in length, which might warrant further analysis.
C:\>tshark - r dc11.dump - nqz plen, tree
===================================================================
Packet Length
Packet Length 0-19 20-39 40-79 80-159 160-319 320-639 640-1279 1280-2559 2560-5119 5120-
Value
Rate
664070
0 0
494456 114463 16117 13583 3597 21854 0 0
0.001293 0.000000 0.000000 0.000962 0.000223 0.000031 0.000026 0.000007 0.000043 0.000000 0.000000
Percent
0.00% 0.00% 74.46% 17.24% 2.43% 2.05% 0.54% 3.29% 0.00% 0.00%
Destinations Tree
Syntax: -z dests, tree,Filter
Description: The Destinations Tree statistics option identifies the number of frames, data rate, and transport-layer protocol information for the specified capture file. This report allows you to quickly assess the activity in the capture file, characterizing the nature of traffic to destination hosts.
Example: The following example reads from the Http. cap capture file and identifies the destination addresses, transport protocol, and the percentage of network activity by destination address.
C:\>tshark - r Http. cap - nqz dests, tree
===================================================================
Destinations
Value
Rate
Destinations 145.254.160.237 TCP 80 UDP
43 20 19 19 1
0.001415 0.000658 0.000625
0.000625 0.000033
Percent
46.51%
95.00% 100.00%
5.00%
53 1 0.000033 100.00%
65.208.228.223 18 0.000592 41.86%
TCP 18 0.000592 100.00%
3372 18 0.000592 100.00%
145.253.2.203 1 0.000033 2.33%
UDP 1 0.000033 100.00%
3009 1 0.000033 100.00%
216.239.59.99 4 0.000132 9.30%
TCP 4 0.000132 100.00%
3371 4 0.000132 100.00%
Packet Summary Columns
Syntax: -z proto, colinfo,Filter, field
Description: The packet summary columns statistics option allows you to add any Wireshark protocol field to the one-line display output. By default, TShark will display several fields in the one-line display output when processing a packet capture. If you require additional fields to be reported, you can specify additional fields to be reported as well, giving us tremendous reporting flexibility that can be sent to other scripting tools to extract and use the reported data. This parameter can be specified multiple times on the command line to add an arbitrary number of additional columns. Note that it is necessary to include the field you wish to append to the packet summary output in the display filter string.
Example: The following example reads from the Http. cap capture file and reports the standard summary output.
C:\>tshark - r Http. cap - n
1 0.000000 145.254.160.237 -> 65.208.228.223 3372 > 80 [SYN] Seq=0 Len=0 MSS=1460
2 0.911310 6 5.208.228.223 -> 145.254.160.237 80 > 3372 [SYN, ACK] Seq=0 Ack=1 Win=5840 Len=0 MSS=1380
3 0.911310 145.254.160.237 -> 65.208.228.223 3372 > 80 [ACK] Seq=1 Ack=1 Win=9660 Len=0
The next example uses the packet summary columns feature to add the IP identification and time-to-live values to the summary output.
C:\>tshark - r Http. cap - nz proto, colinfo, ip. ttl, ip. ttl - z proto, colinfo, ip. id, ip. id
1 0.000000 145.254.160.237 -> 6 5.208.228.223 3372 > 80 [SYN] MSS=1460 ip. id == 0x0f41 ip. ttl == 128
Seq=0 Len=0
2 0.911310 65.208.228.223 -> 14 5.254.160.237 80 > 3372 [SYN, Ack=1 Win=5840 Len=0 MSS=1380 ip. id == 0x0000 ip. ttl == 47
ACK] Seq=0
3 0.911310 145.254.160.237 -> 65.208.228.223 3372 > 80 [ACK] Win=9660 Len=0 ip. id == 0x0f44 ip. ttl == 128
Seq=1 Ack=1
SIP Statistics
Syntax: -z sip, stat,Filter
Description: The Session Initialization Protocol (SIP) statistics reporting option will identify all the SIP traffic in the capture and report the number of sent and resent messages, the status codes from SIP responses, and the observed SIP messages. This reporting option is helpful to assess the activity on voice over IP (VoIP) networks that use the SIP protocol for call setup and teardown. By default, statistics are reported on all SIP activity in the capture; note that you can supply a display filter to limit the statistics reporting to a single host (such as ip. addr eq 192.168.1.1). Example: The following example reads from the sip1.dump stored capture file and reports the observed SIP statistics for all hosts:
C:\>tshark - r sip1.dump - nqz sip, stat
SIP Statistics
Number of SIP messages: 37 Number of resent SIP messages: 0
* SIP Status Codes in reply packets
SIP 407 Proxy Authentication Required : 1 Packets
SIP 200 OK : 10 Packets
SIP 100 Trying : 4 Packets
SIP 180 Ringing : 2 Packets
* List of SIP Request methods INVITE : 9 Packets BYE : 2 Packets ACK : 9 Packets
H.225 Counters
Syntax: -z h22 5,counter[,filter]
Description: VoIP networks using H.323 also use the H.225 protocol for call establishment and control (signaling) and registration, admission and status functions (RAS). The H.225 counters statistics will count H.225 messages in the capture and the reason codes associated with the messages. By default, all H.225 messages will be used for reporting, but you may optionally supply a display filter to restrict the analysis to a specified group of packets.
Example: The following example reads from the specified compressed capture file and reports observed H.225 statistics.
C:\>tshark - r rtp_example. raw. gz - nqz h225,counter
================== H225 Message and Reason Counter ==================
RAS-Messages: Call Signalling: setup : 1
CallProceeding : 1 connect : 1 alerting : 1
H.225 Service Response Time
Syntax: -z h22 5,srt[ ,/ilter]
Description: Another H.225 statistics reporting mechanism, the H.225 Service Response Time (SRT) statistics option reports the RAS message type; minimum, maximum, and average SRT metrics; the number of open requests (that have not yet received a response); discarded requests; and duplicate messages. Each of these statistics can be useful for analyzing activity on VoIP networks to identify traffic patterns and metrics that could negatively influence VoIP service.
Media Gateway Control Protocol Round Trip Delay
Syntax: -z mgcp, rtd[ ,/ilter]
Description: The Media Gateway Control Protocol (MGCP) is used in VoIP networks as an intermediary between traditional telephone circuits and data packets. Using this statistics reporting option, you can identify the response time delay (RTD) between stations and the MGCP server, and duplicate requests and responses, requests to unresponsive servers, and responses that do not match any requests.
SMB Round Trip Data
Syntax: -z smb, rtt[ ,/ilter]
Description: The Server Message Blocks (SMB) protocol is a mechanism used for networked file systems, predominately used for Microsoft Windows clients. Using the SMB Round Trip Data (RTD) statistics reporting option, we can assess the responsiveness of Windows file-sharing servers and other SMB resources (including some networked printers) to identify the responsiveness of server resources. Example: In this example, the packet capture file rtl-fileshare. dump is read using TShark to report SMB RTT statistics. Note that the Max RTT for the SMB Trans request in this output may indicate a burdened server resource that is unable to respond to the request sooner.
$ tshark - r rtl-fileshare. dump - nqz smb, rtt
SMB RTT Statistics: Filter:
|
Commands
|
Calls
|
Min RTT
|
Max RTT
|
Avg RTT
|
|
Open
|
1
|
0.00186
|
0.00186
|
0.00186
|
|
Close
|
4
|
0.00023
|
0.00176
|
0.00066
|
|
Trans
|
5
|
0.00190
|
13.69178
|
2.76430
|
|
Open AndX
|
1
|
0.00450
|
0.00450
|
0.00450
|
|
Read AndX
|
309
|
0.00025
|
0.01865
|
0.00412
|
|
Tree Disconnect
|
7
|
0.00117
|
0.14601
|
0.02 324
|
|
Negotiate Protocol
|
8
|
0.00026
|
0.07451
|
0.02226
|
|
Session Setup AndX
|
16
|
0.00028
|
0.0192 8
|
0.00578
|
|
Logoff AndX
|
12
|
0.00074
|
0.00872
|
0.00258
|
|
Tree Connect AndX
|
7
|
0.00081
|
0.00399
|
0.00190
|
|
NT Create AndX
|
4
|
0.00029
|
0.00270
|
0.00132
|
|
Transaction2 Commands
|
Calls
|
Min RTT
|
Max RTT
|
Avg RTT
|
|
FIND FIRST2
|
1
|
0.19993
|
0.19993
|
0.19993
|
|
QUERY FS INFO
|
2
|
0.00023
|
0.0024 8
|
0.00135
|
|
QUERY FILE INFO
|
2
|
0.00040
|
0.00551
|
0.00296
|
|
NT Transaction Commands
|
Calls
|
Min RTT
|
Max RTT
|
Avg RTT
|
SMB Security Identifier Name Snooping
Syntax: -z smb, sids
Description: Another SMB analysis feature is the capability to use security identifier (SID) snooping techniques to identify potentially sensitive SIDs and their associated account names. This feature can be useful when performing a security audit of traffic captured from a Windows network, representing information that is valuable to an attacker for impersonating a legitimate user.
Because of the sensitive nature of this feature, the SMB SID snooping feature is not enabled by default. To use this statistics reporting option on the command line, you must also enable the Snoop SID preference in Wireshark by clicking Edit | Preferences | Protocols | SMB | Snoop SID to name mappings, Or specify the preference on the command line with - o smb. sid_name_snooping:TRUE.
BOOTP Statistics
Syntax: -z bootp, stat,[fiilter]
Description: TShark can report statistics for the BOOTP protocol used by DHCP, including the DHCP message and the number of packets for each type. This can be helpful to troubleshoot DHCP server problems, or to diagnose rogue (e. g., unauthorized) DHCP servers that may exist on your network.
Example: The following example reads from a stored capture file and identifies the BOOTP statistics in the file, identifying the DHCP server message types and packet counts. Note that the tailing comma after the Stat Keyword is required, even though a display filter is not specified in this example.
$ tshark - nqr rtl-fileshare. dump - z bootp, stat,
===================================================================
BOOTP Statistics with filter BOOTP Option 53: DHCP Messages Types: DHCP Message Type Packets nb
Inform 74 ACK 2 75 Release 10 NAK 82 Decline 25 Request 1255 Discover 1811 Offer 279
===================================================================
HTTP Statistics
Syntax: -z http, stat,[fiilter]
Description: TShark can report statistics for the HTTP transactions, identifying the status response codes and request methods observed in the capture file. This feature can be useful to quickly identify how a particular Web server is being used, identifying errors being returned from the server.
Example: The following example reads from a stored capture file and identifies the observed HTTP statistics. Note that the tailing comma after the Stat Keyword is required, even though a display filter is not specified in this example.
$ tshark - r Kismet-Aug-01-2 002-2.dump - nqz http, stat,
===================================================================
HTTP Statistics
* HTTP Status Codes in reply packets
|
HTTP
|
4 08
|
Request Time-out
|
|
HTTP
|
301
|
Moved Permanently
|
|
HTTP
|
302
|
Moved Temporarily
|
|
HTTP
|
304
|
Not Modified
|
|
HTTP
|
200
|
OK
|
|
HTTP
|
2 06
|
Partial Content
|
|
HTTP
|
100
|
Continue
|
|
HTTP
|
403
|
Forbidden
|
|
HTTP
|
404
|
Not Found
|
* List of HTTP Request methods SEARCH 336 GET 1447 POST 8 HEAD 2
===================================================================
HTTP Tree Statistics
Syntax: -z http, tree[,Filter]
Description: In addition to the HTTP statistics reporting feature, TShark can also present a tree-like view of HTTP activity, identifying the types of request and response packets, the quantities of each type, data rates, and overall percentages of all request and response types. This feature is also helpful at identifying how a Web
Server is being used, and can even identify potentially malicious activity with unsupported or broken HTTP requests or responses.
Example: The following example reads from a stored capture file and reports HTTP statistics in the tree-like view.
C:\>tshark - r Kismet-Aug-01-2 002-2.dump - nqz http, tree
===================================================================
HTTP/Packet Counter
Value
Rate
Percent
Total HTTP Packets HTTP Request Packets SEARCH GET POST HEAD
HTTP Response Packets
|
???:
|
Broken
|
|
1xx:
|
Informational
|
|
100
|
Continue
|
|
2xx:
|
Success
|
|
200
|
OK
|
|
206
|
Partial Content
|
|
3xx:
|
Redirection
|
|
304
|
Not Modified
|
|
302
|
Found
|
|
301
|
Moved Permanently
|
|
4xx:
|
Client Error
|
|
408
|
Request Time-out
|
|
404
|
Not Found
|
|
403
|
Forbidden
|
|
5xx:
|
Server Error
|
|
Other
|
HTTP Packets
|
8067 1793 336 1447 8 2
1296
0
121 121
689 685 4
479 452 24 3
7
4 1 2
0
4978
0.001504 0.000334 0.000063 0.000270 0.000001 0.000000 0.000242 0.000000 0.000023
0.000023 0.00012 8 0.000128 0.000001 0.00008 9 0.000084 0.000004 0.000001 0.000001 0.000001 0.000000 0.000000 0.000000 0.000928
22.23% 18.74% 8 0.70% 0.45% 0.11% 16.07% 0.00% 9.34% 100.00% 53.16% 99.42% 0.58% 3 6.96% 94.36% 5.01% 0.63% 0.54% 57.14% 14.2 9% 28.57% 0.00% 61.71%
===================================================================
HTTP Request Statistics
Syntax: -z http_req, tree[,Filter]
Description: If you wish to get more detailed reporting of activity with an HTTP server, you can use TShark's HTTP Request statistics reporting option, which will identify all the HTTP request URLs for each HTTP server in the packet capture, including the number of frames, data rate, and request percentage. This is useful to identify popular requests for a specific server (the HTTP requests that are most popular will have the highest percentage values for each server). This option is often used with a display filter to assess the activity for one or more hosts, but can also be used without a display filter to identify the servers and URLs requests by client systems within your organization.
Example: The following example reads from a stored capture file and reports HTTP request statistics in the tree-like format, limiting the analysis to traffic to or from the host at 66.207.160.150.
C:\>tshark - r Kismet-Aug-01-2 002-2.dump - nqz http_req, tree,"ip. addr eq 66.207.60.150"
|
HTTP/Requests
|
Value
|
Rate
|
Percent
|
|
HTTP Requests by HTTP Host
|
35
|
0.000757
|
|
Www. megatokyo. com
|
35
|
0.000757
|
100.00%
|
|
/parts/mt2-head-top. gif
|
3
|
0.000065
|
8.57%
|
|
/parts/mt2-merchandise. gif
|
2
|
0.000043
|
5.71%
|
|
/parts/mt-shadow-right. gif
|
8
|
0.000173
|
22.86%
|
|
/parts/mt-glow-top. gif
|
4
|
0.000087
|
11.43%
|
|
/parts/mt-blk bar-credits. gif
|
14
|
0.000303
|
40.00%
|
|
/parts/pix-dark. gif
|
1
|
0.000022
|
2.86%
|
|
/parts/mt-bottom-prev. gif
|
2
|
0.000043
|
5.71%
|
|
/parts/mt-glow-bottom. gif
|
1
|
0.000022
|
2.86%
|
Notes from the Underground...
XML Compatible Protocol Dissection
A new feature to TShark in version 0.10.0 is the ability to display output in PDML format by using the -T pdml Option. The Politecnico Di Torino group, known for Analyzer and WinPcap, created the PDML specification. PDML is a simple language to format information related to packet decodes. The PDML data TShark produces differs slightly from the specification and is not readable by Analyzer. The TShark PDML output contains the following flags:
■ <pdml> This PDML file is delimited by the <pdml> and </pdml> tags. This tag does not have any attributes.
Example: <pdml version="0" creator="Wireshark/0.10.0">
■ <packet> A PDML file can contain multiple packets by using the <packet> element. This tag does not have any attributes.
■ <proto> A packet can contain multiple protocols, designated by the <proto> element. The <proto> tag can have the following attributes:
■ name The display filter name for the protocol.
■ showname The label used to describe this protocol in the protocol tree.
■ pos The starting offset within the packet data where this protocol starts.
■ size The number of octets in the packet data this protocol covers.
Example: <proto name="ip" showname="Internet Protocol, Src Addr: 192.168.100.132
(192.168.100.132), Dst Addr: 192.168.129.201 (192.168.129.201)" size="20" pos="14">
■ <field> A protocol can contain multiple fields, designated by the <field> element. The <field> tag can have the following attributes:
■ name The display filter name for the field.
■ showname The label used to describe this field in the protocol tree.
■ pos The starting offset within the packet data where this field starts.
Continued
■ size The number of octets in the packet data this field covers.
■ value The actual packet data, in hex, this field covers.
■ show The representation of the packet data as it appears in a display filter.
Example: <field name="ip. version" showname="Version: 4" size="1"
Pos="14" show="4" value="45"/>
Two tools are provided in the Wireshark-0.10.0a/tools directory to assist with PDML output parsing. WiresharkXML. py is a Python module used to read a PDML file and call a specified callback function. msnchat is a sample program that uses WiresharkXML to parse PDML output for MSN chat conversations. It takes one or more capture files as input, invokes TShark with a specified read filter, and produces HTML output of the conversations. The usage output for msnchat is as follows:
[root@localhost tools]# ./msnchat - h msnchat [OPTIONS] CAPTURE_FILE [...]
-o FILE name of output file
-t TSHARK location of TShark binary
-u USER name for unknown user
The following command can be used to read and parse a saved capture file called msn_test1.
[root@localhost tools]# ./msnchat - o outfile msn_test1
When viewed with a Web browser, the HTML outfile looks like this:
---- New Conversation @ Dec 30, 2003 14:21:08 ----
(14:21:08) Luke: hello
(14:21:22) Unknown: how are you?
(14:21:53) Luke: are we meeting at noon?
(14:22:03) Unknown: yes, at the secret location.
(14:22:11) Luke: great, see you then
(14:22:17) Unknown: ok
(14:22:18) Unknown: bye
You can add a name for the Unknown user by typing the command:
[root@localhost tools]# ./msnchat - o outfile - u Leia msn_test1
The HTML output would then look like this:
Continued
---- New Conversation @ Dec 30, 2003 14:21:08 ----
|
(14:21:08)
|
Luke:
|
Hello
|
|
(14:21:22)
|
Leia:
|
How are you?
|
|
(14:21:53)
|
Luke:
|
Are we meeting at noon?
|
|
(14:22:03)
|
Leia:
|
Yes, at the secret location.
|
|
(14:22:11)
|
Luke:
|
Great, see you then
|
|
(14:22:17)
|
Leia:
|
Ok
|
|
(14:22:18)
|
Leia:
|
Bye
|
The msnchat code will give you a good idea of how to write your own scripts to parse capture files, manipulate the PDML data, and print the output in HTML format.