<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Security Blog</title>
	<atom:link href="http://biglib.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://biglib.net</link>
	<description>The Big Security Library abot IT Security</description>
	<lastBuildDate>Mon, 30 Aug 2010 07:45:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Dumpcap</title>
		<link>http://biglib.net/dumpcap/</link>
		<comments>http://biglib.net/dumpcap/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 07:45:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dumpcap]]></category>

		<guid isPermaLink="false">http://biglib.net/dumpcap/</guid>
		<description><![CDATA[The dumpcap utility is used to capture traffic from a live interface and save to a libpcap file. This utility includes a subset of the functions available in TShark, but does not include the vast library of protocol decoders. This &#8230; <a href="http://biglib.net/dumpcap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The dumpcap utility is used to capture traffic from a live interface and save to a libpcap file. This utility includes a subset of the functions available in TShark, but does not include the vast library of protocol decoders. This gives dumpcap a significantly smaller footprint, which can be beneficial on low-memory systems capturing traffic with multiple processes.</p>
<p>The following command-line options are used to control dumpcap's data processing and output.</p>
<p><b>&#9632;&nbsp;—a <i>Test:value </i></b>Instructs dumpcap to stop writing to a file when it meets the specified test condition and value. This option mirrors the functionality of <b>—a </b>In TShark.</p>
<p><b>&#9632;&nbsp;—b <i>Number of ring buffer files ['.duration] </i></b>Used with the <b>—a </b>Option, causes dumpcap to continue capturing data to successive files. This option mirrors the functionality of <b>—b </b>In TShark.</p>
<p><b>&#9632;&nbsp;—B <i>Buffer size </i></b>Available only on Windows systems, causes dumpcap to allocate a buffer for storing packet data during a capture before writing to the disk. This option mirrors the functionality of <b>—B </b>In TShark.</p>
<p><b>&#9632;&nbsp;—c <i>Count </i></b>Sets the default number of packets to read when capturing data. This option mirrors the functionality of <b>—c </b>In TShark.</p>
<p><b>&#9632;&nbsp;—D </b>Instructs dumpcap to print a list of available interfaces on the system, mirroring the functionality of <b>—D </b>In TShark.</p>
<p><b>&#9632;&nbsp;—f <i>Capture filter expression </i></b>Allows you to set the filter expression to use when capturing data, mirroring the functionality of <b>—f </b>In TShark.</p>
<p><b>&#9632;</b><b>&nbsp;—h </b>Prints the version of dumpcap and the help options, and then exits.</p>
<p><b>&#9632;&nbsp;—i <i>Interface </i></b>Specifies the interface you want to use to capture data, mirroring the functionality of <b>—i </b>In TShark.</p>
<p><b>&#9632;&nbsp;</b>—<b>L </b>Lists the data link types that are supported by an interface and then exits, mirroring the functionality of <b>—L </b>In TShark.</p>
<p><b>&#9632;&nbsp;</b>—<b>P </b>Tells dumpcap to not put the interface in promiscuous mode, mirroring the functionality of <b>—p </b>In TShark.</p>
<p><b>&#9632;&nbsp;—s <i>Snaplen </i></b>Allows you to set the default snapshot length to use when capturing data, mirroring the functionality of <b>—s </b>In TShark.</p>
<p><b>&#9632;&nbsp;—v </b>Prints the dumpcap version information and exits.</p>
<p><b>&#9632;&nbsp;—w <i>File </i></b>Writes the packets to the filename specified following the option, mirroring the functionality of <b>—w </b>In TShark.</p>
<p><b>&#9632;&nbsp;—y <i>Type </i></b>Allows you to set the data link type to use while capturing packets, mirroring the functionality of <b>—y </b>In TShark.</p>
<p>Run with no command-line arguments, dumpcap will select the first available network interface and start capturing traffic, saving the contents to a libpcap file with a randomly selected filename.</p>
<p>Dumpcap can be useful to leverage the flexibility of capture autostop conditions and ringbuffer output files, without the overhead associated with the Wireshark GUI or the memory and CPU requirements ofTShark. For example, dumpcap can collect traffic for five minutes before stopping, saving the contents to the named libpcap file, as shown here:</p>
<p>C:\&gt;dumpcap - i 2 - a duration:300 - w eventcollection. cap</p>
]]></content:encoded>
			<wfw:commentRss>http://biglib.net/dumpcap/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Capinfos</title>
		<link>http://biglib.net/capinfos/</link>
		<comments>http://biglib.net/capinfos/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 11:45:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Capinfos]]></category>

		<guid isPermaLink="false">http://biglib.net/capinfos/</guid>
		<description><![CDATA[Capinfos is a new command-line tool included with Wireshark that examines a stored capture file and reports statistics related to the number of packets, packet sizes, and timing information. Unlike other statistics reporting mechanisms in other Wireshark tools, capinfos does &#8230; <a href="http://biglib.net/capinfos/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Capinfos is a new command-line tool included with Wireshark that examines a stored capture file and reports statistics related to the number of packets, packet sizes, and timing information. Unlike other statistics reporting mechanisms in other Wireshark tools, capinfos does not report on the contents of traffic, instead giving a quick summary of the capture file contents.</p>
<p>The following command-line options are used to control capinfos' output.</p>
<p><b>&#9632;&nbsp;—h </b>Prints the help options of capinfos, and then exits.</p>
<p><b>&#9632;&nbsp;—t </b>Displays the capture file type as one of the supported Wireshark capture file formats, regardless of the filename extension.</p>
<p><b>&#9632;&nbsp;—c </b>Displays the number of packets in the capture file.</p>
<p><b>&#9632;&nbsp;—d </b>Displays the total length of all the packets in the file as a number of bytes.</p>
<p><b>&#9632;&nbsp;—u </b>Displays the capture file duration in seconds.</p>
<p><b>&#9632;&nbsp;—a </b>Displays the capture start time.</p>
<p><b>&#9632;&nbsp;—e </b>Displays the capture end time.</p>
<p><b>&#9632;&nbsp;—y </b>Displays the average data rate in bytes per second.</p>
<p><b>&#9632;&nbsp;—i </b>Displays the average data rate in bits per second.</p>
<p><b>&#9632;</b><b>&nbsp;—h </b>Displays the average packet size in bytes.</p>
<p>Capinfos can be run with only a filename as a command-line parameter, and will display all the available statistics, as shown here:</p>
<p>C:\&gt;capinfos all-ml. dump File name: all-ml. dump</p>
<p>File type: libpcap (tcpdump, Ethereal, etc.)</p>
<p>Number of packets: 282905</p>
<p>File size: 41418290 bytes</p>
<p>Data size: 56143385 bytes</p>
<p>Capture duration: 7579.713771 seconds</p>
<p>Start time: Mon Sep 15 09:44:53 2003</p>
<p>End time: Mon Sep 15 11:51:13 2003</p>
<p>Data rate: 7407.06 bytes/s</p>
<p>Data rate: 59256.47 bits/s</p>
<p>Average packet size: 198.45 bytes</p>
]]></content:encoded>
			<wfw:commentRss>http://biglib.net/capinfos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Text2pcap</title>
		<link>http://biglib.net/text2pcap/</link>
		<comments>http://biglib.net/text2pcap/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 04:27:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Text2pcap]]></category>

		<guid isPermaLink="false">http://biglib.net/text2pcap/</guid>
		<description><![CDATA[Text2pcap uses the octal dump (od) format of hexadecimal output. Octal dump is a UNIX command used to output a file or standard input to a specified form, such as octal, decimal, or hexadecimal format. The format is specified by &#8230; <a href="http://biglib.net/text2pcap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Text2pcap uses the octal dump (od) format of hexadecimal output. Octal dump is a UNIX command used to output a file or standard input to a specified form, such as octal, decimal, or hexadecimal format. The format is specified by the parameters given to the <b>—t </b>Option. The command <b>Od —t xl </b>Will generate output text2pcap can understand (the <b>Xl </b>Describes the format of hexadecimal).The following is an example of the type of hexadecimal dump text2pcap can read.</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>0000</p>
</td>
<td>
<p>00</p>
</td>
<td>
<p>05</p>
</td>
<td>
<p>5d</p>
</td>
<td>
<p>Ee</p>
</td>
<td>
<p>7e</p>
</td>
<td>
<p>53</p>
</td>
<td>
<p>08</p>
</td>
<td>
<p>00</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>Cf</p>
</td>
<td>
<p>5b</p>
</td>
<td>
<p>39</p>
</td>
<td>
<p>08</p>
</td>
<td>
<p>00</p>
</td>
<td>
<p>45</p>
</td>
<td>
<p>00</p>
</td>
<td>
<p>..].~S.. .[9..E.</p>
</td>
</tr>
<tr>
<td>
<p>0010</p>
</td>
<td>
<p>00</p>
</td>
<td>
<p>9a</p>
</td>
<td>
<p>13</p>
</td>
<td>
<p>9e</p>
</td>
<td>
<p>40</p>
</td>
<td>
<p>00</p>
</td>
<td>
<p>3c</p>
</td>
<td>
<p>06</p>
</td>
<td>
<p>E0</p>
</td>
<td>
<p>70</p>
</td>
<td>
<p>C0</p>
</td>
<td>
<p>A8</p>
</td>
<td>
<p>64</p>
</td>
<td>
<p>7a</p>
</td>
<td>
<p>C0</p>
</td>
<td>
<p>A8</p>
</td>
<td>
<p>....@.&lt;..p..dz..</p>
</td>
</tr>
<tr>
<td>
<p>0020</p>
</td>
<td>
<p>64</p>
</td>
<td>
<p>84</p>
</td>
<td>
<p>00</p>
</td>
<td>
<p>17</p>
</td>
<td>
<p>05</p>
</td>
<td>
<p>49</p>
</td>
<td>
<p>0e</p>
</td>
<td>
<p>A9</p>
</td>
<td>
<p>91</p>
</td>
<td>
<p>43</p>
</td>
<td>
<p>8e</p>
</td>
<td>
<p>D8</p>
</td>
<td>
<p>E3</p>
</td>
<td>
<p>6a</p>
</td>
<td>
<p>50</p>
</td>
<td>
<p>18</p>
</td>
<td>
<p>D....I...C...jP.</p>
</td>
</tr>
<tr>
<td>
<p>0030</p>
</td>
<td>
<p>C1</p>
</td>
<td>
<p>E8</p>
</td>
<td>
<p>Ba</p>
</td>
<td>
<p>7b</p>
</td>
<td>
<p>00</p>
</td>
<td>
<p>00</p>
</td>
<td>
<p>4c</p>
</td>
<td>
<p>61</p>
</td>
<td>
<p>73</p>
</td>
<td>
<p>74</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>6c</p>
</td>
<td>
<p>6f</p>
</td>
<td>
<p>67</p>
</td>
<td>
<p>69</p>
</td>
<td>
<p>6e</p>
</td>
<td>
<p>...{..Last login</p>
</td>
</tr>
<tr>
<td>
<p>0040</p>
</td>
<td>
<p>3a</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>53</p>
</td>
<td>
<p>75</p>
</td>
<td>
<p>6e</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>4e</p>
</td>
<td>
<p>6f</p>
</td>
<td>
<p>76</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>32</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>31</p>
</td>
<td>
<p>37</p>
</td>
<td>
<p>3a</p>
</td>
<td>
<p>: Sun Nov 2 17:</p>
</td>
</tr>
<tr>
<td>
<p>0050</p>
</td>
<td>
<p>30</p>
</td>
<td>
<p>36</p>
</td>
<td>
<p>3a</p>
</td>
<td>
<p>35</p>
</td>
<td>
<p>33</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>66</p>
</td>
<td>
<p>72</p>
</td>
<td>
<p>6f</p>
</td>
<td>
<p>6d</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>31</p>
</td>
<td>
<p>39</p>
</td>
<td>
<p>32</p>
</td>
<td>
<p>2e</p>
</td>
<td>
<p>31</p>
</td>
<td>
<p>06:53 from 192.1</p>
</td>
</tr>
<tr>
<td>
<p>0060</p>
</td>
<td>
<p>36</p>
</td>
<td>
<p>38</p>
</td>
<td>
<p>2e</p>
</td>
<td>
<p>31</p>
</td>
<td>
<p>30</p>
</td>
<td>
<p>30</p>
</td>
<td>
<p>2e</p>
</td>
<td>
<p>31</p>
</td>
<td>
<p>33</p>
</td>
<td>
<p>32</p>
</td>
<td>
<p>0d</p>
</td>
<td>
<p>0a</p>
</td>
<td>
<p>53</p>
</td>
<td>
<p>75</p>
</td>
<td>
<p>6e</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>68.100.132..Sun</p>
</td>
</tr>
<tr>
<td>
<p>0070</p>
</td>
<td>
<p>4d</p>
</td>
<td>
<p>69</p>
</td>
<td>
<p>63</p>
</td>
<td>
<p>72</p>
</td>
<td>
<p>6f</p>
</td>
<td>
<p>73</p>
</td>
<td>
<p>79</p>
</td>
<td>
<p>73</p>
</td>
<td>
<p>74</p>
</td>
<td>
<p>65</p>
</td>
<td>
<p>6d</p>
</td>
<td>
<p>73</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>49</p>
</td>
<td>
<p>6e</p>
</td>
<td>
<p>63</p>
</td>
<td>
<p>Microsystems Inc</p>
</td>
</tr>
<tr>
<td>
<p>0080</p>
</td>
<td>
<p>2e</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>53</p>
</td>
<td>
<p>75</p>
</td>
<td>
<p>6e</p>
</td>
<td>
<p>4f</p>
</td>
<td>
<p>53</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>35</p>
</td>
<td>
<p>2e</p>
</td>
<td>
<p>39</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>. SunOS 5.9</p>
</td>
</tr>
<tr>
<td>
<p>0090</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>47</p>
</td>
<td>
<p>65</p>
</td>
<td>
<p>6e</p>
</td>
<td>
<p>65</p>
</td>
<td>
<p>72</p>
</td>
<td>
<p>69</p>
</td>
<td>
<p>63</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>4d</p>
</td>
<td>
<p>61</p>
</td>
<td>
<p>79</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>Generic May</p>
</td>
</tr>
<tr>
<td>
<p>00a0</p>
</td>
<td>
<p>32</p>
</td>
<td>
<p>30</p>
</td>
<td>
<p>30</p>
</td>
<td>
<p>32</p>
</td>
<td>
<p>0d</p>
</td>
<td>
<p>0a</p>
</td>
<td>
<p>23</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>2002..#</p>
</td>
</tr>
</table>
<p>The beginning of each line has an offset of more than two hexadecimal, or octal, digits that is used to track the bytes in the output. If the offset is 0, this indicates the beginning of a new packet. If there are multiple packets in a file, they will be output to the packet capture file with one second between each packet. If a line doesn't have this offset, it is ignored. The text output at the end of the line is also ignored. Text files can also contain comments that begin with the # character. text2pcap has the capability to support commands and options by using the <b>#TEXT2PCAP </b>Command at the beginning of the line. text2pcap currently doesn't have any commands and options supported, but future development could incorporate methods to control the way the hexadecimal dump is processed.</p>
<p>The following command-line options are used to control text2pcap's data processing and output.</p>
<p><b>&#9632;&nbsp;—h </b>Prints the help options of text2pcap, and then exits.</p>
<p><b>&#9632;</b><b>&nbsp;—d </b>Displays debugging information during the processing. Like verbose options, it can be used several times for more information.</p>
<p><b>&#9632;&nbsp;—q </b>Causes text2pcap to be quiet while processing.</p>
<p><b>&#9632;&nbsp;—o h|o </b>Specifies either hexadecimal or octal formats for the offset of the output. The default is hexadecimal.</p>
<p><b>&#9632;&nbsp;—l <i>Typenum </i></b>Lets you specify the data link layer type of encapsulation for the packet. This option is used when your hexdump is a complete, encapsulated packet. The encapsulation type is specified as a number using the <i>Typenum </i>Parameter. A complete list of encapsulation types and their associated numbers can be found in the /libpcap-0.7.2/bpf/net/bpf. h file included in the libpcap source distribution. For example, Point-to-Point Protocol (PPP) is encapsulation type 9. The default is Ethernet, encapsulation type 1.</p>
<p><b>&#9632;&nbsp;—e l3pid </b>Allows you to include a dummy Ethernet header for each packet. You would use this option when your dump file has any type of Layer 3 header, such as IP, but no Layer 2 information.</p>
<p><b>&#9632;&nbsp;—i <i>Proto </i></b>Allows you to include a dummy IP header for each packet. The <i>Proto </i>Parameter allows you to specify the IP protocol in decimal format. You would use this option when your dump file has complete Layer 4 information, but no Layer 3 IP information. This option will also include the necessary Ethernet information. For example, <b>—i 88 </b>Will set the set the protocol to Enhanced Interior Gateway Routing Protocol (EIGRP).</p>
<p><b>&#9632;&nbsp;—m <i>Max-packet </i></b>Allows you to set the maximum packet length with the <i>Max-packet </i>Parameter. The default is 64000.</p>
<p><b>&#9632;&nbsp;—u <i>Srcport, destport </i></b>Allows you to include a dummy UDP header for each packet. The <i>Srcport </i>And <i>Destport </i>Parameters allow you to specify the source and destination UDP ports in decimal format. You would use this option when your dump file does not contain any UDP Layer 4 or below information. This option will also include the necessary IP and Ethernet information.</p>
<p><b>&#9632;&nbsp;—T <i>Srcport, destport </i></b>Allows you to include a dummy TCP header for each packet. The <i>Srcport </i>And <i>Destport </i>Parameters allow you to specify the source and destination TCP ports in decimal format. You would use this option when your dump file does not contain any TCP Layer 4 or below information. This option will also include the necessary IP and Ethernet information.</p>
<p><b>&#9632;&nbsp;—s <i>Srcport, destport, tag </i></b>Allows you to include a dummy Stream Control Transmission Protocol (SCTP) header for each packet. The <i>Srcport </i>And <i>Dest-port </i>Parameters allow you to specify the source and destination SCTP ports in decimal format. The <i>Tag </i>Parameter allows you to specify a verification tag. You would use this option when your dump file does not contain any SCTP Layer 4 or below information. This option will also include the necessary IP, Ethernet, and CRC32C checksum information.</p>
<p><b>&#9632;&nbsp;—S <i>Srcport, destport, ppi </i></b>Allows you to include a dummy SCTP header for each packet. The <i>Srcport </i>And <i>Destport </i>Parameters allow you to specify the source and destination SCTP ports in decimal format. The <i>Ppi </i>Parameter allows you to specify a payload protocol identifier for a dummy SCTP DATA chunk header. The verification tag will automatically be set to 0.You would use this option when your dump file does not contain any SCTP Layer 4 or below information. This option will also include the necessary IP, Ethernet, and CRC32C checksum information.</p>
<p><b>&#9632;</b><b>&nbsp;—t <i>Timefmt </i></b>Allows you to specify a time format for the text before the packet. The <i>Timefmt </i>Parameter follows the format of strptime(3), such as &quot;%H:%M:%S.&quot;, which converts a character string to a time value.</p>
<p>The following is an example of using text2pcap to read a hexadecimal dump, <i>Hex_sample. txt, </i>And output it to the <i>Libpcap_output </i>File.</p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;text2pcap hex_sample. txt libpcap_output</p>
<p>Input from: hex_sample. txt</p>
<p>Output to: libpcap_output</p>
<p>Wrote packet of 168 bytes at 0</p>
<p>Read 1 potential packets, wrote 1 packets</p>
<p>The next example uses text2pcap to read a file with multiple hexadecimal packets, <i>Hex_sample2.txt, </i>And output the format as Telnet/TCP packets to the <i>Libpcap_output2 </i>File.</p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;text2pcap - T 1297,23 hex_sample2.txt libpcap_output2</p>
<p>Input from: hex_sample2.txt</p>
<p>Output to: libpcap_output2</p>
<p>Generate dummy Ethernet header: Protocol: 0x800 Generate dummy IP header: Protocol: 6</p>
<p>Generate dummy TCP header: Source port: 1297. Dest port: 23</p>
<p>Wrote packet of 62 bytes at 0</p>
<p>Wrote packet of 62 bytes at 62</p>
<p>Wrote packet of 60 bytes at 124</p>
<p>Wrote packet of 69 bytes at 184</p>
<p><i>Output removed</i></p>
<p>Read 76 potential packets, wrote 76 packets</p>
<p>The od command can also be piped into the text2pcap program. text2pcap will then read the output of the od command as standard input. The next example uses</p>
<p>Text2pcap to read a data stream as input, and output the format as HTTP/TCP packets to the output. pcap file. The <b>—Ax </b>Parameter to the od command prints the offsets as hexadecimal. The <b>—m1460 </b>Parameter to text2pcap specifies a maximum packet size of 1460 bytes. The maximum Ethernet packet size is 1500 bytes, minus the 20 bytes for the IP and TCP headers, leaves 1460 bytes for the data. By default, the <b>—T </b>Parameter will create TCP, IP, and Ethernet dummy headers. The following shows the command and associated output.</p>
<p>[root@localhost root]# od - Ax - tx1 input | text2pcap -m1460 - T1234,80 - output. pcap</p>
<p>Input from: Standard input Output to: output. pcap</p>
<p>Generate dummy Ethernet header: Protocol: 0x800 Generate dummy IP header: Protocol: 6</p>
<p>Generate dummy TCP header: Source port: 1234. Dest port: 80</p>
<p>Wrote packet of 1460 bytes at 0</p>
<p>Wrote packet of 1460 bytes at 1460</p>
<p>Wrote packet of 1460 bytes at 2920</p>
<p>Wrote packet of 788 bytes at 4380</p>
<p>Read 4 potential packets, wrote 4 packets</p>
]]></content:encoded>
			<wfw:commentRss>http://biglib.net/text2pcap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Editcap</title>
		<link>http://biglib.net/editcap/</link>
		<comments>http://biglib.net/editcap/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 03:07:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Editcap]]></category>

		<guid isPermaLink="false">http://biglib.net/editcap/</guid>
		<description><![CDATA[Editcap is a program used to remove or select packets from a file and to translate the format of captured files. It doesn't capture live traffic; it only reads data from a saved capture file and then saves some or &#8230; <a href="http://biglib.net/editcap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Editcap is a program used to remove or select packets from a file and to translate the format of captured files. It doesn't capture live traffic; it only reads data from a saved capture file and then saves some or all of the packets to a new capture file. editcap can read all of the same types of files Wireshark can, and by default writes to libpcap format. editcap can also write captures to standard and modified versions of libpcap, Sun snoop, Novell LANalyzer, Networks Associate's Sniffer, Microsoft Network Monitor, Visual Network traffic capture, Accellent 5Views capture, and Network Instruments Observer version 9 captures. editcap can determine the file type it is reading, and is capable of reading files that are compressed with gzip.</p>
<p>By default, editcap writes all of the packets in the capture file to the output file. If you specify a list of packet numbers on the command line, those packets will <i>Not </i>Be written to the output capture file. If the <b>—r </b>Option is specified, it will reverse the default configuration and write only the specified packets to the output capture file. You can also specify a range of packets to include or exclude in the output capture file.</p>
<p>The following information is the usage output for the editcap program.</p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;editcap</p>
<p>Usage: editcap [-r] [-h] [-v] [-T &lt;encap type&gt;] [-E &lt;probability&gt;]</p>
<p>[-F &lt;capture type&gt;] [-s &lt;snaplen&gt;] [-t &lt;time adjustment&gt;] [-c &lt;packets per file&gt;]</p>
<p>&lt;infile&gt; &lt;outfile&gt; [ &lt;record#&gt;[-&lt;record#&gt;] ... ]</p>
<p>Where</p>
<p>-c &lt;packets per file&gt; If given splits the output to different files</p>
<p>-E &lt;probability&gt; specifies the probability (between 0 and 1) that a particular byte will have an error. - F &lt;capture type&gt; specifies the capture file type to write: libpcap - libpcap (tcpdump, Ethereal, etc.) rh6_1libpcap - RedHat Linux 6.1 libpcap (tcpdump) suse6_3libpcap - SuSE Linux 6.3 libpcap (tcpdump) modlibpcap - modified libpcap (tcpdump) nokialibpcap - Nokia libpcap (tcpdump) nseclibpcap - Nanosecond libpcap (Ethereal) lanalyzer - Novell LANalyzer</p>
<p>Ngsniffer - Network Associates Sniffer (DOS-based) snoop - Sun snoop</p>
<p>Netmon1 - Microsoft Network Monitor 1.x netmon2 - Microsoft Network Monitor 2.x</p>
<p>Ngwsniffer_1_1 - Network Associates Sniffer (Windows-based) 1.1</p>
<p>Ngwsniffer_2_0 - Network Associates Sniffer (Windows-based) 2.00x</p>
<p>Nettl - HP-UX nettl trace</p>
<p>Visual - Visual Networks traffic capture</p>
<p>5views - Accellent 5Views capture</p>
<p>Niobserverv9 - Network Instruments Observer version 9 rf5 - Tektronix K12xx 32-bit. rf5 format default is libpcap - h produces this help listing.</p>
<p>-r specifies that the records specified should be kept, not deleted,</p>
<p>Default is to delete -s &lt;snaplen&gt; specifies that packets should be truncated to</p>
<p>&lt;snaplen&gt; bytes of data - t &lt;time adjustment&gt; specifies the time adjustment</p>
<p>To be applied to selected packets - T &lt;encap type&gt; specifies the encapsulation type to use: ether - Ethernet tr - Token Ring slip - SLIP ppp - PPP fddi - FDDI</p>
<p>Fddi-swapped - FDDI with bit-swapped MAC addresses rawip - Raw IP arcnet - ARCNET</p>
<p>Arcnet_linux - Linux ARCNET atm-rfc1483 - RFC 1483 ATM linux-atm-clip - Linux ATM CLIP lapb - LAPB atm-pdus - ATM PDUs</p>
<p>Atm-pdus-untruncated - ATM PDUs - untruncated null - NULL</p>
<p>Ascend - Lucent/Ascend access equipment isdn - ISDN</p>
<p>Ip-over-fc - RFC 2625 IP-over-Fibre Channel ppp-with-direction - PPP with Directional Info ieee-802-11 - IEEE 802.11 Wireless LAN</p>
<p>Prism - IEEE 802.11 plus Prism II monitor mode header ieee-8 02-11-radio - IEEE 802.11 Wireless LAN with radio</p>
<p>Information</p>
<p>Ieee-8 02-11-radiotap - IEEE 802.11 plus radiotap WLAN header ieee-8 02-11-avs - IEEE 802.11 plus AVS WLAN header linux-sll - Linux cooked-mode capture frelay - Frame Relay</p>
<p>Frelay-with-direction - Frame Relay with Directional Info</p>
<p>Chdlc - Cisco HDLC</p>
<p>Ios - Cisco IOS internal</p>
<p>Ltalk - Localtalk</p>
<p>Pflog-old - OpenBSD PF Firewall logs, pre-3.4 hhdlc - HiPath HDLC</p>
<p>Docsis - Data Over Cable Service Interface Specification cosine - CoSine L2 debug log whdlc - Wellfleet HDLC sdlc - SDLC</p>
<p>Tzsp - Tazmen sniffer protocol</p>
<p>Enc - OpenBSD enc(4) encapsulating interface</p>
<p>Pflog - OpenBSD PF Firewall logs</p>
<p>Chdlc-with-direction - Cisco HDLC with Directional Info</p>
<p>Bluetooth-h4 - Bluetooth H4</p>
<p>Mtp2 - SS7 MTP2</p>
<p>Mtp3 - SS7 MTP3</p>
<p>Irda - IrDA</p>
<p>User0 - USER 0</p>
<p>User1 - USER 1 user2 - USER 2 user3 - USER 3 user4 - USER 4 user5 - USER 5 user6 - USER 6 user7 - USER 7 user8 - USER 8 user9 - USER 9 user10 - USER 10 user11 - USER 11 user12 - USER 12 user13 - USER 13 user14 - USER 14 user15 - USER 15</p>
<p>Symantec - Symantec Enterprise Firewall ap1394 - Apple IP-over-IEEE 1394 bacnet-ms-tp - BACnet MS/TP</p>
<p>Raw-icmp-nettl - Raw ICMP with nettl headers raw-icmpv6-nettl - Raw ICMPv6 with nettl headers gprs-llc - GPRS LLC juniper-atm1 - Juniper ATM1 juniper-atm2 - Juniper ATM2 redback - Redback SmartEdge rawip-nettl - Raw IP with nettl headers ether-nettl - Ethernet with nettl headers tr-nettl - Token Ring with nettl headers fddi-nettl - FDDI with nettl headers</p>
<p>Unknown-nettl - Unknown link-layer type with nettl headers</p>
<p>Mtp2-with-phdr - MTP2 with pseudoheader</p>
<p>Juniper-pppoe - Juniper PPPoE</p>
<p>Gcom-tie1 - GCOM TIE1</p>
<p>Gcom-serial - GCOM Serial</p>
<p>X25-nettl - X25 with nettl headers</p>
<p>Juniper-mlppp - Juniper MLPPP</p>
<p>Juniper-mlfr - Juniper MLFR</p>
<p>Juniper-ether - Juniper Ethernet</p>
<p>Juniper-ppp - Juniper PPP</p>
<p>Juniper-frelay - Juniper Frame-Relay juniper-chdlc - Juniper C-HDLC default is the same as the input file - v specifies verbose operation, default is silent</p>
<p>A range of records can be specified as well</p>
<p>The following command-line options are used to control editcap's data translation and output.</p>
<p><b>&#9632;&nbsp;—F <i>Type </i></b>Used to set the format of the output capture file. For example, if you want to save a file in the Sun snoop format so snoop can read the capture file, you would use the <b>—F snoop </b>Option.</p>
<p><b>&#9632;&nbsp;—h </b>Prints the help options of editcap, and then exits.</p>
<p><b>&#9632;&nbsp;—r </b>Causes the packets whose numbers are specified on the command line to be written to the output capture file. This is opposite of the default action, which is to remove the packets that are specified on the command line. Packets can only be specified as a consecutive range in the <i>Start-end </i>Format, or individually; they cannot be comma delimited.</p>
<p><b>&#9632;&nbsp;—s <i>Snaplen </i></b>Sets the snapshot length to use when writing the data to the output capture file. Packets that are larger than the <i>Snaplen </i>Will be truncated. This option is helpful if you only want to save the packet headers, or if the program you will be importing the capture file into can only read packets of a certain size.</p>
<p><b>&#9632;&nbsp;—t <i>[-]seconds[.fractional seconds] </i></b>Allows you to specify a time adjustment to apply to selected frames in the output capture file. The time adjustment is specified in seconds and fractions of seconds. An option of <b>—t 3600 </b>Will advance the timestamp on the selected frames by one hour, while the option of <b>—t —3600 </b>Will reduce the timestamp on the selected frames by one hour. This option is useful when you need to synchronize packet traces with other logs from different devices.</p>
<p><b>&#9632;&nbsp;—T <i>Type </i></b>Sets the packet encapsulation type of the output capture file. The default type is the same encapsulation type as the input file. This option forces the encapsulation type of the output capture file to be a specified type; however, the packet headers will remain the same encapsulation type as the input capture file. This is because the encapsulation type is stored as meta-data, outside of the packet data. The encapsulation type is a single</p>
<p>Variable that is changed, thus allowing the packet data and headers of the original packet to remain unchanged.</p>
<p><b>&#9632; —v </b>Causes editcap to print various messages to the screen while it is processing files.</p>
<p>The following is an example of using editcap to translate the first five packets, and packets 10, 15, and 17 from a TShark libpcap capture file called <i>Capture </i>To a Sun snoop output file called <i>Capture_snoop.</i></p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;editcap - r - v -F snoop capture capture_snoop 1-5 10 15 17</p>
<p>File capture is a libpcap (tcpdump, Wireshark, etc.) capture file.</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>Add_Selected:</p>
</td>
<td>
<p>1-5</p>
</td>
</tr>
<tr>
<td>
<p>Inclusive...</p>
</td>
<td>
<p>1,</p>
</td>
<td>
<p>5</p>
</td>
</tr>
<tr>
<td>
<p>Add_Selected:</p>
</td>
<td>
<p>10</p>
</td>
</tr>
<tr>
<td>
<p>Not inclusive</p>
</td>
<td>
<p>...</p>
</td>
<td>
<p>10</p>
</td>
</tr>
<tr>
<td>
<p>Add_Selected:</p>
</td>
<td>
<p>15</p>
</td>
</tr>
<tr>
<td>
<p>Not inclusive</p>
</td>
<td>
<p>...</p>
</td>
<td>
<p>15</p>
</td>
</tr>
<tr>
<td>
<p>Add_Selected:</p>
</td>
<td>
<p>17</p>
</td>
</tr>
<tr>
<td>
<p>Not inclusive</p>
</td>
<td>
<p>...</p>
</td>
<td>
<p>17</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>1</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>2</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>3</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>4</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>5</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>10</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>15</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>17</p>
</td>
</tr>
</table>
<p>The next example uses editcap to copy all packets, except packets 5 through 120, from a libpcap capture file called <i>Capture </i>To a libpcap output file called <i>Capture_out.</i></p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;editcap - v capture capture_out 5-120</p>
<p>File capture is a libpcap (tcpdump, Wireshark, etc.) capture file.</p>
<p>Add_Selected: 5-120</p>
<p>Inclusive... 5, 120</p>
<p>Record: 1</p>
<p>Record: 2</p>
<p>Record: 3</p>
<p>Record: 4 Record: 121 Record: 122</p>
<p>The next example uses editcap to adjust the timestamp forward by five and a half seconds on all packets. It uses an NAI Sniffer capture file called <i>Capture. dump </i>As input and saves the output to a Novell LANalyzer file called <i>Capture_out.</i></p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;editcap - v - F lanalyzer - t 5.5 capture. dump capture_out</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>File capture is a libpcap (tcpdump, Wireshark, etc.) capture file.</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>1</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>2</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>3</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>4</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>5</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>6</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>7</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>8</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>9</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>10</p>
</td>
</tr>
<tr>
<td>
<p><i>Output</i></p>
</td>
<td>
<p><i>Removed</i></p>
</td>
</tr>
</table>
<p>The next example uses editcap to save the first 35 bytes of the input capture file called <i>Capture </i>To the output capture file called <i>Capture_out. This </i>Will include the full Ethernet and IP headers in the output file.</p>
<p>C:\Program Files\Wireshark&gt;editcap - v - s 35 capture capture_out File capture is a libpcap (tcpdump, Wireshark, etc.) capture file.</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>1</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>2</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>3</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>4</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>5</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>6</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>7</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>8</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>9</p>
</td>
</tr>
<tr>
<td>
<p>Record:</p>
</td>
<td>
<p>10</p>
</td>
</tr>
<tr>
<td>
<p><i>Output</i></p>
</td>
<td>
<p><i>Removed</i></p>
</td>
</tr>
</table>
<p>The next example uses editcap to translate the input capture file called <i>Capture </i>To the output capture file called <i>Capture_out </i>With an encapsulation type of IEEE 802.11 Wireless LAN.</p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;editcap - v - T ieee-802-11 capture capture_out</p>
<p>File capture is a libpcap (tcpdump, Wireshark, etc.) capture file.</p>
<p>Record: 1</p>
<p>Record: 2</p>
<p>Record: 3</p>
<p>Record: 4</p>
<p>Record: 5</p>
<p>Record: 6</p>
<p>Record: 7</p>
<p>Record: 8</p>
<p>Record: 9</p>
<p>Record: 10</p>
<p><i>Output removed</i></p>
]]></content:encoded>
			<wfw:commentRss>http://biglib.net/editcap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TShark Statistics</title>
		<link>http://biglib.net/tshark-statistics/</link>
		<comments>http://biglib.net/tshark-statistics/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 21:56:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[TShark]]></category>

		<guid isPermaLink="false">http://biglib.net/tshark-statistics/</guid>
		<description><![CDATA[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 &#8230; <a href="http://biglib.net/tshark-statistics/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>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.</p>
<p>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 <b>Z </b>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:</p>
<p>-z <i>Major name, minor name, option(s), filter</i></p>
<p>In this example where <b>-z </b>Is the command-line option to TShark, instructing it to expect a statistics reporting option, and <i>Major </i>And <i>Minor name </i>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.</p>
<p>Chapter <b>9 • Other Programs Packaged with Wireshark</b></p>
<p><b><i>A</i></b></p>
<p><b>Tip_</b></p>
<p>By default, TShark will print a one-line summary for each packet received. When examining statistical information by using the <b>-z </b>Option, you may want to suppress this information and show only the statistics reporting by adding the <b>-q </b>Option as well.</p>
<p>Protocol Hierarchy Statistics</p>
<p><b>Syntax: </b>-z io, phs[,<i>Filter]</i></p>
<p><b>Description: </b>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.</p>
<p><b>Example: </b>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 <b>Ctrl + C.</b></p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;tshark - nqz io, phs <b>&lt;cntrl-c&gt;</b></p>
<p>===================================================================</p>
<p>Protocol Hierarchy Statistics Filter: frame</p>
<p>Frame eth ip</p>
<p>Udp dns data isakmp</p>
<p>Tcp http</p>
<p>Llc ipx</p>
<p>Ipxsap</p>
<p>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</p>
<p>===================================================================</p>
<p>Protocol Statistics by Interval</p>
<p><b>Syntax: </b>-z <i>Io, stat, interval[,filter][,filter][,filter]... </i><b>Description: </b>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.</p>
<p>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:</p>
<p>Where &lt;field&gt; is the name of a display field you wish to apply the calculations on, and &lt;filter&gt; 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. <b>Example: </b>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.</p>
<p>C:\&gt;tshark - r Kismet-Sep-06-2 005.dump - z io, stat,300,&quot;frame&quot;,&quot;ip. addr eq 10.18.12 9.130&quot; - q</p>
<p>IO Statistics interval: 300.000 secs Column #0: frame</p>
<p>Column #1: ip. addr eq 10.18.129.130</p>
<p>[COUNTJSUMJMINJMAX|AVG](&lt;fleld&gt;)&lt;fllter&gt;</p>
<p>Column #0</p>
<p>Column #1</p>
<p>Time</p>
<p>|frames| bytes |frames| bytes</p>
<p>000.000-300.000</p>
<p>82</p>
<p>5874</p>
<p>0</p>
<p>0</p>
<p>300.000-600.000</p>
<p>248</p>
<p>18104</p>
<p>8</p>
<p>928</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>600.000-900.000</p>
</td>
<td>
<p>1171</p>
</td>
<td>
<p>86793</p>
</td>
<td>
<p>9</p>
</td>
<td>
<p>1044</p>
</td>
</tr>
<tr>
<td>
<p>900.000-1200.000</p>
</td>
<td>
<p>1247</p>
</td>
<td>
<p>93774</p>
</td>
<td>
<p>10</p>
</td>
<td>
<p>1160</p>
</td>
</tr>
<tr>
<td>
<p>1200.000-1500.000</p>
</td>
<td>
<p>1377</p>
</td>
<td>
<p>102314</p>
</td>
<td>
<p>6</p>
</td>
<td>
<p>696</p>
</td>
</tr>
<tr>
<td>
<p>1500.000-1800.000</p>
</td>
<td>
<p>2128</p>
</td>
<td>
<p>819636</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>464</p>
</td>
</tr>
<tr>
<td>
<p>1800.000-2100.000</p>
</td>
<td>
<p>1357</p>
</td>
<td>
<p>102840</p>
</td>
<td>
<p>8</p>
</td>
<td>
<p>928</p>
</td>
</tr>
<tr>
<td>
<p>2100.000-2400.000</p>
</td>
<td>
<p>1587</p>
</td>
<td>
<p>116295</p>
</td>
<td>
<p>10</p>
</td>
<td>
<p>1160</p>
</td>
</tr>
<tr>
<td>
<p>2400.000-2700.000</p>
</td>
<td>
<p>1565</p>
</td>
<td>
<p>179061</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>232</p>
</td>
</tr>
<tr>
<td>
<p>2700.000-3000.000</p>
</td>
<td>
<p>1450</p>
</td>
<td>
<p>98959</p>
</td>
<td>
<p>7</p>
</td>
<td>
<p>812</p>
</td>
</tr>
<tr>
<td>
<p>3000.000-3300.000</p>
</td>
<td>
<p>1436</p>
</td>
<td>
<p>101291</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>464</p>
</td>
</tr>
<tr>
<td>
<p>3300.000-3600.000</p>
</td>
<td>
<p>1826</p>
</td>
<td>
<p>218948</p>
</td>
<td>
<p>7</p>
</td>
<td>
<p>812</p>
</td>
</tr>
<tr>
<td>
<p>3600.000-3900.000</p>
</td>
<td>
<p>517</p>
</td>
<td>
<p>48140</p>
</td>
<td>
<p>0</p>
</td>
<td>
<p>0</p>
</td>
</tr>
</table>
<p><b>Tip_</b></p>
<p>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.</p>
<p>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.</p>
<p>C:\&gt;tshark - r wireless-rwc-1.cap - qz</p>
<p>Io, stat,300,AVG(frame. pkt_len)frame. pkt_len, MIN(frame. pkt_len )frame. pkt_len, MAX(frame. pkt_len)frame. pkt_len</p>
<p>IO Statistics Interval: 300.000 secs</p>
<p>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</p>
<p>| Column #0&nbsp;| Column #1&nbsp;| Column #2</p>
<p>Time&nbsp;|&nbsp;AVG |&nbsp;MIN | MAX</p>
<p>000.000-300.000&nbsp;71&nbsp;58 82</p>
<p>300.000-600.000&nbsp;73&nbsp;58 116</p>
<p>600.000-900.000&nbsp;74&nbsp;54 608</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>900.000-1200.000</p>
</td>
<td>
<p>75</p>
</td>
<td>
<p>58</p>
</td>
<td>
<p>388</p>
</td>
</tr>
<tr>
<td>
<p>1200.000-1500.000</p>
</td>
<td>
<p>74</p>
</td>
<td>
<p>58</p>
</td>
<td>
<p>132</p>
</td>
</tr>
<tr>
<td>
<p>1500.000-1800.000</p>
</td>
<td>
<p>385</p>
</td>
<td>
<p>58</p>
</td>
<td>
<p>1532</p>
</td>
</tr>
<tr>
<td>
<p>1800.000-2100.000</p>
</td>
<td>
<p>75</p>
</td>
<td>
<p>58</p>
</td>
<td>
<p>1432</p>
</td>
</tr>
<tr>
<td>
<p>2100.000-2400.000</p>
</td>
<td>
<p>73</p>
</td>
<td>
<p>58</p>
</td>
<td>
<p>388</p>
</td>
</tr>
<tr>
<td>
<p>2400.000-2700.000</p>
</td>
<td>
<p>114</p>
</td>
<td>
<p>58</p>
</td>
<td>
<p>1532</p>
</td>
</tr>
<tr>
<td>
<p>2700.000-3000.000</p>
</td>
<td>
<p>68</p>
</td>
<td>
<p>58</p>
</td>
<td>
<p>116</p>
</td>
</tr>
<tr>
<td>
<p>3000.000-3300.000</p>
</td>
<td>
<p>70</p>
</td>
<td>
<p>58</p>
</td>
<td>
<p>360</p>
</td>
</tr>
<tr>
<td>
<p>3300.000-3600.000</p>
</td>
<td>
<p>119</p>
</td>
<td>
<p>52</p>
</td>
<td>
<p>1532</p>
</td>
</tr>
<tr>
<td>
<p>3600.000-3900.000</p>
</td>
<td>
<p>93</p>
</td>
<td>
<p>58</p>
</td>
<td>
<p>336</p>
</td>
</tr>
</table>
<p>Conversation Statistics</p>
<p><b>Syntax: </b>-z conv, <i>Type </i>[<i>, filter]</i></p>
<p><b>Description: </b>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:</p>
<p>&#9632;&nbsp;eth Ethernet</p>
<p>&#9632;&nbsp;fc Fiber channel</p>
<p>&#9632;&nbsp;fddi FDDI</p>
<p>&#9632;&nbsp;ip IP addresses</p>
<p>&#9632;&nbsp;ipx IPX addresses</p>
<p>&#9632;&nbsp;tcp TCP/IP socket pairs</p>
<p>&#9632;&nbsp;tr Token ring</p>
<p>&#9632;&nbsp;udp UDP/IP socket pairs</p>
<p>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.</p>
<p><b>Example: </b>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).</p>
<p>$ tshark - r defcon. dump - nqz conv, ip,&quot;ip. addr eq 216.250.64.68&quot;</p>
<p>IPv4 Conversations Filter:ip. addr eq 216.250.64.68</p>
<p>|&nbsp;&lt;-&nbsp;| |&nbsp;-&gt;&nbsp;| |&nbsp;Total |</p>
<p>|Frames Bytes| |Frames Bytes| |Frames Bytes|</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.215</p>
</td>
<td>
<p>85</p>
</td>
<td>
<p>8887</p>
</td>
<td>
<p>98</p>
</td>
<td>
<p>19007</p>
</td>
<td>
<p>183</p>
</td>
<td>
<p>27894</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.237</p>
</td>
<td>
<p>69</p>
</td>
<td>
<p>7076</p>
</td>
<td>
<p>42</p>
</td>
<td>
<p>8555</p>
</td>
<td>
<p>111</p>
</td>
<td>
<p>15631</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.23</p>
</td>
<td>
<p>60</p>
</td>
<td>
<p>6064</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>795</p>
</td>
<td>
<p>64</p>
</td>
<td>
<p>6859</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.212</p>
</td>
<td>
<p>51</p>
</td>
<td>
<p>4687</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>453</p>
</td>
<td>
<p>53</p>
</td>
<td>
<p>5140</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.0.173</p>
</td>
<td>
<p>35</p>
</td>
<td>
<p>3859</p>
</td>
<td>
<p>16</p>
</td>
<td>
<p>3099</p>
</td>
<td>
<p>51</p>
</td>
<td>
<p>6958</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.14 9</p>
</td>
<td>
<p>19</p>
</td>
<td>
<p>1791</p>
</td>
<td>
<p>26</p>
</td>
<td>
<p>4493</p>
</td>
<td>
<p>45</p>
</td>
<td>
<p>6284</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.102</p>
</td>
<td>
<p>18</p>
</td>
<td>
<p>2933</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>3852</p>
</td>
<td>
<p>38</p>
</td>
<td>
<p>6785</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.1.12 0</p>
</td>
<td>
<p>29</p>
</td>
<td>
<p>2657</p>
</td>
<td>
<p>9</p>
</td>
<td>
<p>1257</p>
</td>
<td>
<p>38</p>
</td>
<td>
<p>3914</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.72</p>
</td>
<td>
<p>9</p>
</td>
<td>
<p>864</p>
</td>
<td>
<p>22</p>
</td>
<td>
<p>5472</p>
</td>
<td>
<p>31</p>
</td>
<td>
<p>6336</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.0.153</p>
</td>
<td>
<p>20</p>
</td>
<td>
<p>1871</p>
</td>
<td>
<p>9</p>
</td>
<td>
<p>3658</p>
</td>
<td>
<p>29</p>
</td>
<td>
<p>5529</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.41.150</p>
</td>
<td>
<p>25</p>
</td>
<td>
<p>2348</p>
</td>
<td>
<p>3</p>
</td>
<td>
<p>348</p>
</td>
<td>
<p>28</p>
</td>
<td>
<p>2696</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.248</p>
</td>
<td>
<p>12</p>
</td>
<td>
<p>2370</p>
</td>
<td>
<p>15</p>
</td>
<td>
<p>3459</p>
</td>
<td>
<p>27</p>
</td>
<td>
<p>5829</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.192</p>
</td>
<td>
<p>14</p>
</td>
<td>
<p>1454</p>
</td>
<td>
<p>13</p>
</td>
<td>
<p>2460</p>
</td>
<td>
<p>27</p>
</td>
<td>
<p>3914</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.185</p>
</td>
<td>
<p>10</p>
</td>
<td>
<p>1087</p>
</td>
<td>
<p>17</p>
</td>
<td>
<p>5907</p>
</td>
<td>
<p>27</p>
</td>
<td>
<p>6994</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.103</p>
</td>
<td>
<p>16</p>
</td>
<td>
<p>1690</p>
</td>
<td>
<p>10</p>
</td>
<td>
<p>1759</p>
</td>
<td>
<p>26</p>
</td>
<td>
<p>3449</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.3.2</p>
</td>
<td>
<p>19</p>
</td>
<td>
<p>1735</p>
</td>
<td>
<p>6</p>
</td>
<td>
<p>1973</p>
</td>
<td>
<p>25</p>
</td>
<td>
<p>3708</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.7</p>
</td>
<td>
<p>13</p>
</td>
<td>
<p>1208</p>
</td>
<td>
<p>11</p>
</td>
<td>
<p>4155</p>
</td>
<td>
<p>24</p>
</td>
<td>
<p>5363</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.0.12 7</p>
</td>
<td>
<p>11</p>
</td>
<td>
<p>1123</p>
</td>
<td>
<p>12</p>
</td>
<td>
<p>2094</p>
</td>
<td>
<p>23</p>
</td>
<td>
<p>3217</p>
</td>
</tr>
<tr>
<td>
<p>216.250.64.68</p>
</td>
<td>
<p>&lt;-&gt;</p>
</td>
<td>
<p>192.168.2.121</p>
</td>
<td>
<p>18</p>
</td>
<td>
<p>1752</p>
</td>
<td>
<p>5</p>
</td>
<td>
<p>1150</p>
</td>
<td>
<p>23</p>
</td>
<td>
<p>2902</p>
</td>
</tr>
</table>
<p>Packet Length Distribution</p>
<p><b>Syntax: </b>-z plen, tree[,<i>Filter]</i></p>
<p><b>Description: </b>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. <b>Example: </b>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.</p>
<p>C:\&gt;tshark - r dc11.dump - nqz plen, tree</p>
<p>===================================================================</p>
<p>Packet Length</p>
<p>Packet Length 0-19 20-39 40-79 80-159 160-319 320-639 640-1279 1280-2559 2560-5119 5120-</p>
<p>Value</p>
<p>Rate</p>
<p>664070</p>
<p>0 0</p>
<p>494456 114463 16117 13583 3597 21854 0 0</p>
<p>0.001293 0.000000 0.000000 0.000962 0.000223 0.000031 0.000026 0.000007 0.000043 0.000000 0.000000</p>
<p>Percent</p>
<p>0.00% 0.00% 74.46% 17.24% 2.43% 2.05% 0.54% 3.29% 0.00% 0.00%</p>
<p>Destinations Tree</p>
<p><b>Syntax: </b>-z dests, tree,<i>Filter</i></p>
<p><b>Description: </b>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.</p>
<p><b>Example: </b>The following example reads from the <a href="http://http.cap">Http. cap</a> capture file and identifies the destination addresses, transport protocol, and the percentage of network activity by destination address.</p>
<p>C:\&gt;tshark - r <a href="http://http.cap">Http. cap</a> - nqz dests, tree</p>
<p>===================================================================</p>
<p>Destinations</p>
<p>Value</p>
<p>Rate</p>
<p>Destinations 145.254.160.237 TCP 80 UDP</p>
<p>43 20 19 19 1</p>
<p>0.001415 0.000658 0.000625</p>
<p>0.000625 0.000033</p>
<p>Percent</p>
<p>46.51%</p>
<p>95.00% 100.00%</p>
<p>5.00%</p>
<p>53&nbsp;1 0.000033&nbsp;100.00%</p>
<p>65.208.228.223&nbsp;18 0.000592&nbsp;41.86%</p>
<p>TCP&nbsp;18 0.000592&nbsp;100.00%</p>
<p>3372&nbsp;18 0.000592&nbsp;100.00%</p>
<p>145.253.2.203&nbsp;1 0.000033&nbsp;2.33%</p>
<p>UDP&nbsp;1 0.000033&nbsp;100.00%</p>
<p>3009&nbsp;1 0.000033&nbsp;100.00%</p>
<p>216.239.59.99&nbsp;4 0.000132&nbsp;9.30%</p>
<p>TCP&nbsp;4 0.000132&nbsp;100.00%</p>
<p>3371&nbsp;4 0.000132&nbsp;100.00%</p>
<p>Packet Summary Columns</p>
<p><b>Syntax: </b>-z proto, colinfo,<i>Filter, field</i></p>
<p><b>Description: </b>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.</p>
<p><b>Example: </b>The following example reads from the <a href="http://http.cap">Http. cap</a> capture file and reports the standard summary output.</p>
<p>C:\&gt;tshark - r <a href="http://http.cap">Http. cap</a> - n</p>
<p>1&nbsp;0.000000&nbsp;145.254.160.237 -&gt; 65.208.228.223&nbsp;3372 &gt; 80 [SYN] Seq=0 Len=0 MSS=1460</p>
<p>2&nbsp;0.911310&nbsp;6 5.208.228.223 -&gt; 145.254.160.237&nbsp;80 &gt; 3372 [SYN, ACK] Seq=0 Ack=1 Win=5840&nbsp;Len=0 MSS=1380</p>
<p>3&nbsp;0.911310 145.254.160.237 -&gt; 65.208.228.223 3372 &gt; 80 [ACK] Seq=1 Ack=1 Win=9660 Len=0</p>
<p>The next example uses the packet summary columns feature to add the IP identification and time-to-live values to the summary output.</p>
<p>C:\&gt;tshark - r <a href="http://http.cap">Http. cap</a> - nz proto, colinfo, ip. ttl, ip. ttl - z proto, colinfo, ip. id, ip. id</p>
<p>1 0.000000 145.254.160.237 -&gt; 6 5.208.228.223 3372 &gt; 80 [SYN] MSS=1460 ip. id == 0x0f41 ip. ttl == 128</p>
<p>Seq=0 Len=0</p>
<p>2 0.911310 65.208.228.223 -&gt; 14 5.254.160.237 80 &gt; 3372 [SYN, Ack=1 Win=5840 Len=0 MSS=1380 ip. id == 0x0000 ip. ttl == 47</p>
<p>ACK] Seq=0</p>
<p>3 0.911310 145.254.160.237 -&gt; 65.208.228.223 3372 &gt; 80 [ACK] Win=9660 Len=0 ip. id == 0x0f44 ip. ttl == 128</p>
<p>Seq=1 Ack=1</p>
<p>SIP Statistics</p>
<p><b>Syntax: </b>-z sip, stat,<i>Filter</i></p>
<p><b>Description: </b>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). <b>Example: </b>The following example reads from the sip1.dump stored capture file and reports the observed SIP statistics for all hosts:</p>
<p>C:\&gt;tshark - r sip1.dump - nqz sip, stat</p>
<p>SIP Statistics</p>
<p>Number of SIP messages: 37 Number of resent SIP messages: 0</p>
<p>*&nbsp;SIP Status Codes in reply packets</p>
<p>SIP 407 Proxy Authentication Required :&nbsp;1 Packets</p>
<p>SIP 200 OK&nbsp;:&nbsp;10 Packets</p>
<p>SIP 100 Trying&nbsp;:&nbsp;4 Packets</p>
<p>SIP 180 Ringing&nbsp;:&nbsp;2 Packets</p>
<p>*&nbsp;List of&nbsp;SIP Request methods INVITE&nbsp;: 9 Packets BYE&nbsp;: 2 Packets ACK&nbsp;: 9 Packets</p>
<p>H.225 Counters</p>
<p><b>Syntax: </b>-z h22 5,counter[<i>,filter]</i></p>
<p><b>Description: </b>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.</p>
<p><b>Example: </b>The following example reads from the specified compressed capture file and reports observed H.225 statistics.</p>
<p>C:\&gt;tshark - r rtp_example. raw. gz - nqz h225,counter</p>
<p>================== H225 Message and Reason Counter ==================</p>
<p>RAS-Messages: Call Signalling: setup : 1</p>
<p>CallProceeding : 1 connect : 1 alerting : 1</p>
<p>H.225 Service Response Time</p>
<p><b>Syntax: </b>-z h22 5,srt[ ,/ilter]</p>
<p><b>Description: </b>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.</p>
<p>Media Gateway Control Protocol Round Trip Delay</p>
<p><b>Syntax: </b>-z mgcp, rtd[ ,/ilter]</p>
<p><b>Description: </b>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.</p>
<p>SMB Round Trip Data</p>
<p><b>Syntax: </b>-z smb, rtt[ ,/ilter]</p>
<p><b>Description: </b>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. <b>Example: </b>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.</p>
<p>$ tshark - r rtl-fileshare. dump - nqz smb, rtt</p>
<p>SMB RTT Statistics: Filter:</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>Commands</p>
</td>
<td>
<p>Calls</p>
</td>
<td>
<p>Min RTT</p>
</td>
<td>
<p>Max RTT</p>
</td>
<td>
<p>Avg RTT</p>
</td>
</tr>
<tr>
<td>
<p>Open</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>0.00186</p>
</td>
<td>
<p>0.00186</p>
</td>
<td>
<p>0.00186</p>
</td>
</tr>
<tr>
<td>
<p>Close</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>0.00023</p>
</td>
<td>
<p>0.00176</p>
</td>
<td>
<p>0.00066</p>
</td>
</tr>
<tr>
<td>
<p>Trans</p>
</td>
<td>
<p>5</p>
</td>
<td>
<p>0.00190</p>
</td>
<td>
<p>13.69178</p>
</td>
<td>
<p>2.76430</p>
</td>
</tr>
<tr>
<td>
<p>Open AndX</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>0.00450</p>
</td>
<td>
<p>0.00450</p>
</td>
<td>
<p>0.00450</p>
</td>
</tr>
<tr>
<td>
<p>Read AndX</p>
</td>
<td>
<p>309</p>
</td>
<td>
<p>0.00025</p>
</td>
<td>
<p>0.01865</p>
</td>
<td>
<p>0.00412</p>
</td>
</tr>
<tr>
<td>
<p>Tree Disconnect</p>
</td>
<td>
<p>7</p>
</td>
<td>
<p>0.00117</p>
</td>
<td>
<p>0.14601</p>
</td>
<td>
<p>0.02 324</p>
</td>
</tr>
<tr>
<td>
<p>Negotiate Protocol</p>
</td>
<td>
<p>8</p>
</td>
<td>
<p>0.00026</p>
</td>
<td>
<p>0.07451</p>
</td>
<td>
<p>0.02226</p>
</td>
</tr>
<tr>
<td>
<p>Session Setup AndX</p>
</td>
<td>
<p>16</p>
</td>
<td>
<p>0.00028</p>
</td>
<td>
<p>0.0192 8</p>
</td>
<td>
<p>0.00578</p>
</td>
</tr>
<tr>
<td>
<p>Logoff AndX</p>
</td>
<td>
<p>12</p>
</td>
<td>
<p>0.00074</p>
</td>
<td>
<p>0.00872</p>
</td>
<td>
<p>0.00258</p>
</td>
</tr>
<tr>
<td>
<p>Tree Connect AndX</p>
</td>
<td>
<p>7</p>
</td>
<td>
<p>0.00081</p>
</td>
<td>
<p>0.00399</p>
</td>
<td>
<p>0.00190</p>
</td>
</tr>
<tr>
<td>
<p>NT Create AndX</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>0.00029</p>
</td>
<td>
<p>0.00270</p>
</td>
<td>
<p>0.00132</p>
</td>
</tr>
<tr>
<td>
<p>Transaction2 Commands</p>
</td>
<td>
<p>Calls</p>
</td>
<td>
<p>Min RTT</p>
</td>
<td>
<p>Max RTT</p>
</td>
<td>
<p>Avg RTT</p>
</td>
</tr>
<tr>
<td>
<p>FIND FIRST2</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>0.19993</p>
</td>
<td>
<p>0.19993</p>
</td>
<td>
<p>0.19993</p>
</td>
</tr>
<tr>
<td>
<p>QUERY FS INFO</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>0.00023</p>
</td>
<td>
<p>0.0024 8</p>
</td>
<td>
<p>0.00135</p>
</td>
</tr>
<tr>
<td>
<p>QUERY FILE INFO</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>0.00040</p>
</td>
<td>
<p>0.00551</p>
</td>
<td>
<p>0.00296</p>
</td>
</tr>
<tr>
<td>
<p>NT Transaction Commands</p>
</td>
<td>
<p>Calls</p>
</td>
<td>
<p>Min RTT</p>
</td>
<td>
<p>Max RTT</p>
</td>
<td>
<p>Avg RTT</p>
</td>
</tr>
</table>
<p>SMB Security Identifier Name Snooping</p>
<p><b>Syntax: </b>-z smb, sids</p>
<p><b>Description: </b>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.</p>
<p>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 <b>Edit | Preferences | Protocols | SMB | Snoop SID to name mappings, </b>Or specify the preference on the command line with - o smb. sid_name_snooping:TRUE.</p>
<p>BOOTP Statistics</p>
<p><b>Syntax: </b>-z bootp, stat,[fiilter]</p>
<p><b>Description: </b>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.</p>
<p><b>Example: </b>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 <i>Stat </i>Keyword is required, even though a display filter is not specified in this example.</p>
<p>$ tshark - nqr rtl-fileshare. dump - z bootp, stat,</p>
<p>===================================================================</p>
<p>BOOTP Statistics with filter BOOTP Option 53: DHCP Messages Types: DHCP Message Type&nbsp;Packets nb</p>
<p>Inform 74 ACK 2 75 Release 10 NAK 82 Decline 25 Request 1255 Discover 1811 Offer 279</p>
<p>===================================================================</p>
<p>HTTP Statistics</p>
<p><b>Syntax: </b>-z http, stat,[fiilter]</p>
<p><b>Description: </b>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.</p>
<p><b>Example: </b>The following example reads from a stored capture file and identifies the observed HTTP statistics. Note that the tailing comma after the <i>Stat </i>Keyword is required, even though a display filter is not specified in this example.</p>
<p>$ tshark - r Kismet-Aug-01-2 002-2.dump - nqz http, stat,</p>
<p>===================================================================</p>
<p>HTTP Statistics</p>
<p>* HTTP Status Codes in reply packets</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>HTTP</p>
</td>
<td>
<p>4 08</p>
</td>
<td>
<p>Request Time-out</p>
</td>
</tr>
<tr>
<td>
<p>HTTP</p>
</td>
<td>
<p>301</p>
</td>
<td>
<p>Moved Permanently</p>
</td>
</tr>
<tr>
<td>
<p>HTTP</p>
</td>
<td>
<p>302</p>
</td>
<td>
<p>Moved Temporarily</p>
</td>
</tr>
<tr>
<td>
<p>HTTP</p>
</td>
<td>
<p>304</p>
</td>
<td>
<p>Not Modified</p>
</td>
</tr>
<tr>
<td>
<p>HTTP</p>
</td>
<td>
<p>200</p>
</td>
<td>
<p>OK</p>
</td>
</tr>
<tr>
<td>
<p>HTTP</p>
</td>
<td>
<p>2 06</p>
</td>
<td>
<p>Partial Content</p>
</td>
</tr>
<tr>
<td>
<p>HTTP</p>
</td>
<td>
<p>100</p>
</td>
<td>
<p>Continue</p>
</td>
</tr>
<tr>
<td>
<p>HTTP</p>
</td>
<td>
<p>403</p>
</td>
<td>
<p>Forbidden</p>
</td>
</tr>
<tr>
<td>
<p>HTTP</p>
</td>
<td>
<p>404</p>
</td>
<td>
<p>Not Found</p>
</td>
</tr>
</table>
<p>* List of HTTP Request methods SEARCH 336 GET 1447 POST 8 HEAD 2</p>
<p>===================================================================</p>
<p>HTTP Tree Statistics</p>
<p><b>Syntax: </b>-z http, tree[,<i>Filter]</i></p>
<p><b>Description: </b>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</p>
<p>Server is being used, and can even identify potentially malicious activity with unsupported or broken HTTP requests or responses.</p>
<p><b>Example: </b>The following example reads from a stored capture file and reports HTTP statistics in the tree-like view.</p>
<p>C:\&gt;tshark - r Kismet-Aug-01-2 002-2.dump - nqz http, tree</p>
<p>===================================================================</p>
<p>HTTP/Packet Counter</p>
<p>Value</p>
<p>Rate</p>
<p>Percent</p>
<p>Total HTTP Packets HTTP Request Packets SEARCH GET POST HEAD</p>
<p>HTTP Response Packets</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>???:</p>
</td>
<td>
<p>Broken</p>
</td>
</tr>
<tr>
<td>
<p>1xx:</p>
</td>
<td>
<p>Informational</p>
</td>
</tr>
<tr>
<td>
<p>100</p>
</td>
<td>
<p>Continue</p>
</td>
</tr>
<tr>
<td>
<p>2xx:</p>
</td>
<td>
<p>Success</p>
</td>
</tr>
<tr>
<td>
<p>200</p>
</td>
<td>
<p>OK</p>
</td>
</tr>
<tr>
<td>
<p>206</p>
</td>
<td>
<p>Partial Content</p>
</td>
</tr>
<tr>
<td>
<p>3xx:</p>
</td>
<td>
<p>Redirection</p>
</td>
</tr>
<tr>
<td>
<p>304</p>
</td>
<td>
<p>Not Modified</p>
</td>
</tr>
<tr>
<td>
<p>302</p>
</td>
<td>
<p>Found</p>
</td>
</tr>
<tr>
<td>
<p>301</p>
</td>
<td>
<p>Moved Permanently</p>
</td>
</tr>
<tr>
<td>
<p>4xx:</p>
</td>
<td>
<p>Client Error</p>
</td>
</tr>
<tr>
<td>
<p>408</p>
</td>
<td>
<p>Request Time-out</p>
</td>
</tr>
<tr>
<td>
<p>404</p>
</td>
<td>
<p>Not Found</p>
</td>
</tr>
<tr>
<td>
<p>403</p>
</td>
<td>
<p>Forbidden</p>
</td>
</tr>
<tr>
<td>
<p>5xx:</p>
</td>
<td>
<p>Server Error</p>
</td>
</tr>
<tr>
<td>
<p>Other</p>
</td>
<td>
<p>HTTP Packets</p>
</td>
</tr>
</table>
<p>8067 1793 336 1447 8 2</p>
<p>1296</p>
<p>0</p>
<p>121 121</p>
<p>689 685 4</p>
<p>479 452 24 3</p>
<p>7</p>
<p>4 1 2</p>
<p>0</p>
<p>4978</p>
<p>0.001504 0.000334 0.000063 0.000270 0.000001 0.000000 0.000242 0.000000 0.000023</p>
<p>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</p>
<p>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%</p>
<p>===================================================================</p>
<p>HTTP Request Statistics</p>
<p><b>Syntax: </b>-z http_req, tree[,<i>Filter]</i></p>
<p><b>Description: </b>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.</p>
<p><b>Example: </b>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.</p>
<p>C:\&gt;tshark - r Kismet-Aug-01-2 002-2.dump - nqz http_req, tree,&quot;ip. addr eq 66.207.60.150&quot;</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>HTTP/Requests</p>
</td>
<td>
<p>Value</p>
</td>
<td>
<p>Rate</p>
</td>
<td>
<p>Percent</p>
</td>
</tr>
<tr>
<td>
<p>HTTP Requests by HTTP Host</p>
</td>
<td>
<p>35</p>
</td>
<td>
<p>0.000757</p>
</td>
</tr>
<tr>
<td>
<p><a href="http://www.megatokyo.com">Www. megatokyo. com</a></p>
</td>
<td>
<p>35</p>
</td>
<td>
<p>0.000757</p>
</td>
<td>
<p>100.00%</p>
</td>
</tr>
<tr>
<td>
<p>/parts/mt2-head-top. gif</p>
</td>
<td>
<p>3</p>
</td>
<td>
<p>0.000065</p>
</td>
<td>
<p>8.57%</p>
</td>
</tr>
<tr>
<td>
<p>/parts/mt2-merchandise. gif</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>0.000043</p>
</td>
<td>
<p>5.71%</p>
</td>
</tr>
<tr>
<td>
<p>/parts/mt-shadow-right. gif</p>
</td>
<td>
<p>8</p>
</td>
<td>
<p>0.000173</p>
</td>
<td>
<p>22.86%</p>
</td>
</tr>
<tr>
<td>
<p>/parts/mt-glow-top. gif</p>
</td>
<td>
<p>4</p>
</td>
<td>
<p>0.000087</p>
</td>
<td>
<p>11.43%</p>
</td>
</tr>
<tr>
<td>
<p>/parts/mt-blk bar-credits. gif</p>
</td>
<td>
<p>14</p>
</td>
<td>
<p>0.000303</p>
</td>
<td>
<p>40.00%</p>
</td>
</tr>
<tr>
<td>
<p>/parts/pix-dark. gif</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>0.000022</p>
</td>
<td>
<p>2.86%</p>
</td>
</tr>
<tr>
<td>
<p>/parts/mt-bottom-prev. gif</p>
</td>
<td>
<p>2</p>
</td>
<td>
<p>0.000043</p>
</td>
<td>
<p>5.71%</p>
</td>
</tr>
<tr>
<td>
<p>/parts/mt-glow-bottom. gif</p>
</td>
<td>
<p>1</p>
</td>
<td>
<p>0.000022</p>
</td>
<td>
<p>2.86%</p>
</td>
</tr>
</table>
<p>Notes from the Underground...</p>
<p><b>XML Compatible Protocol Dissection</b></p>
<p>A new feature to TShark in version 0.10.0 is the ability to display output in PDML format by using the <b>-T pdml </b>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:</p>
<p><b>&#9632;</b><b>&nbsp;&lt;pdml&gt; </b>This PDML file is delimited by the &lt;pdml&gt; and &lt;/pdml&gt; tags. This tag does not have any attributes.</p>
<p>Example: &lt;pdml version=&quot;0&quot; creator=&quot;Wireshark/0.10.0&quot;&gt;</p>
<p><b>&#9632;</b><b>&nbsp;&lt;packet&gt; </b>A PDML file can contain multiple packets by using the &lt;packet&gt; element. This tag does not have any attributes.</p>
<p><b>&#9632;</b><b>&nbsp;&lt;proto&gt; </b>A packet can contain multiple protocols, designated by the &lt;proto&gt; element. The &lt;proto&gt; tag can have the following attributes:</p>
<p><b>&#9632;</b><b>&nbsp;name </b>The display filter name for the protocol.</p>
<p><b>&#9632;</b><b>&nbsp;showname </b>The label used to describe this protocol in the protocol tree.</p>
<p><b>&#9632;</b><b>&nbsp;pos </b>The starting offset within the packet data where this protocol starts.</p>
<p><b>&#9632;</b><b>&nbsp;size </b>The number of octets in the packet data this protocol covers.</p>
<p>Example: &lt;proto name=&quot;ip&quot; showname=&quot;Internet Protocol, Src Addr: 192.168.100.132</p>
<p>(192.168.100.132), Dst Addr: 192.168.129.201 (192.168.129.201)&quot; size=&quot;20&quot; pos=&quot;14&quot;&gt;</p>
<p><b>&#9632;</b><b>&nbsp;&lt;field&gt; </b>A protocol can contain multiple fields, designated by the &lt;field&gt; element. The &lt;field&gt; tag can have the following attributes:</p>
<p><b>&#9632;</b><b>&nbsp;name </b>The display filter name for the field.</p>
<p><b>&#9632;</b><b>&nbsp;showname </b>The label used to describe this field in the protocol tree.</p>
<p><b>&#9632;</b><b>&nbsp;pos </b>The starting offset within the packet data where this field starts.</p>
<p><b>Continued</b></p>
<p><b>&#9632;</b><b>&nbsp;size </b>The number of octets in the packet data this field covers.</p>
<p><b>&#9632;</b><b>&nbsp;value </b>The actual packet data, in hex, this field covers.</p>
<p><b>&#9632;</b><b>&nbsp;show </b>The representation of the packet data as it appears in a display filter.</p>
<p>Example: &lt;field name=&quot;ip. version&quot; showname=&quot;Version: 4&quot; size=&quot;1&quot;</p>
<p>Pos=&quot;14&quot; show=&quot;4&quot; value=&quot;45&quot;/&gt;</p>
<p>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:</p>
<p>[root@localhost tools]# ./msnchat - h msnchat [OPTIONS] CAPTURE_FILE [...]</p>
<p>-o FILE&nbsp;name of output file</p>
<p>-t TSHARK location of TShark binary</p>
<p>-u USER&nbsp;name for unknown user</p>
<p>The following command can be used to read and parse a saved capture file called msn_test1.</p>
<p>[root@localhost tools]# ./msnchat - o outfile msn_test1</p>
<p>When viewed with a Web browser, the HTML outfile looks like this:</p>
<p>---- New Conversation @ Dec 30, 2003 14:21:08 ----</p>
<p>(14:21:08)&nbsp;Luke: hello</p>
<p>(14:21:22)&nbsp;Unknown: how are you?</p>
<p>(14:21:53)&nbsp;Luke: are we meeting at noon?</p>
<p>(14:22:03)&nbsp;Unknown: yes, at the secret location.</p>
<p>(14:22:11)&nbsp;Luke: great, see you then</p>
<p>(14:22:17)&nbsp;Unknown: ok</p>
<p>(14:22:18)&nbsp;Unknown: bye</p>
<p>You can add a name for the Unknown user by typing the command:</p>
<p>[root@localhost tools]# ./msnchat - o outfile - u Leia msn_test1</p>
<p>The HTML output would then look like this:</p>
<p><b>Continued</b></p>
<p>---- New Conversation @ Dec 30, 2003 14:21:08 ----</p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>(14:21:08)</p>
</td>
<td>
<p>Luke:</p>
</td>
<td>
<p>Hello</p>
</td>
</tr>
<tr>
<td>
<p>(14:21:22)</p>
</td>
<td>
<p>Leia:</p>
</td>
<td>
<p>How are you?</p>
</td>
</tr>
<tr>
<td>
<p>(14:21:53)</p>
</td>
<td>
<p>Luke:</p>
</td>
<td>
<p>Are we meeting at noon?</p>
</td>
</tr>
<tr>
<td>
<p>(14:22:03)</p>
</td>
<td>
<p>Leia:</p>
</td>
<td>
<p>Yes, at the secret location.</p>
</td>
</tr>
<tr>
<td>
<p>(14:22:11)</p>
</td>
<td>
<p>Luke:</p>
</td>
<td>
<p>Great, see you then</p>
</td>
</tr>
<tr>
<td>
<p>(14:22:17)</p>
</td>
<td>
<p>Leia:</p>
</td>
<td>
<p>Ok</p>
</td>
</tr>
<tr>
<td>
<p>(14:22:18)</p>
</td>
<td>
<p>Leia:</p>
</td>
<td>
<p>Bye</p>
</td>
</tr>
</table>
<p>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.</p>
]]></content:encoded>
			<wfw:commentRss>http://biglib.net/tshark-statistics/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>TShark</title>
		<link>http://biglib.net/tshark/</link>
		<comments>http://biglib.net/tshark/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 20:31:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[TShark]]></category>

		<guid isPermaLink="false">http://biglib.net/tshark/</guid>
		<description><![CDATA[TShark is the command-line version of Wireshark. It can be used to capture, decode, and print to screen live packets from the wire or to read saved capture files. Some of the same features apply to both TShark and Wireshark, &#8230; <a href="http://biglib.net/tshark/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>TShark is the command-line version of Wireshark. It can be used to capture, decode, and print to screen live packets from the wire or to read saved capture files. Some of the same features apply to both TShark and Wireshark, as they use the same capture library, libpcap, and most of the same code. TShark can read all the same packet capture formats as Wireshark, and will automatically determine the type. If TShark is compiled with the zlib library, it can automatically uncompress and read files that have been compressed with gzip. The advantage to using TShark is that it is highly scriptable.</p>
<p>The following information is the usage output for the TShark program. Notice the various types of formats in which TShark can save files by using the —F option:</p>
<p>$ tshark - h</p>
<p>TShark 0.99.4 (SVN Rev 19507) Dump and analyze network traffic.</p>
<p>See <a href="http://www.wireshark.org">Http://www. wireshark. org</a> for more information</p>
<p>Copyright 1998-2006 Gerald Combs &lt;<a href="mailto:gerald@wireshark.org">Gerald@wireshark. org</a>&gt; and contributors. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>
<p>Usage: tshark [options] ...</p>
<p>Capture interface:</p>
<p>-i &lt;interface&gt;&nbsp;name or idx of interface (def: first non-loopback)</p>
<p>-f &lt;capture filter&gt;&nbsp;packet filter in libpcap filter syntax</p>
<p>-s&nbsp;&lt;snaplen&gt;&nbsp;packet snapshot length (def: 65535)</p>
<p>-p&nbsp;don't capture in promiscuous mode</p>
<p>-y&nbsp;&lt;link type&gt;&nbsp;link layer type (def: first appropriate)</p>
<p>-D&nbsp;print list of interfaces and exit</p>
<p>-L&nbsp;print list of link-layer types of iface and exit</p>
<p>Capture stop conditions: - c &lt;packet count&gt; - a &lt;autostop cond.&gt;</p>
<p>Capture output:</p>
<p>-b &lt;ringbuffer opt.&gt;</p>
<p>Input file: - r &lt;infile&gt;</p>
<p>Stop after n packets (def: infinite) duration:NUM - stop after NUM seconds filesize:NUM - stop this file after NUM KB files:NUM - stop after NUM files</p>
<p>Duration:NUM - switch to next file after NUM secs filesize:NUM - switch to next file after NUM KB files:NUM - ringbuffer: replace after NUM files</p>
<p>Set the filename to read from (no pipes or stdin!)</p>
<p>Processing:</p>
<p>-R &lt;read filter&gt;&nbsp;packet filter in Wireshark display filter syntax</p>
<p>-n&nbsp;disable all name resolutions (def: all enabled)</p>
<p>-N &lt;name resolve flags&gt; enable specific name resolution(s): &quot;mntC&quot;</p>
<p>-d &lt;layer_type&gt;==&lt;selector&gt;,&lt;decode_as_protocol&gt; ...</p>
<p>&quot;Decode As&quot;, see the man page for details Example: tcp. port==8888,http</p>
<p>Output:</p>
<p>-w &lt;outfile|-&gt;</p>
<p>-F &lt;output file type&gt;</p>
<p>-V - x</p>
<p>-T pdml|ps|psml|text</p>
<p>-t ad|a|r|d first)</p>
<p>-l</p>
<p>-q</p>
<p>Statistics)</p>
<p>-X &lt;key&gt;:&lt;value&gt; - z &lt;statistics&gt;</p>
<p>Set the output filename (or '-' for stdout) set the output file type, default is libpcap an empty &quot;-F&quot; option will list the file types add output of packet tree&nbsp;(Packet Details)</p>
<p>Add output of hex and ASCII dump (Packet Bytes) output format of text output (def: text) output format of time stamps (def: r: rel. to</p>
<p>Flush output after each packet</p>
<p>Be more quiet on stdout (e. g. when using</p>
<p>EXtension options, see the man page for details various statistics, see the man page for details</p>
<p>Miscellaneous:</p>
<p>-h&nbsp;display this help and exit</p>
<p>-v&nbsp;display version info and exit</p>
<p>-o &lt;name&gt;:&lt;value&gt; ...&nbsp;override preference setting</p>
<p>The following command-line options are used to control TShark's data capture and output:</p>
<p>&#9632; Capture Interface Options</p>
<p>&#9632;&nbsp;<b>—i <i>Interface </i></b>Specifies the interface you want to use to capture data. The —D option can be used to find out the names of your network inter-faces. You can use the number or the name as a parameter to the <b>—i </b>Option. If you run TShark without the —i option, it will search the list of interfaces and choose the first non-loopback interface it finds. If it doesn't find any non-loopback interfaces, it will use the first loopback interface. If this doesn't exist, TShark will exit with an error.</p>
<p>&#9632;&nbsp;<b>—f <i>Capture filter expression </i></b>Allows you to set the filter expression to use when capturing data. For example, <b>Tshark - f tcp port 80 </b>Will only capture incoming and outgoing HTTP packets.</p>
<p>&#9632;&nbsp;<b>—s <i>Snaplen </i></b>Allows you to set the default snapshot length to use when capturing data. The parameter <i>Snaplen </i>Specifies the length, in bytes, of each network packet that will be read or saved to disk. The default <i>Snaplen </i>Is 65535 bytes, which should be large enough to capture the entire frame contents for all data link types.</p>
<p>&#9632;&nbsp;<b>—p </b>Tells TShark to not put the interface in promiscuous mode. This will cause TShark to only read traffic sent to and from the system on which TShark is running, broadcast traffic, and multicast traffic.</p>
<p>&#9632;&nbsp;<b>—y <i>Type </i></b>Allows you to set the data link type to use while capturing packets. You can use the <b>—L </b>Option to lists the data link types that are supported by an interface.</p>
<p>&#9632;&nbsp;<b>—D </b>Instructs TShark to print a list of available interfaces on the system. It will print the interface number, name, and description and then return to the command prompt. You can then supply the number or the name to the <b>—i </b>Flag to specify an interface on which to capture data. Specifying this option causes TShark to open and attempt to capture on each interface it finds. It will only display the</p>
<p>Interfaces on which this was successful. Also, if you need to be logged in as root to run TShark but are not, this option will not display any available interfaces.</p>
<p>&#9632;&nbsp;—<b>L </b>Lists the data link types that are supported by an interface and then exits. You can specify an interface to use, or TShark will choose the first one it finds as stated in the <b>—i </b>Option information.</p>
<p>&#9632;&nbsp;Capture Stop Options</p>
<p>&#9632;&nbsp;<b>—c <i>Count </i></b>Sets the default number of packets to read when capturing data. For example, if you only want to capture 100 packets you would specify <b>—c 100.</b></p>
<p>&#9632;&nbsp;<b>—a <i>Test:value </i></b>Used when capturing to a file. It specifies to TShark when to stop writing to the file. The criterion is in the form <i>Test:value, </i>Where test is either <i>Duration </i>Or <i>File size. </i>Duration will stop writing to a file when the specified number of seconds have elapsed, and file size will stop writing to a file after a size of <i>Value </i>Kilobytes has been reached.</p>
<p>&#9632;&nbsp;Capture Output Option</p>
<p>&#9632;&nbsp;<b>—b <i>Number of ring buffer files ['.duration] </i></b>Used with the <b>—a </b>Option, and causes TShark to continue capturing data to successive files. This is known as <i>Ring buffer </i>Mode and will keep saving files up to the number specified within the option. When the first file reaches the maximum size, as specified with the <b>—a </b>Option, TShark will begin writing to the next file. When all files are full, it will continue to write new files as it removes the older ones. However, if the <i>Number of files </i>Is specified as 0, the number of files TShark writes to will be unlimited, and will only be restricted to the size of the hard disk. An optional duration parameter can also be specified so TShark will switch to the next file when the instructed number of seconds has elapsed. This will happen even if the current file is not yet full. The filenames created are based on the number of the file and the creation date and time. You can only save files in the libpcap format when this option is used.</p>
<p>&#9632;&nbsp;Capture Input Option</p>
<p>&#9632;&nbsp;<b>—r <i>File </i></b>Reads and processes a saved capture file.</p>
<p>&#9632;&nbsp;Capture Processing Options</p>
<p>&#9632;&nbsp;<b>—R<i>Filter </i></b>Causes a read filter to be applied before displaying or writing the packets to a file. Packets that do not match the filter will be discarded.</p>
<p>&#9632;&nbsp;<b>—n </b>Used to disable network object name resolution, such as host names and port names.</p>
<p>&#9632;&nbsp;<b>—N <i>Resolving flags </i></b>Used to enable name resolving for specified address types and port numbers. The <b>M </b>Flag enables MAC address resolution, the <b>N </b>Flag enables network address resolution, and the <b>T </b>Flag enables transport-layer port number resolution. The <b>C </b>Flag enables concurrent (asynchronous) Domain Name System (DNS) lookups ifTShark is compiled with Asynchronous DNS (ADNS).The <b>—N </b>Option overrides the <b>—n </b>Option.</p>
<p>&#9632;&nbsp;<b>—d <i>Layer type==selector, decode-as protocol </i></b>Allows you to specify the way in which traffic is decoded. The parameters denote that if the layer type has a specified value, packets should be decoded as the specified protocol. For example, <b>—d tcp. port==8080, http </b>Would decode all traffic to and from Transmission Control Protocol (TCP) port 8080 as HyperText Transfer Protocol (HTTP) traffic. This is valuable for applications that allow you to run services on nonstan-dard ports.</p>
<p>&#9632;&nbsp;<b>—B <i>Buffer size </i></b>Available only on Windows systems, causing TShark to allocate a buffer size in MB (default is 1MB) to use for storing packet data during a capture before writing to the disk. This option is useful if your packet capture is dropping frames due to the overhead associated with writing to the disk.</p>
<p>&#9632;&nbsp;Capture Output Options</p>
<p>&#9632;&nbsp;<b>—w <i>File </i></b>Writes the packets to the filename specified following the option. If the option specified is -, standard output is used. This option suppresses the packet display decoding unless the <b>S </b>Option is also specified.</p>
<p>&#9632;&nbsp;<b>—F <i>Type </i></b>Used to set the format of the output of the capture file. For example, if you want to save a file in the Sun snoop format so snoop can read the capture file, you would use the <b>—F snoop </b>Option.</p>
<p><b>&#9632;&nbsp;—V </b>Displays the capture in protocol tree form instead of the default summary packet form.</p>
<p><b>&#9632;</b><b>&nbsp;—S </b>Decodes and displays the contents of packets even when writing to a file.</p>
<p><b>&#9632;&nbsp;—x </b>Displays the capture in a hexadecimal and ASCII dump format along with the summary or protocol tree view.</p>
<p><b>&#9632;&nbsp;—T pdml|ps|text </b>Allows you to set the display format to use when viewing packet data. When using the Packet Details Markup Language (PDML) option, the protocol data tree is always displayed. If the desired format is omitted, &quot;text&quot; is used as the default.</p>
<p><b>&#9632;</b><b>&nbsp;—t format </b>Allows you to set the format of the packet timestamp that is displayed on the summary line. The format parameter will specify the method used to display the data. Relative time is specified by the <b>R </b>Parameter and displays the time elapsed between the first packet and the current packet. Absolute time is specified by the <b>A </b>Parameter and is the actual time the packet was captured. The absolute date and time are specified by the <b>Ad </b>Parameter and are the actual time and date the packet was captured. The delta time is specified by the <b>D </b>Parameter and displays the time since the previous packet was captured. By default, the time is specified as relative.</p>
<p><b>&#9632;</b><b>&nbsp;—l </b>Flushes the standard output buffer after each packet is printed instead of waiting until it fills up. It is normally used when piping a capture to a script so that the output for each packet is sent as soon as it is read and dissected.</p>
<p><b>&#9632;&nbsp;—q </b>Allows you to turn off the packet count when capturing network packets to a file. The count will still be displayed at the end of the capture. On some systems, such as various BSD systems, that support the SIGINFO signal, typing <b>Control-T </b>Will cause the current count status to be displayed.</p>
<p><b>&#9632;&nbsp;—X </b>Allows the user to specify an option that will be passed to a TShark module. Currently, this option is used to specify additional analysis functionality using Lua scripts with the syntax <b>Lua_script:filename.</b></p>
<p><b>&#9632;&nbsp;—z <i>Statistics </i></b>Causes TShark to collect various types of statistics about the data being captured. The results will be displayed after reading the capture file.</p>
<p>&#9632; Miscellaneous Options</p>
<p>&#9632;&nbsp;<b>—h </b>Prints the version of TShark and the help options and then exits.</p>
<p>&#9632;&nbsp;—<b>V </b>Prints the TShark version information and then exits.</p>
<p>&#9632;&nbsp;<b>—o <i>Prefname:value </i></b>Allows you to set a preference value that will override any default value or value read from a preference file. The parameter to this option is in the format of <i>Prefname:value, </i>Where <i>Prefname </i>Is the name of the preference as it would appear in the preference file, and <i>Value </i>Is the value to which it should be set.</p>
<p>By default, TShark will display packets to the screen in summary line form. These are the same lines that are displayed in the Wireshark summary pane. However, it does not print the <i>Frame number </i>Field when capturing and displaying real time. The <b>—V </b>Option can be used to print detailed information about the packets instead of just a summary. TShark can also read saved data capture files, and print the information in either summary (default) or detailed form <b>(—V). </b>This method will display the frame numbers with the saved packets. Finally, the <b>—x </b>Command will cause TShark to print a hexadecimal and ASCII dump of the packet data with either the summary line or detailed protocol tree. TShark has a very strong display filter language and can use the TCPDump filter syntax as well. These can be used to narrow the type of traffic you want to capture.</p>
<p>When using TShark to write a capture to a file, the file will be written in libpcap format by default. It will write all the packets and all the detail about the packets to the output file; thus, the <b>—V </b>And the <b>—x </b>Options aren't necessary. Since TShark and Wireshark are compatible with many other sniffers, you can also write the output in several different formats. The <b>—F </b>Option can be used to specify a format in which to write the file.</p>
<p>The following is a basic example of using TShark to perform a capture and display the output in a protocol tree view along with the associated hexadecimal and ASCII output.</p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;tshark - V - x</p>
<p>Capturing on \Device\NPF_{A3 02C81E-256D-4C92-8A72-866F2E1ED55F}</p>
<p>Frame 1 (114 bytes on wire, 114 bytes captured)</p>
<p>Arrival Time: Nov 28, 2003 22:14:16.221349000</p>
<p>Time delta from previous packet: 0.000000000 seconds</p>
<p>Time since reference or first frame: 0.000000000 seconds</p>
<p>Frame Number: 1</p>
<p>Packet Length: 114 bytes</p>
<p>Capture Length: 114 bytes</p>
<p>IEEE 802.3 Ethernet</p>
<p>Destination: ff:ff:ff:ff:ff:ff (Broadcast)</p>
<p>Source: 00:05:5d:ee:7e:53 (D-Link_ee:7e:53)</p>
<p>Length: 100 Logical-Link Control</p>
<p>DSAP: NetWare (0xe0)</p>
<p>IG Bit: Individual</p>
<p>SSAP: NetWare (0xe0)</p>
<p>CR Bit: Command</p>
<p>Control field: U, func = UI (0x03)</p>
<p>000. 00.. = Unnumbered Information</p>
<p>......11 = Unnumbered frame</p>
<p>Internetwork Packet eXchange Checksum: 0xffff Length: 96 bytes Transport Control: 0 hops Packet Type: PEP (0x04)</p>
<p>Destination Network: 0x00000000 (00000000) Destination Node: ff:ff:ff:ff:ff:ff (Broadcast) Destination Socket: SAP (0x0452) Source Network: 0x00000000 (00000000) Source Node: 00:05:5d:ee:7e:53 (D-Link_ee:7e:53) Source Socket: Unknown (0x4008) Service Advertisement Protocol General Response</p>
<p>Server Name: TARGET1!!!!!!!!A5569B20ABE511CE9CA400004C762832</p>
<p>Server Type: Microsoft Internet Information Server (0x064E)</p>
<p>Network: 00 00 00 00</p>
<p>Node: 00:05:5d:ee:7e:53</p>
<p>Socket: Unknown (0x4000)</p>
<p>Intermediate Networks: 1</p>
<p>0000 ff ff ff ff ff ff 00 05 5d ee 7e 53 00 64 e0 e0 ........].~S. d..</p>
<p>0010 03 ff ff 00 60 00 04 00 00 00 00 ff ff ff ff ff ...........</p>
<p>0020 ff 04 52 00 00 00 00 00 05 5d ee 7e 53 40 08 00 ..R......].~S@..</p>
<p>0030 02 06 4e 54 41 52 47 45 54 31 21 21 21 21 21 21 ..NTARGET1!!!!!! 0040 21 21 41 35 35 36 39 42 32 30 41 42 45 35 31 31 !!A5569B20ABE511 0050 43 45 39 43 41 34 30 30 30 30 34 43 37 36 32 38 CE9CA400004C7628</p>
<p>0060 33 32 00 00 00 00 00 00 05 5d ee 7e 53 40 00 00 32 .......].~S@..</p>
<p>0070 01 01</p>
<p>The following is an example of using TShark to capture traffic on interface 4 and output the data to a file called <i>Output.</i>.The output files will have a maximum file size of 5 kilobytes each, and when they are full, a new output file will be created. This will continue to a maximum of 10 output files. The following example is the command used to perform this capture.</p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;tshark - i4 - a filesize:5 - b 10 - w output</p>
<p>The output files generated are appended with the file number, date, and times-tamp. You will see the following 10 output files start at number 43 because they have begun to drop the oldest file as they create new files, so a maximum of 10 files exists at all times.</p>
<p>Output_00043_20031128212900 output_00044_20031128212900 output_00045_20031128212900 output_00046_20031128212900 output_00047_20031128212901 output_00048_20031128212903 output_00049_20031128212958 output_00050_20031128213045 output_00051_20031128213211 output_00052_20031128213316</p>
<p>The following is an example of using a TShark capture filter to capture all traffic except packets to and from HTTP port 80.</p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;tshark - f &quot;tcp port!80&quot;</p>
<p>Capturing on \Device\NPF_{A302C81E-256D-4C92-8A72-866F2E1ED55F}</p>
<p>0.000000 D-Link_ed:3b:c6 -&gt; Broadcast ARP Who has 192.168.100.40? Tell 192.168.100.5</p>
<p>0.000026 D-Link_ee:7e:53 -&gt; D-Link_ed:3b:c6 ARP 192.168.100.40 is at 00:05:5d:ee:7e:53</p>
<p>0.000066 D-Link_ee:7e:53 -&gt; D-Link_ed:3b:c6 ARP 192.168.100.40 is at 00:05:5d:ee:7e:53</p>
<p>10.089720 00000000.00055dee7e53 -&gt; 00000000.ffffffffffff IPX SAP General Response</p>
<p>10.089763 00000000.00055dee7e53 -&gt; 00000000.ffffffffffff IPX SAP General Response</p>
<p>The following is an example of using a TShark read filter to output the Telnet data packets from a file called <i>Capture.</i></p>
<table class=msonormaltable border=0 cellpadding=0 style='mso-cellspacing:1.5pt; mso-yfti-tbllook:1184' frame=box rules=all>
<tr>
<td>
<p>C:\Program Files\Wireshark&gt;TShark</p>
</td>
<td>
<p>-r capture - R &quot;telnet&quot;</p>
</td>
</tr>
<tr>
<td>
<p>7</p>
</td>
<td>
<p>10.071157</p>
</td>
<td>
<p>192.168.100.122</p>
</td>
<td>
<p>-&gt;</p>
</td>
<td>
<p>192.168.100.132</p>
</td>
<td>
<p>TELNET</p>
</td>
<td>
<p>Telnet</p>
</td>
<td>
<p>Data</p>
</td>
</tr>
<tr>
<td>
<p>8</p>
</td>
<td>
<p>10.071464</p>
</td>
<td>
<p>192.168.100.132</p>
</td>
<td>
<p>-&gt;</p>
</td>
<td>
<p>192.168.100.122</p>
</td>
<td>
<p>TELNET</p>
</td>
<td>
<p>Telnet</p>
</td>
<td>
<p>Data</p>
</td>
</tr>
<tr>
<td>
<p>9</p>
</td>
<td>
<p>10.071515</p>
</td>
<td>
<p>192.168.100.132</p>
</td>
<td>
<p>-&gt;</p>
</td>
<td>
<p>192.168.100.122</p>
</td>
<td>
<p>TELNET</p>
</td>
<td>
<p>Telnet</p>
</td>
<td>
<p>Data</p>
</td>
</tr>
<tr>
<td>
<p>11</p>
</td>
<td>
<p>10.076114</p>
</td>
<td>
<p>192.168.100.132</p>
</td>
<td>
<p>-&gt;</p>
</td>
<td>
<p>192.168.100.122</p>
</td>
<td>
<p>TELNET</p>
</td>
<td>
<p>Telnet</p>
</td>
<td>
<p>Data</p>
</td>
</tr>
<tr>
<td>
<p>12</p>
</td>
<td>
<p>10.076155</p>
</td>
<td>
<p>192.168.100.132</p>
</td>
<td>
<p>-&gt;</p>
</td>
<td>
<p>192.168.100.122</p>
</td>
<td>
<p>TELNET</p>
</td>
<td>
<p>Telnet</p>
</td>
<td>
<p>Data</p>
</td>
</tr>
<tr>
<td>
<p>14</p>
</td>
<td>
<p>10.08 9546</p>
</td>
<td>
<p>192.168.100.122</p>
</td>
<td>
<p>-&gt;</p>
</td>
<td>
<p>192.168.100.132</p>
</td>
<td>
<p>TELNET</p>
</td>
<td>
<p>Telnet</p>
</td>
<td>
<p>Data</p>
</td>
</tr>
<tr>
<td>
<p>15</p>
</td>
<td>
<p>10.089672</p>
</td>
<td>
<p>192.168.100.132</p>
</td>
<td>
<p>-&gt;</p>
</td>
<td>
<p>192.168.100.122</p>
</td>
<td>
<p>TELNET</p>
</td>
<td>
<p>Telnet</p>
</td>
<td>
<p>Data</p>
</td>
</tr>
</table>
<p>The following is an example of using TShark to read a libpcap capture file called <i>Capture2 </i>And output it to a file called <i>Netmon_output </i>In the Microsoft Network Monitor <i>2.x </i>Format; this command generates no output. Note that the <i>Editcap </i>Command can also be used to perform this function, as we'll see later in this chapter.</p>
<p><a href="../../../../../program">C:\Program</a> Files\Wireshark&gt;tshark - r capture2 - w netmon_output - F netmon2</p>
]]></content:encoded>
			<wfw:commentRss>http://biglib.net/tshark/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Chapter 9</title>
		<link>http://biglib.net/chapter-9/</link>
		<comments>http://biglib.net/chapter-9/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 07:12:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Chapter 9]]></category>

		<guid isPermaLink="false">http://biglib.net/chapter-9/</guid>
		<description><![CDATA[Solutions in this chapter: &#9632;&#160;TShark &#9632;&#160;editcap &#9632;&#160;mergecap &#9632;&#160;text2pcap &#9632;&#160;capinfos &#9632;&#160;dumpcap 0 Summary 0 Solutions Fast Track 0 Frequently Asked Questions]]></description>
			<content:encoded><![CDATA[<p><b>Solutions in this chapter:</b></p>
<p><b>&#9632;</b><b>&nbsp;TShark</b></p>
<p><b>&#9632;</b><b>&nbsp;editcap</b></p>
<p><b>&#9632;</b><b>&nbsp;mergecap</b></p>
<p><b>&#9632;</b><b>&nbsp;text2pcap</b></p>
<p><b>&#9632;</b><b>&nbsp;capinfos</b></p>
<p><b>&#9632;</b><b>&nbsp;dumpcap</b></p>
<p>0 <b>Summary</b></p>
<p>0 <b>Solutions Fast Track</b></p>
<p>0 <b>Frequently Asked Questions</b></p>
]]></content:encoded>
			<wfw:commentRss>http://biglib.net/chapter-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plug-ins</title>
		<link>http://biglib.net/plug-ins-2/</link>
		<comments>http://biglib.net/plug-ins-2/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 03:41:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Advanced Topics]]></category>

		<guid isPermaLink="false">http://biglib.net/plug-ins-2/</guid>
		<description><![CDATA[Wireshark also supports the implementation of protocol dissectors as plug-ins. Plug-ins are preferred by some developers, because they can be developed and debugged without having to rebuild the whole Wireshark distribution. Another reason that some developers utilize the plug-in option &#8230; <a href="http://biglib.net/plug-ins-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wireshark also supports the implementation of protocol dissectors as plug-ins. Plug-ins are preferred by some developers, because they can be developed and debugged without having to rebuild the whole Wireshark distribution. Another reason that some developers utilize the plug-in option for their dissector, is to protect proprietary information. When releasing a protocol dissector in Wireshark, your code is checked and automatically becomes subject to the rules defined in the GPL; however, a plug-in can be distributed in binary form, and, therefore, the GPL will not apply to the specific plug-in.</p>
<p>You can compile and build your plug-in and then copy the binary to the plug-ins directory under the name of your plug-in. Wireshark ships with a number of plug-ins and each can be loaded or unloaded depending on whether they are installed prior to launching Wireshark. The plug-in interface mimics the dissector interface. In fact, plug-ins are first developed as a normal dissector. Then, additional code is added to make the dissector a plug-in. This procedure changed starting with Ethereal version 0.10.10. Making your <i>Packet-xxx </i>Protocol dissector a plug-in is a multi-step process, which includes the creation of a source code directory to house the plug-in and it's support files, as well as modifications to the <i>Makefiles </i>In the root of the source code distribution. The <i>README. plugins </i>File located in the <i>Doc </i>Directory outlines the steps you need to take to generate a plug-in dissector for Wireshark.</p>
]]></content:encoded>
			<wfw:commentRss>http://biglib.net/plug-ins-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TAPs</title>
		<link>http://biglib.net/taps/</link>
		<comments>http://biglib.net/taps/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 05:42:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Advanced Topics]]></category>

		<guid isPermaLink="false">http://biglib.net/taps/</guid>
		<description><![CDATA[Some of the most common TAPs used today in protocol dissectors are: &#9632;&#160;Expert &#9632;&#160;Conversations &#9632;&#160;Endpoints &#9632;&#160;SRT There are a number of examples for each of these types of TAPs. Protocol dissectors define and register the TAPs that they will be &#8230; <a href="http://biglib.net/taps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Some of the most common TAPs used today in protocol dissectors are:</p>
<p>&#9632;&nbsp;Expert</p>
<p>&#9632;&nbsp;Conversations</p>
<p>&#9632;&nbsp;Endpoints</p>
<p>&#9632;&nbsp;SRT</p>
<p>There are a number of examples for each of these types of TAPs. Protocol dissectors define and register the TAPs that they will be providing information too. To register a TAP, the following process must be added to your dissectors <i>Proto_register_xxx </i>Function:</p>
<p>My_srt_tap=register_tap(&quot;my_srt&quot;);</p>
<p>Inside of the protocol dissection process you should call the <i>Tap_queue_packet </i>Function with the necessary information needed by the TAP:</p>
<p>Tap_queue_packet(my_srt_tap, pinfo, pointer_to_my_tap_data);</p>
<p>Note that <i>Pointer_to_my_tap_data </i>Can be a pointer to any data that you want to pass to your specific TAP implementation. However, it is important when adding TAPs for already established interfaces like, conversations, endpoints, and so on, that you verify that your new TAP will pass a pointer to the correct information required by that TAP interface.</p>
<p>Now that the protocol dissector is registering the TAP, you can create a conversation, endpoint, or SRT statistic option to use the information the TAP provides. The first step in writing the code to manage the information is to create a new file in the <i>Gtk </i>Directory for the specific TAP data type. The file naming convention used for each type of statistic source code file is:</p>
<p>&#9632;&nbsp;<b><i>Gtk/conversations_myprot </i></b>Conversations</p>
<p>&#9632;&nbsp;<b><i>Gtk/myprot_stat </i></b>SRTs</p>
<p>&#9632;&nbsp;<b><i>Hostlist_myprot </i></b>Endpoints</p>
<p>Note that the TAP modules for Tshark are located in the <i>Root </i>Directory of the source code distribution. These files are typically named <i>Tap-myprot.</i></p>
<p>First we create the standard header and includes. We will need different includes depending on the type of statistic we are processing. In this example we are using the SRT statistics:</p>
<p>/* mysrt_stat. c * mysrt_stat 2006 My_Name</p>
<p>*&nbsp;$Id: mysrt_stat. c 00000 2006-01-01 00:00:00Z xxx $</p>
<p>*</p>
<p>*&nbsp;Wireshark - Network traffic analyzer</p>
<p>*&nbsp;By Gerald Combs &lt;<a href="mailto:gerald@wireshark.org">Gerald@wireshark. org</a>&gt;</p>
<p>*&nbsp;Copyright 1998 Gerald Combs</p>
<p>*</p>
<p>*&nbsp;This program is free software; you can redistribute it and/or</p>
<p>*&nbsp;modify it under the terms of the GNU General Public License</p>
<p>*&nbsp;as published by the Free Software Foundation; either version 2</p>
<p>*&nbsp;of the License, or (at your option) any later version.</p>
<p>*</p>
<p>*&nbsp;This program is distributed in the hope that it will be useful,</p>
<p>*&nbsp;but WITHOUT ANY WARRANTY; without even the implied warranty of</p>
<p>*&nbsp;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</p>
<p>*&nbsp;GNU General Public License for more details.</p>
<p>*</p>
<p>*&nbsp;You should have received a copy of the GNU General Public License</p>
<p>*&nbsp;along with this program; if not, write to the Free Software</p>
<p>*&nbsp;Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */</p>
<p>#ifdef HAVE_CONFIG_H</p>
<p>#&nbsp;include &quot;config. h&quot; #endif</p>
<p>#ifdef HAVE_SYS_TYPES_H</p>
<p>#&nbsp;include &lt;sys/types. h&gt; #endif</p>
<p>#include&nbsp;&lt;string. h&gt;</p>
<p>#include&nbsp;&lt;gtk/gtk. h&gt;</p>
<p>#include&nbsp;&lt;epan/packet_info. h&gt;</p>
<p>#include&nbsp;&lt;epan/epan. h&gt;</p>
<p>#include&nbsp;&lt;epan/value_string. h&gt;</p>
<p>#include&nbsp;&lt;epan/tap. h&gt;</p>
<p>#include&nbsp;&quot;service_response_time_table. h&quot;</p>
<p>#include&nbsp;&quot;../stat_menu. h&quot;</p>
<p>#include&nbsp;&quot;../tap_dfilter_dlg. h&quot;</p>
<p>#include&nbsp;&quot;gtkglobals. h&quot;</p>
<p>We now need a structure to store our SRT statistics in:</p>
<p>/* used to keep track of the statistics for an entire program interface */ typedef struct _mysrtstat_t {</p>
<p>GtkWidget *win;</p>
<p>Srt_stat_table my_srt_table; } mysrtstat_t;</p>
<p>We must register our new SRT statistics option with Wireshark. This registration process will add the new option to the SRT statistical menu and add this statistic as a sub-option of the SRT menu item or as a tab in the tabbed/notebook view:</p>
<p>Static tap_dfilter_dlg mysrt_stat_dlg = { &quot;My Protocol SRT Statistics&quot;, &quot;mysrt, srt&quot;, gtk_mysrtstat_init, -1</p>
<p>};</p>
<p>Void</p>
<p>Register_tap_listener_gtkmysrtstat(void) {</p>
<p>Register_dfilter_stat(&amp;mysrt_stat_dlg, &quot;MYSRT&quot;, REGISTER_STAT_GROUP_RESPONSE_TIME);</p>
<p>}</p>
<p>The main registration function <i>(register_dfilter_stat(J) </i>Passes the parameters, points to the function to call when a user selects the item <i>(mysrt_stat_dlg), </i>And names the display in the menu <i>(MYSRT) </i>And the statistical menu item we are adding this item too <i>(REGISTER_STAT_GROUP_RESPONSE_TIME).</i></p>
<p>The function called when the user selects the new SRT menu option <i>(mysrt_stat_dlg()) </i>Passes the information to the initialization function <i>(gtk_mysrtstat_init).</i></p>
<p>The first process in the initialization function <i>(gtk_mysrtstat_init) </i>Is to create the GTK window that will hold our statistical information.</p>
<p>Static void</p>
<p>Gtk_mysrtstat_init(const char *optarg, void *userdata _U_) {</p>
<p>/* Define a pointer to our structure */</p>
<p>Mysrtstat_t *ss;</p>
<p>Const char *filter=NULL;</p>
<p>/* Allocate memory for our table */ ss=g_malloc(sizeof(mysrtstat_t));</p>
<p>/* Get the current filter passed */ if(!strncmp(optarg,&quot;mysrt, srt,&quot;,8)){</p>
<p>Filter=optarg+8; } else {</p>
<p>Filter=NULL;</p>
<p>}</p>
<p>/* Create the main window */</p>
<p>Ss-&gt;win=window_new(GTK_WINDOW_TOPLEVEL, &quot;mysrt-stat&quot;); gtk_window_set_default_size(GTK_WINDOW(ss-&gt;win), 300, 400); vbox=gtk_vbox_new(FALSE, 3);</p>
<p>Gtk_container_add(GTK_CONTAINER(ss-&gt;win), vbox); gtk_container_set_border_width(GTK_CONTAINER(vbox), 12);</p>
<p>/* Print a label on the menu to describe this statistic */ label=gtk_label_new(&quot;My Protocol Service Response Time Statistics&quot;); gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);</p>
<p>/* Display the current display filter */</p>
<p>G_snprintf(filter_string,255,&quot;Filter:%s&quot;,filter? filter:&quot;&quot;); label=gtk_label_new(filter_string);</p>
<p>Gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);</p>
<p>/* Let's create a notebook view */ main_nb = gtk_notebook_new();</p>
<p>Gtk_box_pack_start(GTK_BOX(vbox), main_nb, TRUE, TRUE, 0); temp_page = gtk_vbox_new(FALSE, 6); label = gtk_label_new(&quot;Groups&quot;);</p>
<p>Gtk_notebook_append_page(GTK_NOTEBOOK(main_nb), temp_page, label); /* Create a Close button row. */</p>
<p>Bbox = dlg_button_row_new(GTK_STOCK_CLOSE, NULL); gtk_box_pack_end(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);</p>
<p>Close_bt = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE);</p>
<p>Window_set_cancel_button(ss-&gt;win, close_bt, window_cancel_button_cb);</p>
<p>/* Tell GTK what functions to call when a delete or destroy is detected */</p>
<p>SIGNAL_CONNECT(ss-&gt;win, &quot;delete_event&quot;, window_delete_event_cb, NULL); SIGNAL_CONNECT(ss-&gt;win, &quot;destroy&quot;, win_destroy_cb, ss);</p>
<p>Gtk_widget_show_all(ss-&gt;win); window_present(ss-&gt;win);</p>
<p>Inside the initialization function, after creating the window for the data, we must register a listener for the TAP information.</p>
<p>/* Register the tap listener */</p>
<p>Error_string=register_tap_listener(&quot;my_srt&quot;, ss, filter,</p>
<p>Mysrt_reset, mysrt_packet, mysrt_draw); if(error_string){</p>
<p>Simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, error_string-&gt;str);</p>
<p>G_string_free(error_string, TRUE);</p>
<p>G_free(ss);</p>
<p>Return;</p>
<p>}</p>
<p>When you register the TAP listener, you pass the TAP name as parameters <i>(my_srt), </i>The pointer to the local <i>Srt_stat_table </i>Variable/structure (SS), the current filter (if used; otherwise pass NULL), the function to call when a reset signal is detected by GTK <i>(mysrt_reset), </i>The function to call when a new packet/event is detected <i>(mysrt_packet), </i>And the function to call when GTK performs a refresh <i>(mysrt_draw).</i></p>
<p>At this point, most of the TAP listener applications will initiate a retap/redissect process so that the information will again be passed to the TAP channel. There are two methods available to initiate this process:</p>
<p>Cf_redissect_packets(&amp;cfile); or</p>
<p>Cf_retap_packets(&amp;cfile, FALSE);</p>
<p>The main difference between these two calls is that the <i>Cf_redissect_packets </i>Forces Wireshark to do a complete reload and dissection of the current trace, including recreation of the GUI items, whereas, the <i>Cf_retap_packets </i>Forces Wireshark to reload and rescan the packet data. The <i>Retap </i>Function is preferred, if possible, because it takes less time for Wireshark to complete and is less intensive. However, in cases where dissector information requires a re-dissection process including the GUI items, you</p>
<p>May need to perform the <i>Cf_redissect_packets </i>Instead. Developers should weigh the benefit vs. cost prior to implementing a full re-dissection of the packet trace.</p>
<p>The remaining code for handling conversations, endpoints, or SRT statistics, varies depending on the implementation. In our example, we now need to compose our functions to handle the reset, packet, and draw conditions:</p>
<p>Static void</p>
<p>Mysrtstat_reset(void *pss) {</p>
<p>Mysrtstat_t *ss=(mysrtstat_t *)pss;</p>
<p>/* Call the global SRT function to reset the table data */ reset_srt_table_data(&amp;ss-&gt;my_srt_table);</p>
<p>}</p>
<p>Static int</p>
<p>Mysrtstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv)</p>
<p>{</p>
<p>Mysrtstat_t *ss=(mysrtstat_t *)pss;</p>
<p>Const my_dissectors_tap_data_type *request_val=prv;</p>
<p>/* if we haven't seen the request, just ignore it */ if(!request_val){ return 0;</p>
<p>}</p>
<p>/* Call the global SRT function to add the new packet data */ add_srt_table_data(&amp;ss-&gt;my_srt_table, request_val-&gt;command, &amp;request_val-&gt;req_time, pinfo);</p>
<p>Return 1;</p>
<p>}</p>
<p>Static void</p>
<p>Mysrtstat_draw(void *pss) {</p>
<p>Mysrtstat_t *ss=(mysrtstat_t *)pss;</p>
<p>/* Call the global SRT function to draw the window */ draw_srt_table_data(&amp;ss-&gt;my_srt_table);</p>
<p>}</p>
<p>It is also important to remember to clean up the memory when your application ends. Therefore, we also need to define our cleanup function if the window is just closed by the user:</p>
<p>Void protect_thread_critical_region(void); void unprotect_thread_critical_region(void); static void</p>
<p>Win_destroy_cb(GtkWindow *win _U_, gpointer data) {</p>
<p>Mysrtstat_t *ss=(mysrtstat_t *)data;</p>
<p>Protect_thread_critical_region();</p>
<p>Remove_tap_listener(ss);</p>
<p>Unprotect_thread_critical_region();</p>
<p>}</p>
<p>Free_srt_table_data(&amp;ss-&gt;my_srt_table); g_free(ss);</p>
<p>It is recommended that you utilize one or more of the currently available sources for any new additions. Inside the <i>Gtk </i>Directory are a number of examples for all of the defined types of TAPs. Although our example was for the service response time statistics, the coding for conversations and endpoints are basically the same.</p>
<p>Notes from the Underground...</p>
<p><b>Development Note</b></p>
<p>It is important to note that even though the expert info is a TAP, you do not have to implement any type of utility code to process the expert info as you do with conversations, SRT, and endpoints statistics. As mentioned previously, you modify your dissector to call the expert TAP directly.</p>
]]></content:encoded>
			<wfw:commentRss>http://biglib.net/taps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Wireshark GUI</title>
		<link>http://biglib.net/the-wireshark-gui/</link>
		<comments>http://biglib.net/the-wireshark-gui/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 23:14:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Advanced Topics]]></category>

		<guid isPermaLink="false">http://biglib.net/the-wireshark-gui/</guid>
		<description><![CDATA[The Wireshark GUI is created through calls to the GTK library. When you develop for the Wireshark GUI, you must consider compatibility issues for other builds of Wireshark. This means that you must program for GTK versions 1.2 and 2.x. &#8230; <a href="http://biglib.net/the-wireshark-gui/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Wireshark GUI is created through calls to the GTK library. When you develop for the Wireshark GUI, you must consider compatibility issues for other builds of Wireshark. This means that you must program for GTK versions 1.2 and 2.x. Some GTK functions work in both versions, but others need to be programmed specifically for the version that Wireshark is built with. As a reference, you can use the GTK Web site at <a href="http://www.gtk.org">Www. gtk. org</a> as well as other GUI code located in the <i>Gtk </i>Directory.</p>
<p>The Item Factory</p>
<p>The main menu for Wireshark is created via a GTK item factory. The following information is extracted from the <i>Gtk/menu. c </i>Source file included in the Wireshark source code distribution:</p>
<p>/* This is the GtkItemFactoryEntry structure used to generate new menus.</p>
<p>Item 1: The menu path. The letter after the underscore indicates an accelerator key once the menu is open.</p>
<p>Item 2: The accelerator key for the entry Item 3: The callback function.</p>
<p>Item 4: The callback action. This changes the parameters with which the function is called. The default is 0.</p>
<p>Item 5: The item type, used to define what kind of an item it is. Here are the possible values:</p>
<p>(optional)</p>
<p>NULL</p>
<p>&quot;&lt;Title&gt;&quot; &quot;&lt;Item&gt;&quot; &quot;&lt;ImageItem&gt;&quot; &quot;&lt;StockItem&gt;&quot; &quot;&lt;CheckItem&gt;&quot; &quot;&lt;ToggleItem&gt;&quot; &quot;&lt;RadioItem&gt;&quot; &lt;path&gt;</p>
<p>&quot;&lt;Separator&gt;&quot; &quot;&lt;Tearoff&gt;&quot; &quot;&lt;Branch&gt;&quot;</p>
<p>&quot;&lt;LastBranch&gt;&quot;</p>
<p>-&gt;&nbsp;&quot;&lt;Item&gt;&quot;</p>
<p>-&gt;&nbsp;&quot;&lt;Item&gt;&quot;</p>
<p>-&gt;&nbsp;create a title item</p>
<p>-&gt;&nbsp;create a simple item</p>
<p>-&gt;&nbsp;create an item holding an image (gtk2) -&gt; create an item holding a stock image (gtk2)</p>
<p>-&gt;&nbsp;create a check item</p>
<p>-&gt;&nbsp;create a toggle item</p>
<p>-&gt;&nbsp;create a radio item</p>
<p>-&gt;&nbsp;path of a radio item to link against</p>
<p>-&gt;&nbsp;create a separator</p>
<p>-&gt;&nbsp;create a tearoff separator (gtk2)</p>
<p>-&gt;&nbsp;create an item to hold sub items</p>
<p>-&gt; create a right justified branch</p>
<p>Item 6: extra data needed for ImageItem and StockItem (gtk2)</p>
<p>*/</p>
<p>ITEM_FACTORY_ENTRY(&quot;/Copy&quot;, NULL, copy_selected_plist_cb, 0, NULL, NULL), ITEM_FACTORY_ENTRY(&quot;/&lt;separator&gt;&quot;, NULL, NULL, 0, &quot;&lt;Separator&gt;&quot;, NULL),</p>
<p>ITEM_FACTORY_ENTRY(&quot;/Expand Subtrees&quot;, NULL, expand_tree_cb, 0, NULL, NULL),</p>
<p>ITEM_FACTORY_ENTRY(&quot;/Expand All&quot;, NULL, expand_all_cb, 0, NULL, NULL),</p>
<p>ITEM_FACTORY_ENTRY(&quot;/Collapse All&quot;, NULL, collapse_all_cb, 0, NULL, NULL),</p>
<p>When the item factory option is selected, the function listed in Item 3 is called. In GTK, callback functions are called when an item is selected.</p>
<p>The <i>Set_menu_sensitivity </i>Function enables and disables the availability of menu items based on a specified condition:</p>
<p>/* make parent menu item sensitive only, if we have any valid files in the list */</p>
<p>Set_menu_sensitivity(main_menu_factory, MENU_RECENT_FILES_PATH, cnt);</p>
<p>Generally, you only need to modify the Wireshark menu if you are creating a tool or making a change to some other portion of the GUI.</p>
<p>Using GTK</p>
<p>When an item is selected, GTK passes a handle to the active selection, which are called <i>Widgets.</i></p>
<p>Void</p>
<p>My_widget(GtkWidget *w _U_, gpointer d _U_) {</p>
<p>GtkWidget *main_vb</p>
<p>GtkTooltips *tooltips; #if GTK_MAJOR_VERSION &lt; 2</p>
<p>GtkAccelGroup *accel_group; #endif</p>
<p>Notes from the Underground...</p>
<p><b>Development Note</b></p>
<p>Note the <i>_U_ </i>Value being defined in the <i>My_widget </i>Function. The <i>_U_ </i>Represents an undefined parameter. These values are not used within the function. The process of defining them as <i>_U_ </i>Allows the compiler to not issue a warning on the function due to undefined variables.</p>
<p><b>Function Names</b></p>
<p>It is important to understand that the GTK functions used within the Wireshark GUI code are not always the original GTK function name. Most GTK functions are globally defined within the Wireshark source code include file <i>Gtk/compat_macros. h. </i>It may sometimes be necessary to consult this file prior to looking up specific information on the GTK Web site.</p>
<p>When our menu item is selected, GTK passes the GTK widget pointer and data structure to us. We then create a new GTK widget for our window.</p>
<p>The <i>GtkTooltips </i>Is a structure that allows you to store information about a widget that is displayed when the user places his or her mouse pointer over the GTK item. For example, suppose you have a button on our window that (when clicked) changes the current display filter to one of our choosing. Although the size</p>
<p>Of the button only allows us to label it &quot;Filter,&quot; we can define a tool tip that provides a more detailed description of the button's function.</p>
<p>The <i>GtkAccelGroup </i>Is necessary for GTK version 1.2. It allows for accelerator keys to be used on the keyboard to access menu items:</p>
<p>/* First check to see if the window already exists. If so make it active. */ if (mywindow_w!= NULL) {</p>
<p>/* There's already a &quot;My Window&quot; dialog box; reactivate it. */</p>
<p>Reactivate_window(mywindow_w);</p>
<p>Return;</p>
<p>}</p>
<p>/* Create our new window */</p>
<p>Mywindow = dlg_window_new(&quot;Wireshark: My Window&quot;);</p>
<p>/* Register our callback function to clean up memory if the window is closed */</p>
<p>SIGNAL_CONNECT(mywindow_w, &quot;destroy&quot;, mywindow_destroy_cb, NULL); /* Start the tooltips */ tooltips = gtk_tooltips_new ();</p>
<p>#if GTK_MAJOR_VERSION &lt; 2</p>
<p>/* Accelerator group for the accelerators (or, as they're called in</p>
<p>Windows and, I think, in Motif, &quot;mnemonics&quot;; Alt+&lt;key&gt; is a mnemonic, Ctrl+&lt;key&gt; is an accelerator). */ accel_group = gtk_accel_group_new();</p>
<p>Gtk_window_add_accel_group(GTK_WINDOW(mywindow_w), accel_group); #endif</p>
<p>We first check to make sure the window is not already open. If it is, we reactivate it. If it is not, we create a new dialog window. When creating the new window, you should create a callback handler to take care of the window being closed, by the user clicking the <b>EXIT </b>Button in the upper right-hand corner of the dialog box. The <i>SIGNAL_CONNECT </i>Function tells GTK what to do when the specified signal occurs. In this case, we are trapping for the destroy signal.</p>
<p>Finally, we initialize the <i>Tooltips. </i>Notice that we only perform the accelerator group for GTK versions older then GTK 2.x. Accelerator keys in GTK 2.x are defined when creating the item:</p>
<p>/* Container for each row of widgets */ main_vb = gtk_vbox_new(FALSE, 3);</p>
<p>Gtk_container_border_width(GTK_CONTAINER(main_vb), 5);</p>
<p>Gtk_container_add(GTK_CONTAINER(mywindow_w), main_vb); gtk_widget_show(main_vb);</p>
<p>The first step is to create our main window. Next, we create a box on the new window. The <i>Gtk_vbox_new </i>Creates the new box that we will add to our window. The <i>Gtk_container_border_width </i>Defines the border for our window. The <i>Gtk_container_add </i>Now adds our new box to the main window. Finally, the <i>Gtk_widget_show </i>Forces GTK to paint the information to the screen. The following demonstrates the creation of an <b>OK </b>Button on the <i>Main_vb </i>Window.</p>
<p>/* Button row: OK button */ bbox = gtk_hbutton_box_new();</p>
<p>Gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_END); gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); gtk_container_add(GTK_CONTAINER(main_vb), bbox); gtk_widget_show(bbox);</p>
<p>#if GTK_MAJOR_VERSION &lt; 2</p>
<p>Ok_bt = gtk_button_new_with_label (&quot;OK&quot;); #else</p>
<p>Ok_bt = gtk_button_new_from_stock(GTK_STOCK_OK); #endif</p>
<p>SIGNAL_CONNECT(ok_bt, &quot;clicked&quot;, capture_prep_ok_cb, cap_open_w); GTK_WIDGET_SET_FLAGS(ok_bt, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (bbox), ok_bt, TRUE, TRUE, 0); gtk_widget_grab_default(ok_bt); gtk_widget_show(ok_bt);</p>
<p>The first section of this code creates a new horizontal button box, adds it to the <i>Main_vb </i>Window, and forces GTK to paint the new box.</p>
<p>We then check the GTK version and create the new button depending on the version of GTK. Note that GTK version 2.x allows us to specify the icon used for this button. This is how you create custom icons and incorporate them into Wireshark. We register the callback function for GTK to use when the button is clicked, register the button as the default button, and paint the button on the screen. Note that it is not necessary to force GTK to draw each time the window is updated or a new item is added. You can build your dialog window and then call <i>Gtk_widget_show() </i>To have GTK draw the window and all of it's attached components.</p>
<p>You can also register widget data to a widget so that when it is selected, the data associated to the widget is passed to the calling function (e. g., in the <i>Gtk/find_dlg. c </i>File, a number of defines are set to identify the buttons within the find window):</p>
<p>/* Capture callback data keys */</p>
<p>Next, the keys are registered as data to the dialog with the <i>Object_set_data </i>Function.</p>
<p>OBJECT_SET_DATA(find_frame_w, E_FIND_FILT_KEY, filter_text_box); OBJECT_SET_DATA(find_frame_w, E_FIND_BACKWARD_KEY, backward_rb);</p>
<p>Values of the attached buttons by calling the <i>Object_get_data </i>Function:</p>
<p>Filter_te = (GtkWidget *)OBJECT_GET_DATA(parent_w, E_FIND_FILT_KEY); backward_rb = (GtkWidget *)OBJECT_GET_DATA(parent_w, E_FIND_BACKWARD_KEY);</p>
<p>The GTK Web site contains many examples and a window builder tool that you can download and experiment with. To program in GTK, you must know the static defines for predefined items like <i>GTK_STOCK_XXX </i>And <i>GTK_CAN_DEFAULT.</i></p>
<p><i>Wireshark </i>Implements a TAP system to allow for real-time statistics during packet captures. These can also be used by statistical information tools that register to the TAP interface and command Wireshark to re-dissect a saved packet capture file. Examples of this type of use of the TAP system include conversation lists, endpoints, expert TAP, and so on. The TAP system is documented in the <i>README. tapping </i>Document located in the <i>Doc </i>Directory. Also in the main source code directory you will find a number of <i>Tap-xxx </i>Files that you can use for a reference on the TAP interface. The <i>Gtk/endpoint_talkers_table. c </i>File can be used as an example of how to implement a TAP inside of an included statistics menu option.</p>
<p>The TAP interface is implemented in two steps. The first step is to install the TAP into the protocol dissector you want to get information from. The second step is to add the TAP listener to your new application. Many of the protocol dissectors included in Wireshark already contain TAPs. Most likely you will only need to create your TAP listener and perform the work you need to do. If you find that a TAP is not installed in the protocol you need, adding the TAP is simple through the use of a few lines of code. Refer to the <i>README. tapping </i>For more information.</p>
<p>#define E_FIND_FILT_KEY #define E_FIND_BACKWARD_KEY</p>
<p>&quot;find_filter_te&quot; &quot;find_backward&quot;</p>
<p>Finally, when the <i>Find_frame_w </i>Is selected, the callback function can access the</p>
]]></content:encoded>
			<wfw:commentRss>http://biglib.net/the-wireshark-gui/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.059 seconds -->
