2021-10-19 23:26:37 +00:00
|
|
|
include::../docbook/attributes.adoc[]
|
2021-06-18 10:20:51 +00:00
|
|
|
= tshark(1)
|
|
|
|
:doctype: manpage
|
|
|
|
:stylesheet: ws.css
|
|
|
|
:linkcss:
|
|
|
|
:copycss: ../docbook/{stylesheet}
|
2018-08-17 18:34:57 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
== NAME
|
2000-01-14 06:46:00 +00:00
|
|
|
|
2006-05-31 17:38:42 +00:00
|
|
|
tshark - Dump and analyze network traffic
|
2000-01-14 06:46:00 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
== SYNOPSIS
|
2000-01-14 06:46:00 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
[manarg]
|
|
|
|
*tshark*
|
|
|
|
[ *-i* <capture interface>|- ]
|
|
|
|
[ *-f* <capture filter> ]
|
|
|
|
[ *-2* ]
|
|
|
|
[ *-r* <infile> ]
|
|
|
|
[ *-w* <outfile>|- ]
|
|
|
|
[ *options* ]
|
|
|
|
[ <filter> ]
|
2000-01-14 06:46:00 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
[manarg]
|
|
|
|
*tshark*
|
|
|
|
*-G* [ <report type> ] [ --elastic-mapping-filter <protocols> ]
|
2010-06-18 17:18:00 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
== DESCRIPTION
|
2000-01-14 06:46:00 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*TShark* is a network protocol analyzer. It lets you capture packet
|
2000-01-22 07:19:34 +00:00
|
|
|
data from a live network, or read packets from a previously saved
|
|
|
|
capture file, either printing a decoded form of those packets to the
|
2021-06-18 10:20:51 +00:00
|
|
|
standard output or writing the packets to a file. *TShark*'s native
|
|
|
|
capture file format is *pcapng* format, which is also the format used
|
2021-10-09 17:04:42 +00:00
|
|
|
by *Wireshark* and various other tools.
|
2004-04-25 09:02:04 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
Without any options set, *TShark* will work much like *tcpdump*. It
|
2018-02-19 17:41:09 +00:00
|
|
|
will use the pcap library to capture traffic from the first available
|
|
|
|
network interface and displays a summary line on the standard output for
|
|
|
|
each received packet.
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
When run with the *-r* option, specifying a capture file from which to
|
|
|
|
read, *TShark* will again work much like *tcpdump*, reading packets
|
2018-02-19 17:41:09 +00:00
|
|
|
from the file and displaying a summary line on the standard output for
|
2021-06-18 10:20:51 +00:00
|
|
|
each packet read. *TShark* is able to detect, read and write the same
|
|
|
|
capture files that are supported by *Wireshark*. The input file
|
2018-02-19 17:41:09 +00:00
|
|
|
doesn't need a specific filename extension; the file format and an
|
2021-08-19 12:48:52 +00:00
|
|
|
optional gzip, zstd or lz4 compression will be automatically detected. Near the
|
2021-06-18 10:20:51 +00:00
|
|
|
beginning of the DESCRIPTION section of xref:wireshark.html[wireshark](1) or
|
|
|
|
https://www.wireshark.org/docs/man-pages/wireshark.html is a detailed
|
|
|
|
description of the way *Wireshark* handles this, which is the same way
|
2021-10-09 17:04:42 +00:00
|
|
|
*TShark* handles this.
|
2018-02-19 17:41:09 +00:00
|
|
|
|
2018-09-13 15:40:27 +00:00
|
|
|
Compressed file support uses (and therefore requires) the zlib library.
|
2021-06-18 10:20:51 +00:00
|
|
|
If the zlib library is not present when compiling *TShark*, it will be
|
2018-02-19 17:41:09 +00:00
|
|
|
possible to compile it, but the resulting program will be unable to read
|
|
|
|
compressed files.
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
When displaying packets on the standard output, *TShark* writes, by
|
2000-11-06 09:28:43 +00:00
|
|
|
default, a summary line containing the fields specified by the
|
|
|
|
preferences file (which are also the fields displayed in the packet list
|
2021-06-18 10:20:51 +00:00
|
|
|
pane in *Wireshark*), although if it's writing packets as it captures
|
2009-05-02 06:44:13 +00:00
|
|
|
them, rather than writing packets from a saved capture file, it won't
|
2021-06-18 10:20:51 +00:00
|
|
|
show the "frame number" field. If the *-V* option is specified, it
|
2018-02-19 17:41:09 +00:00
|
|
|
instead writes a view of the details of the packet, showing all the
|
2021-06-18 10:20:51 +00:00
|
|
|
fields of all protocols in the packet. If the *-O* option is
|
2018-02-19 17:41:09 +00:00
|
|
|
specified, it will only show the full details for the protocols
|
|
|
|
specified, and show only the top-level detail line for all other
|
2021-06-18 10:20:51 +00:00
|
|
|
protocols. Use the output of "*tshark -G protocols*" to find the
|
|
|
|
abbreviations of the protocols you can specify. If the *-P* option is
|
|
|
|
specified with either the *-V* or *-O* options, both the summary line
|
2018-02-19 17:41:09 +00:00
|
|
|
for the entire packet and the details will be displayed.
|
|
|
|
|
|
|
|
Packet capturing is performed with the pcap library. That library
|
|
|
|
supports specifying a filter expression; packets that don't match that
|
2021-06-18 10:20:51 +00:00
|
|
|
filter are discarded. The *-f* option is used to specify a capture
|
2018-02-19 17:41:09 +00:00
|
|
|
filter. The syntax of a capture filter is defined by the pcap library;
|
2022-02-01 03:41:01 +00:00
|
|
|
this syntax is different from the display filter syntax described below,
|
2018-02-19 17:41:09 +00:00
|
|
|
and the filtering mechanism is limited in its abilities.
|
|
|
|
|
2022-02-01 03:41:01 +00:00
|
|
|
Display filters in *TShark*, which allow you to select which packets are
|
2018-02-19 17:41:09 +00:00
|
|
|
to be decoded or written to a file, are very powerful; more fields are
|
2021-06-18 10:20:51 +00:00
|
|
|
filterable in *TShark* than in other protocol analyzers, and the syntax
|
|
|
|
you can use to create your filters is richer. As *TShark* progresses,
|
2022-02-01 03:41:01 +00:00
|
|
|
expect more and more protocol fields to be allowed in display filters.
|
|
|
|
Display filters use the same syntax as display and color filters in
|
|
|
|
*Wireshark*; a display filter is specified with the *-Y* option.
|
2018-02-19 17:41:09 +00:00
|
|
|
|
2022-02-01 03:41:01 +00:00
|
|
|
Display filters can be specified when capturing or when reading from a
|
2021-12-20 02:40:23 +00:00
|
|
|
capture file. Note that capture filters are much more efficient
|
2022-02-01 03:41:01 +00:00
|
|
|
than display filters, and it may be more difficult for *TShark* to keep up
|
|
|
|
with a busy network if a display filter is specified for a live capture, so
|
|
|
|
you might be more likely to lose packets if you're using a display filter.
|
2018-02-19 17:41:09 +00:00
|
|
|
|
2022-02-01 03:41:01 +00:00
|
|
|
A capture or display filter can either be specified with the *-f* or *-Y*
|
2018-02-19 17:41:09 +00:00
|
|
|
option, respectively, in which case the entire filter expression must be
|
|
|
|
specified as a single argument (which means that if it contains spaces,
|
|
|
|
it must be quoted), or can be specified with command-line arguments
|
|
|
|
after the option arguments, in which case all the arguments after the
|
|
|
|
filter arguments are treated as a filter expression. If the filter is
|
|
|
|
specified with command-line arguments after the option arguments, it's a
|
2021-06-18 10:20:51 +00:00
|
|
|
capture filter if a capture is being done (i.e., if no *-r* option was
|
2022-02-01 03:41:01 +00:00
|
|
|
specified) and a display filter if a capture file is being read (i.e., if a
|
2021-06-18 10:20:51 +00:00
|
|
|
*-r* option was specified).
|
2018-02-19 17:41:09 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
If the *-w* option is specified when capturing packets or reading from
|
|
|
|
a capture file, *TShark* does not display packets on the standard
|
2018-02-19 17:41:09 +00:00
|
|
|
output. Instead, it writes the packets to a capture file with the name
|
2022-02-01 03:41:01 +00:00
|
|
|
specified by the *-w* option. Note that display filters are currently
|
|
|
|
not supported when capturing and saving the captured packets.
|
2000-01-22 07:19:34 +00:00
|
|
|
|
2005-12-09 02:59:36 +00:00
|
|
|
If you want to write the decoded form of packets to a file, run
|
2021-06-18 10:20:51 +00:00
|
|
|
*TShark* without the *-w* option, and redirect its standard output to
|
|
|
|
the file (do __not__ use the *-w* option).
|
2005-12-09 02:59:36 +00:00
|
|
|
|
2018-02-19 17:41:09 +00:00
|
|
|
If you want the packets to be displayed to the standard output and also
|
2021-06-18 10:20:51 +00:00
|
|
|
saved to a file, specify the *-P* option in addition to the *-w*
|
|
|
|
option to have the summary line displayed, specify the *-V* option
|
|
|
|
in addition to the *-w* option to have the details of the packet
|
|
|
|
displayed, and specify the *-O* option, with a list of protocols, to
|
2018-02-19 17:41:09 +00:00
|
|
|
have the full details of the specified protocols and the top-level
|
2021-06-18 10:20:51 +00:00
|
|
|
detail line for all other protocols to be displayed. If the *-P*
|
|
|
|
option is used together with the *-V* or *-O* option, the summary line
|
2018-02-19 17:41:09 +00:00
|
|
|
will be displayed along with the detail lines.
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
When writing packets to a file, *TShark*, by default, writes the file
|
|
|
|
in *pcapng* format, and writes all of the packets it sees to the output
|
|
|
|
file. The *-F* option can be used to specify the format in which to
|
2018-02-19 17:41:09 +00:00
|
|
|
write the file. This list of available file formats is displayed by the
|
2021-06-18 10:20:51 +00:00
|
|
|
*-F* option without a value. However, you can't specify a file format
|
2007-09-25 21:38:54 +00:00
|
|
|
for a live capture.
|
2003-05-17 17:05:12 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
When capturing packets, *TShark* writes to the standard error an
|
2018-02-19 17:41:09 +00:00
|
|
|
initial line listing the interfaces from which packets are being
|
|
|
|
captured and, if packet information isn't being displayed to the
|
|
|
|
terminal, writes a continuous count of packets captured to the standard
|
2021-06-18 10:20:51 +00:00
|
|
|
output. If the *-q* option is specified, neither the continuous count
|
2018-02-19 17:41:09 +00:00
|
|
|
nor the packet information will be displayed; instead, at the end of the
|
2021-06-18 10:20:51 +00:00
|
|
|
capture, a count of packets captured will be displayed. If the *-Q*
|
2018-02-19 17:41:09 +00:00
|
|
|
option is specified, neither the initial line, nor the packet
|
2021-06-18 10:20:51 +00:00
|
|
|
information, nor any packet counts will be displayed. If the *-q* or
|
|
|
|
*-Q* option is used, the *-P*, *-V*, or *-O* option can be used to
|
2018-02-19 17:41:09 +00:00
|
|
|
cause the corresponding output to be displayed even though other output
|
|
|
|
is suppressed.
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
When reading packets, the *-q* and *-Q* option will suppress the
|
|
|
|
display of the packet summary or details; this would be used if *-z*
|
2018-02-19 17:41:09 +00:00
|
|
|
options are specified in order to display statistics, so that only the
|
|
|
|
statistics, not the packet information, is displayed.
|
2000-02-22 07:07:55 +00:00
|
|
|
|
2021-10-09 17:04:42 +00:00
|
|
|
The *-G* option is a special mode that simply causes *TShark*
|
2010-06-18 17:18:00 +00:00
|
|
|
to dump one of several types of internal glossaries and then exit.
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
== OPTIONS
|
2011-09-27 18:32:59 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-2::
|
|
|
|
+
|
|
|
|
--
|
2021-10-09 17:04:42 +00:00
|
|
|
Perform a two-pass analysis. This causes *TShark* to buffer output until the
|
2013-03-30 15:38:03 +00:00
|
|
|
entire first pass is done, but allows it to fill in fields that require future
|
|
|
|
knowledge, such as 'response in frame #' fields. Also permits reassembly
|
|
|
|
frame dependencies to be calculated correctly.
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2011-09-27 18:32:59 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-a|--autostop <capture autostop condition>::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Specify a criterion that specifies when *TShark* is to stop writing
|
|
|
|
to a capture file. The criterion is of the form __test:value__,
|
|
|
|
where __test__ is one of:
|
2001-12-04 07:32:05 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*duration*:__value__ Stop writing to a capture file after __value__ seconds
|
2018-10-31 10:34:35 +00:00
|
|
|
have elapsed. Floating point values (e.g. 0.5) are allowed.
|
2001-12-04 07:32:05 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*files*:__value__ Stop writing to capture files after __value__ number of files
|
2018-10-31 09:03:04 +00:00
|
|
|
were written.
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*filesize*:__value__ Stop writing to a capture file after it reaches a size of
|
|
|
|
__value__ kB. If this option is used together with the -b option, *TShark*
|
2013-08-29 18:15:13 +00:00
|
|
|
will stop writing to the current capture file and switch to the next one if
|
2021-06-18 10:20:51 +00:00
|
|
|
filesize is reached. When reading a capture file, *TShark* will stop reading
|
2013-08-29 18:15:13 +00:00
|
|
|
the file after the number of bytes read exceeds this number (the complete
|
|
|
|
packet will be read, so more bytes than this number may be read). Note that
|
|
|
|
the filesize is limited to a maximum value of 2 GiB.
|
2001-12-04 07:32:05 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*packets*:__value__ switch to the next file after it contains __value__
|
2022-02-11 01:54:53 +00:00
|
|
|
packets.
|
|
|
|
This does not include any packets that do not pass the display filter, so it
|
|
|
|
may differ from *-c*<capture packet count>.
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2001-12-04 07:32:05 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-A <user>:<password>::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Specify a user and a password when *TShark* captures from a rpcap:// interface
|
2021-04-09 20:37:35 +00:00
|
|
|
where authentication is required.
|
|
|
|
|
|
|
|
This option is available with libpcap with enabled remote support.
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2021-04-09 20:37:35 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-b|--ring-buffer <capture ring buffer option>::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Cause *TShark* to run in "multiple files" mode. In "multiple files" mode,
|
|
|
|
*TShark* will write to several capture files. When the first capture file
|
|
|
|
fills up, *TShark* will switch writing to the next file and so on.
|
2001-12-04 07:32:05 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
The created filenames are based on the filename given with the *-w* option,
|
2010-03-19 19:34:16 +00:00
|
|
|
the number of the file and on the creation date and time,
|
2023-01-01 16:47:05 +00:00
|
|
|
e.g. outfile_00001_20230714120117.pcap, outfile_00002_20230714120523.pcap, ...
|
2001-12-04 07:32:05 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
With the __files__ option it's also possible to form a "ring buffer".
|
2009-10-20 20:14:23 +00:00
|
|
|
This will fill up new files until the number of files specified,
|
2021-06-18 10:20:51 +00:00
|
|
|
at which point *TShark* will discard the data in the first file and start
|
|
|
|
writing to that file and so on. If the __files__ option is not set,
|
2009-10-20 20:14:23 +00:00
|
|
|
new files filled up until one of the capture stop conditions match (or
|
2010-03-19 19:34:16 +00:00
|
|
|
until the disk is full).
|
2001-12-04 07:32:05 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
The criterion is of the form __key:value__,
|
|
|
|
where __key__ is one of:
|
2001-12-04 09:56:10 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*duration*:__value__ switch to the next file after __value__ seconds have
|
2018-10-31 10:34:35 +00:00
|
|
|
elapsed, even if the current file is not completely filled up. Floating
|
|
|
|
point values (e.g. 0.5) are allowed.
|
2001-12-04 09:56:10 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*files*:__value__ begin again with the first file after __value__ number of
|
2010-05-27 19:11:53 +00:00
|
|
|
files were written (form a ring buffer). This value must be less than 100000.
|
|
|
|
Caution should be used when using large numbers of files: some filesystems do
|
2021-06-18 10:20:51 +00:00
|
|
|
not handle many files in a single directory well. The *files* criterion
|
|
|
|
requires either *duration*, *interval* or *filesize* to be specified to
|
|
|
|
control when to go to the next file. It should be noted that each *-b*
|
2017-06-27 20:04:33 +00:00
|
|
|
parameter takes exactly one criterion; to specify two criterion, each must be
|
2021-06-18 10:20:51 +00:00
|
|
|
preceded by the *-b* option.
|
2010-05-27 19:11:53 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*filesize*:__value__ switch to the next file after it reaches a size of
|
|
|
|
__value__ kB. Note that the filesize is limited to a maximum value of 2 GiB.
|
2018-10-31 09:03:04 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*interval*:__value__ switch to the next file when the time is an exact
|
|
|
|
multiple of __value__ seconds. For example, use 3600 to switch to a new file
|
2019-03-22 18:49:41 +00:00
|
|
|
every hour on the hour.
|
2018-10-31 09:03:04 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*packets*:__value__ switch to the next file after it contains __value__
|
2018-10-31 09:03:04 +00:00
|
|
|
packets.
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*nametimenum*:__value__ Choose between two save filename templates. If
|
|
|
|
__value__ is 1, make running file number part before start time part; this is
|
2023-01-01 16:47:05 +00:00
|
|
|
the original and default behaviour (e.g. log_00001_20230714164426.pcap). If
|
2021-06-18 10:20:51 +00:00
|
|
|
__value__ is greater than 1, make start time part before running number part
|
2021-10-13 09:22:23 +00:00
|
|
|
(e.g. log_20210828164426_00001.pcap). The latter makes alphabetical sorting
|
2021-08-23 16:42:04 +00:00
|
|
|
order equal to creation time order, and keeps related multiple file sets in
|
|
|
|
same directory close to each other.
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
Example: *tshark -b filesize:1000 -b files:5* results in a ring buffer of five
|
2019-11-29 21:10:31 +00:00
|
|
|
files of size one megabyte each.
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2002-01-29 05:38:56 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-B|--buffer-size <capture buffer size>::
|
|
|
|
+
|
|
|
|
--
|
2013-12-02 19:17:12 +00:00
|
|
|
Set capture buffer size (in MiB, default is 2 MiB). This is used by
|
2010-05-08 00:39:07 +00:00
|
|
|
the capture driver to buffer packet data until that data can be written
|
|
|
|
to disk. If you encounter packet drops while capturing, try to increase
|
2021-10-09 17:04:42 +00:00
|
|
|
this size. Note that, while *TShark* attempts to set the buffer size
|
2013-12-02 19:17:12 +00:00
|
|
|
to 2 MiB by default, and can be told to set it to a larger value, the
|
2010-05-08 00:39:07 +00:00
|
|
|
system or interface on which you're capturing might silently limit the
|
|
|
|
capture buffer size to a lower value or raise it to a higher value.
|
2010-05-07 02:00:46 +00:00
|
|
|
|
Clean up some man pages.
Consistently speak of "UNIX-compatible systems" when comparing UN*Xes
and Windows, and, the first time we mention "UNIX-compatible systems" in
a section or a list item, enumerate the not-dead-or-moribund ones.
(HP-UX is deemed moribund given that Itanium processors are no longer
being manufactured and HPE are apparently not porting HP-UX to x86-64,
choosing instead to run HP-UX Itanium applications in a compatibility
environment under Linux on x86-64.)
For the -D option, don't bother mentioning ifconfig -a or ip link show,
as there's no reason not to use -D if you want to know what you can
caputre on - for one thing, -D may list devices *other* than the network
interfaces listed by ifconfig -a or ip link show. In addition, don't
speak of code testing whether the interface can be opened, as recent
versions of libpcap don't check that, and neither do any of the programs
in the Wireshark release. (This was done so that, if there's an
itnerface that shows up in the enumeration but that can't be opened,
it'll be offered to the user, and they'll get a message if they try to
capture on it, indicating either that they need to somehow get the
necessary permissions or should report a bug.)
For the -i option, don't mention ifconfig -a or ip link show, as the
user should, again, use -D.
Give more detail when describing files and directories under the global
or personal preferences directory, calling out macOS specially for the
global preferences directory, as it's in the app bundle, and taking into
account that Wireshark might be installed under /usr rather than
/usr/local (for example, if it's installed from a package that's part of
a Linux distribution).
Replace the "Overrides XXX' description of some environment variables
with a more verbose description similar to what's used for other
environment variables.
2023-01-27 06:55:49 +00:00
|
|
|
This is available on UNIX-compatible systems, such as Linux, macOS,
|
|
|
|
\*BSD, Solaris, and AIX, with libpcap 1.0.0 or later, and on Windows.
|
|
|
|
It is not available on UNIX-compatible systems with earlier versions of
|
2010-05-07 02:00:46 +00:00
|
|
|
libpcap.
|
2005-11-18 06:12:17 +00:00
|
|
|
|
2011-09-23 02:00:50 +00:00
|
|
|
This option can occur multiple times. If used before the first
|
2021-06-18 10:20:51 +00:00
|
|
|
occurrence of the *-i* option, it sets the default capture buffer size.
|
|
|
|
If used after an *-i* option, it sets the capture buffer size for
|
|
|
|
the interface specified by the last *-i* option occurring before
|
2011-09-23 02:00:50 +00:00
|
|
|
this option. If the capture buffer size is not set specifically,
|
2013-12-02 19:17:12 +00:00
|
|
|
the default capture buffer size is used instead.
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2011-06-28 22:02:43 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-c <capture packet count>::
|
|
|
|
+
|
|
|
|
--
|
2005-06-04 01:29:14 +00:00
|
|
|
Set the maximum number of packets to read when capturing live
|
2022-02-11 01:54:53 +00:00
|
|
|
data.
|
2018-10-31 09:03:04 +00:00
|
|
|
If reading a capture file, set the maximum number of packets to read.
|
2022-02-11 01:54:53 +00:00
|
|
|
This includes any packets that do not pass the display filter, so it
|
|
|
|
may differ from *-a packets:*<capture packet count>.
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2000-01-14 06:46:00 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-C <configuration profile>::
|
|
|
|
+
|
|
|
|
--
|
2008-01-21 22:46:43 +00:00
|
|
|
Run with the given configuration profile.
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2008-01-21 22:46:43 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-d <layer type>==<selector>,<decode-as protocol>::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Like Wireshark's *Decode As...* feature, this lets you specify how a
|
2011-09-23 02:00:50 +00:00
|
|
|
layer type should be dissected. If the layer type in question (for example,
|
2021-06-18 10:20:51 +00:00
|
|
|
*tcp.port* or *udp.port* for a TCP or UDP port number) has the specified
|
2008-12-18 23:25:50 +00:00
|
|
|
selector value, packets should be dissected as the specified protocol.
|
2003-06-05 04:47:58 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
Example: *tshark -d tcp.port==8888,http* will decode any traffic running over
|
2003-10-03 04:41:21 +00:00
|
|
|
TCP port 8888 as HTTP.
|
2003-10-02 19:22:39 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
Example: *tshark -d tcp.port==8888:3,http* will decode any traffic running over
|
2012-10-23 00:58:38 +00:00
|
|
|
TCP ports 8888, 8889 or 8890 as HTTP.
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
Example: *tshark -d tcp.port==8888-8890,http* will decode any traffic running
|
2019-11-29 21:10:31 +00:00
|
|
|
over TCP ports 8888, 8889 or 8890 as HTTP.
|
2012-10-23 00:58:38 +00:00
|
|
|
|
2008-12-18 23:25:50 +00:00
|
|
|
Using an invalid selector or protocol will print out a list of valid selectors
|
|
|
|
and protocol names, respectively.
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
Example: *tshark -d .* is a quick way to get a list of valid selectors.
|
2008-12-18 23:25:50 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
Example: *tshark -d ethertype==0x0800.* is a quick way to get a list of
|
2019-11-29 21:10:31 +00:00
|
|
|
protocols that can be selected with an ethertype.
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2008-12-18 23:25:50 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-D|--list-interfaces::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Print a list of the interfaces on which *TShark* can capture, and
|
Clean up some man pages.
Consistently speak of "UNIX-compatible systems" when comparing UN*Xes
and Windows, and, the first time we mention "UNIX-compatible systems" in
a section or a list item, enumerate the not-dead-or-moribund ones.
(HP-UX is deemed moribund given that Itanium processors are no longer
being manufactured and HPE are apparently not porting HP-UX to x86-64,
choosing instead to run HP-UX Itanium applications in a compatibility
environment under Linux on x86-64.)
For the -D option, don't bother mentioning ifconfig -a or ip link show,
as there's no reason not to use -D if you want to know what you can
caputre on - for one thing, -D may list devices *other* than the network
interfaces listed by ifconfig -a or ip link show. In addition, don't
speak of code testing whether the interface can be opened, as recent
versions of libpcap don't check that, and neither do any of the programs
in the Wireshark release. (This was done so that, if there's an
itnerface that shows up in the enumeration but that can't be opened,
it'll be offered to the user, and they'll get a message if they try to
capture on it, indicating either that they need to somehow get the
necessary permissions or should report a bug.)
For the -i option, don't mention ifconfig -a or ip link show, as the
user should, again, use -D.
Give more detail when describing files and directories under the global
or personal preferences directory, calling out macOS specially for the
global preferences directory, as it's in the app bundle, and taking into
account that Wireshark might be installed under /usr rather than
/usr/local (for example, if it's installed from a package that's part of
a Linux distribution).
Replace the "Overrides XXX' description of some environment variables
with a more verbose description similar to what's used for other
environment variables.
2023-01-27 06:55:49 +00:00
|
|
|
exit. For each network interface, a number and an interface name,
|
|
|
|
possibly followed by a text description of the interface, is printed.
|
|
|
|
The interface name or the number can be supplied to the *-i* flag to
|
|
|
|
specify an interface on which to capture. The number can be useful on
|
|
|
|
Windows systems, where the interfaces have long names that usually
|
|
|
|
contain a GUID.
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2001-03-27 06:16:11 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-e <field>::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Add a field to the list of fields to display if *-T ek|fields|json|pdml*
|
2016-06-28 11:01:25 +00:00
|
|
|
is selected. This option can be used multiple times on the command line.
|
2021-06-18 10:20:51 +00:00
|
|
|
At least one field must be provided if the *-T fields* option is
|
2013-10-09 19:43:02 +00:00
|
|
|
selected. Column names may be used prefixed with "_ws.col."
|
2007-03-26 20:17:05 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
Example: *tshark -e frame.number -e ip.addr -e udp -e _ws.col.Info*
|
2007-03-26 20:17:05 +00:00
|
|
|
|
2022-04-07 17:41:06 +00:00
|
|
|
Fields are separated by tab characters by default. *-E* controls the
|
|
|
|
format of the printed fields.
|
|
|
|
Giving a protocol rather than a single field will print the protocol summary
|
|
|
|
(subtree label) from the packet details as a single field.
|
|
|
|
If the protocol summary contains only the protocol name
|
|
|
|
(e.g. "Hypertext Transfer Protocol") then the protocol filter name ("http")
|
|
|
|
will be printed.
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2007-03-26 20:17:05 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-E <field print option>::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Set an option controlling the printing of fields when *-T fields* is
|
2007-05-29 06:20:03 +00:00
|
|
|
selected.
|
2007-03-26 20:17:05 +00:00
|
|
|
|
|
|
|
Options are:
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*bom=y|n* If *y*, prepend output with the UTF-8 byte order mark
|
|
|
|
(hexadecimal ef, bb, bf). Defaults to *n*.
|
2016-05-09 20:35:36 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*header=y|n* If *y*, print a list of the field names given using *-e*
|
2007-05-29 06:20:03 +00:00
|
|
|
as the first line of the output; the field name will be separated using
|
2021-06-18 10:20:51 +00:00
|
|
|
the same character as the field values. Defaults to *n*.
|
2007-03-26 20:17:05 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*separator=/t|/s|*<character> Set the separator character to
|
|
|
|
use for fields. If */t* tab will be used (this is the default), if
|
|
|
|
*/s*, a single space will be used. Otherwise any character that can be
|
2007-05-29 06:20:03 +00:00
|
|
|
accepted by the command line as part of the option may be used.
|
2007-03-26 20:17:05 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*occurrence=f|l|a* Select which occurrence to use for fields that have
|
|
|
|
multiple occurrences. If *f* the first occurrence will be used, if *l*
|
|
|
|
the last occurrence will be used and if *a* all occurrences will be used
|
2010-07-14 21:53:57 +00:00
|
|
|
(this is the default).
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*aggregator=,|/s|*<character> Set the aggregator character to
|
|
|
|
use for fields that have multiple occurrences. If *,* a comma will be used
|
|
|
|
(this is the default), if */s*, a single space will be used. Otherwise
|
2010-07-14 20:28:34 +00:00
|
|
|
any character that can be accepted by the command line as part of the
|
|
|
|
option may be used.
|
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*quote=d|s|n* Set the quote character to use to surround fields. *d*
|
|
|
|
uses double-quotes, *s* single-quotes, *n* no quotes (the default).
|
|
|
|
--
|
2000-01-14 06:46:00 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-f <capture filter>::
|
|
|
|
+
|
|
|
|
--
|
2002-03-22 23:42:27 +00:00
|
|
|
Set the capture filter expression.
|
2000-01-14 06:46:00 +00:00
|
|
|
|
2011-09-23 02:00:50 +00:00
|
|
|
This option can occur multiple times. If used before the first
|
2021-06-18 10:20:51 +00:00
|
|
|
occurrence of the *-i* option, it sets the default capture filter expression.
|
|
|
|
If used after an *-i* option, it sets the capture filter expression for
|
|
|
|
the interface specified by the last *-i* option occurring before
|
2011-09-23 02:00:50 +00:00
|
|
|
this option. If the capture filter expression is not set specifically,
|
2011-06-28 22:02:43 +00:00
|
|
|
the default capture filter expression is used if provided.
|
|
|
|
|
2019-11-29 21:10:31 +00:00
|
|
|
Pre-defined capture filter names, as shown in the GUI menu item Capture->Capture
|
|
|
|
Filters, can be used by prefixing the argument with "predef:".
|
2021-06-18 10:20:51 +00:00
|
|
|
Example: *tshark -f "predef:MyPredefinedHostOnlyFilter"*
|
|
|
|
--
|
|
|
|
|
|
|
|
-F <file format>::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Set the file format of the output capture file written using the *-w*
|
|
|
|
option. The output written with the *-w* option is raw packet data, not
|
|
|
|
text, so there is no *-F* option to request text output. The option *-F*
|
2007-09-25 21:38:54 +00:00
|
|
|
without a value will list the available formats.
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2000-01-17 08:06:42 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-g::
|
|
|
|
+
|
|
|
|
--
|
2012-12-12 02:07:08 +00:00
|
|
|
This option causes the output file(s) to be created with group-read permission
|
|
|
|
(meaning that the output file(s) can be read by other members of the calling
|
|
|
|
user's group).
|
2021-06-18 10:20:51 +00:00
|
|
|
--
|
2012-12-12 02:07:08 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
-G [ <report type> ]::
|
|
|
|
+
|
|
|
|
--
|
2021-10-09 17:04:42 +00:00
|
|
|
The *-G* option will cause *TShark* to dump one of several types of glossaries
|
2021-06-18 10:20:51 +00:00
|
|
|
and then exit. If no specific glossary type is specified, then the *fields*
|
2019-11-29 21:10:31 +00:00
|
|
|
report will be generated by default.
|
2021-06-18 10:20:51 +00:00
|
|
|
Using the report type of *help* lists all the current report types.
|
2010-06-18 17:18:00 +00:00
|
|
|
|
|
|
|
The available report types include:
|
|
|
|
|
2021-10-09 17:04:42 +00:00
|
|
|
*column-formats* Dumps the column formats understood by *TShark*.
|
2013-10-15 18:27:35 +00:00
|
|
|
There is one record per line. The fields are tab-delimited.
|
|
|
|
|
2021-10-01 02:39:09 +00:00
|
|
|
[horizontal]
|
|
|
|
Field 1:: format string (e.g. "%rD")
|
|
|
|
Field 2:: text description of format string (e.g. "Dest port (resolved)")
|
2013-10-15 18:27:35 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*currentprefs* Dumps a copy of the current preferences file to stdout.
|
2013-10-15 18:27:35 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*decodes* Dumps the "layer type"/"decode as" associations to stdout.
|
2013-10-15 18:27:35 +00:00
|
|
|
There is one record per line. The fields are tab-delimited.
|
|
|
|
|
2021-10-01 02:39:09 +00:00
|
|
|
[horizontal]
|
|
|
|
Field 1:: layer type, e.g. "tcp.port"
|
|
|
|
Field 2:: selector in decimal
|
|
|
|
Field 3:: "decode as" name, e.g. "http"
|
2013-10-15 18:27:35 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*defaultprefs* Dumps a default preferences file to stdout.
|
2013-10-15 18:27:35 +00:00
|
|
|
|
2021-06-18 10:20:51 +00:00
|
|
|
*dissector-tables* Dumps a list of dissector tables to stdout. There
|
2014-11-17 02:25:56 +00:00
|
|
|
is one record per line. The fields are tab-delimited.
|
|
|
|
|
2021-10-01 02:39:09 +00:00
|
|
|
[horizontal]
|
|
|
|
Field 1:: dissector table name, e.g. "tcp.port"
|
|
|
|
Field 2:: name used for the dissector table in the GUI
|
|
|
|
Field 3:: type (textual representation of the ftenum type)
|
|
|
|
Field 4:: base for display (for integer types)
|
|
|