<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:og="http://ogp.me/ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/tshark">
  <channel>
    <title>tshark</title>
    <link>https://www.linuxjournal.com/tag/tshark</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Using tshark to Watch and Inspect Network Traffic</title>
  <link>https://www.linuxjournal.com/content/using-tshark-watch-and-inspect-network-traffic</link>
  <description>  &lt;div data-history-node-id="1338809" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/120px-Python-logo-notext_0_0_0.png" width="100" height="100" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/mihalis-tsoukalos" lang="" about="https://www.linuxjournal.com/users/mihalis-tsoukalos" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Mihalis Tsoukalos&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
Most of you probably have heard of Wireshark, a very popular and capable
network protocol analyzer. What you may not know is that there exists a
console version of Wireshark called tshark. The two main advantages of
tshark are that it can be used in scripts and on a remote computer through
an SSH connection. Its main disadvantage is that it does not have a GUI,
which can be really handy when you have to search lots of network data.
&lt;/p&gt;
&lt;p&gt;
You can get tshark either from its Web site and compile it yourself or
from your Linux distribution as a precompiled package. The second way
is quicker and simpler. To install tshark on a Debian 7 system,
you just have to run the following command as root:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
# apt-get install tshark
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libc-ares2 libcap2-bin libpam-cap libsmi2ldbl 
  libwireshark-data libwireshark2
  libwiretap2 libwsutil2 wireshark-common
Suggested packages:
  libcap-dev snmp-mibs-downloader wireshark-doc
The following NEW packages will be installed:
  libc-ares2 libcap2-bin libpam-cap libsmi2ldbl 
  libwireshark-data libwireshark2
  libwiretap2 libwsutil2 tshark wireshark-common
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.6 MB of archives.
After this operation, 65.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
...
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;
To find out whether tshark is installed properly, as well as its version, 
execute this command:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
$ tshark -v
TShark 1.8.2
...
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;
Note: this article assumes that you already are familiar with
network data, TCP/IP, packet capturing and maybe Wireshark, and that you
want to know more about tshark.
&lt;/p&gt;

&lt;h3&gt;
About tshark&lt;/h3&gt;

&lt;p&gt;
tshark can do anything Wireshark can do, provided that it does not require
a GUI. It also can be used as a replacement for tcpdump, which used
to be the industry standard for network data capturing. Apart from the
capturing part, where both tools are equivalent, tshark is more powerful
than tcpdump; therefore, if you want to learn just one tool, tshark
should be your choice.
&lt;/p&gt;

&lt;p&gt;
As you can imagine, tshark has many command-line options. Refer
to its man page for the full list.
&lt;/p&gt;


&lt;h3&gt;
Capturing Network Traffic Using tshark&lt;/h3&gt;

&lt;p&gt;
The first command you should run is &lt;code&gt;sudo tshark -D&lt;/code&gt; to get a list
of the available network interfaces:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
$ sudo tshark -D
1. eth0
2. nflog (Linux netfilter log (NFLOG) interface)
3. any (Pseudo-device that captures on all interfaces)
4. lo
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;
If you run tshark as a normal user, you most likely will get the
following output, because normal users do not have direct access to
network interface devices:

&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/using-tshark-watch-and-inspect-network-traffic" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Mon, 31 Aug 2015 18:53:06 +0000</pubDate>
    <dc:creator>Mihalis Tsoukalos</dc:creator>
    <guid isPermaLink="false">1338809 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
