'\" t .\" Title: dumpcap .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-01-05 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" .TH "DUMPCAP" "1" "2024-01-05" "\ \&" "\ \&" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" dumpcap \- Dump network traffic .SH "SYNOPSIS" .sp \fBdumpcap\fP [\~\fB\-a\fP|\fB\-\-autostop\fP\~\~]\~... [\~\fB\-b\fP|\fB\-\-ring\-buffer\fP\~\~]\~... [\~\fB\-B\fP|\fB\-\-buffer\-size\fP\~\~] [\~\fB\-c\fP\~\~] [\~\fB\-C\fP\~\~] [\~\fB\-d\fP\~] [\~\fB\-D\fP|\fB\-\-list\-interfaces\fP\~] [\~\fB\-f\fP\~\~] [\~\fB\-g\fP\~] [\~\fB\-i\fP|\fB\-\-interface\fP\~|rpcap://:/|TCP@:|\-\~] [\~\fB\-I\fP|\fB\-\-monitor\-mode\fP\~] [\~\fB\-k\fP\~,[],[],[]\~] [\~\fB\-L\fP|\fB\-\-list\-data\-link\-types\fP\~] [\~\fB\-M\fP\~] [\~\fB\-n\fP\~] [\~\fB\-N\fP\~\~] [\~\fB\-p\fP|\fB\-\-no\-promiscuous\-mode\fP\~] [\~\fB\-\-ifdescr\fP\~\~] [\~\fB\-\-ifname\fP\~\~] [\~\fB\-P\fP\~] [\~\fB\-q\fP\~] [\~\fB\-s\fP|\fB\-\-snapshot\-length\fP\~\~] [\~\fB\-S\fP\~] [\~\fB\-t\fP\~] [\~\fB\-\-temp\-dir\fP\~\~] [\~\fB\-w\fP\~\~] [\~\fB\-y\fP|\fB\-\-linktype\fP\~\~] [\~\fB\-\-capture\-comment\fP\~\~] [\~\fB\-\-list\-time\-stamp\-types\fP\~] [\~\fB\-\-time\-stamp\-type\fP\~\~] [\~\fB\-\-update\-interval\fP\~\~] .sp \fBdumpcap\fP \fB\-h|\-\-help\fP .sp \fBdumpcap\fP \fB\-v|\-\-version\fP .SH "DESCRIPTION" .sp \fBDumpcap\fP is a network traffic dump tool. It lets you capture packet data from a live network and write the packets to a file. \fBDumpcap\fP\*(Aqs default capture file format is \fBpcapng\fP format. When the \fB\-P\fP option is specified, the output file is written in the \fBpcap\fP format. .sp Without any options set it will use the libpcap, Npcap, or WinPcap library to capture traffic from the first available network interface and writes the received raw packet data, along with the packets\*(Aq time stamps into a capture file. .sp If the \fB\-w\fP option is not specified, \fBDumpcap\fP writes to a newly created capture file with a randomly chosen name. If the \fB\-w\fP option is specified, \fBDumpcap\fP writes to the file specified by that option. .sp Packet capturing is performed with the pcap library. The capture filter syntax follows the rules of the pcap library. .SH "OPTIONS" .sp \-a|\-\-autostop .RS 4 .sp Specify a criterion that specifies when \fBDumpcap\fP is to stop writing to a capture file. The criterion is of the form \fItest:value\fP, where \fItest\fP is one of: .sp \fBduration\fP:\fIvalue\fP Stop writing to a capture file after \fIvalue\fP seconds have elapsed. Floating point values (e.g. 0.5) are allowed. .sp \fBfiles\fP:\fIvalue\fP Stop writing to capture files after \fIvalue\fP number of files were written. .sp \fBfilesize\fP:\fIvalue\fP Stop writing to a capture file after it reaches a size of \fIvalue\fP kB. If this option is used together with the \-b option, dumpcap will stop writing to the current capture file and switch to the next one if filesize is reached. Note that the filesize is limited to a maximum value of 2 GiB. .sp \fBpackets\fP:\fIvalue\fP Stop writing to a capture file after \fIvalue\fP packets have been written. Acts the same as \fB\-c\fP . .RE .sp \-b|\-\-ring\-buffer .RS 4 .sp Cause \fBDumpcap\fP to run in "multiple files" mode. In "multiple files" mode, \fBDumpcap\fP will write to several capture files. When the first capture file fills up, \fBDumpcap\fP will switch writing to the next file and so on. .sp The created filenames are based on the filename given with the \fB\-w\fP option, the number of the file and on the creation date and time, e.g. outfile_00001_20230714120117.pcapng, outfile_00002_20230714120523.pcapng, ... .sp With the \fIfiles\fP option it\(cqs also possible to form a "ring buffer". This will fill up new files until the number of files specified, at which point \fBDumpcap\fP will discard the data in the first file and start writing to that file and so on. If the \fIfiles\fP option is not set, new files filled up until one of the capture stop conditions match (or until the disk is full). .sp The criterion is of the form \fIkey:value\fP, where \fIkey\fP is one of: .sp \fBduration\fP:\fIvalue\fP switch to the next file after \fIvalue\fP seconds have elapsed, even if the current file is not completely filled up. Floating point values (e.g. 0.5) are allowed. .sp \fBfiles\fP:\fIvalue\fP begin again with the first file after \fIvalue\fP number of 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 not handle many files in a single directory well. The \fBfiles\fP criterion requires either \fBduration\fP, \fBinterval\fP or \fBfilesize\fP to be specified to control when to go to the next file. It should be noted that each \fB\-b\fP parameter takes exactly one criterion; to specify two criterion, each must be preceded by the \fB\-b\fP option. .sp \fBfilesize\fP:\fIvalue\fP switch to the next file after it reaches a size of \fIvalue\fP kB. Note that the filesize is limited to a maximum value of 2 GiB. .sp \fBinterval\fP:\fIvalue\fP switch to the next file when the time is an exact multiple of \fIvalue\fP seconds. For example, use 3600 to switch to a new file every hour on the hour. .sp \fBpackets\fP:\fIvalue\fP switch to the next file after it contains \fIvalue\fP packets. .sp \fBprintname\fP:\fIfilename\fP print the name of the most recently written file to \fIfilename\fP after the file is closed. \fIfilename\fP can be \f(CRstdout\fP or \f(CR\-\fP for standard output, or \f(CRstderr\fP for standard error. .sp Example: \fB\-b filesize:1000 \-b files:5\fP results in a ring buffer of five files of size one megabyte each. .RE .sp \-B|\-\-buffer\-size .RS 4 .sp Set capture buffer size (in MiB, default is 2 MiB). This is used by 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 this size. Note that, while \fBDumpcap\fP attempts to set the buffer size to 2 MiB by default, and can be told to set it to a larger value, the system or interface on which you\(cqre capturing might silently limit the capture buffer size to a lower value or raise it to a higher value. .sp This is available on UNIX\-compatible systems, such as Linux, macOS, \(rs*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 libpcap. .sp This option can occur multiple times. If used before the first occurrence of the \fB\-i\fP option, it sets the default capture buffer size. If used after an \fB\-i\fP option, it sets the capture buffer size for the interface specified by the last \fB\-i\fP option occurring before this option. If the capture buffer size is not set specifically, the default capture buffer size is used instead. .RE .sp \-c .RS 4 Set the maximum number of packets to read when capturing live data. Acts the same as \fB\-a packets:\fP. .RE .sp \-C .RS 4 Limit the amount of memory in bytes used for storing captured packets in memory while processing it. If used in combination with the \fB\-N\fP option, both limits will apply. Setting this limit will enable the usage of the separate thread per interface. .RE .sp \-d .RS 4 Dump the code generated for the capture filter in a human\-readable form, and exit. .RE .sp \-D|\-\-list\-interfaces .RS 4 Print a list of the interfaces on which \fBDumpcap\fP can capture, and 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 \fB\-i\fP 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. .RE .sp \-f .RS 4 .sp Set the capture filter expression. .sp The entire filter expression must be specified as a single argument (which means that if it contains spaces, it must be quoted). .sp This option can occur multiple times. If used before the first occurrence of the \fB\-i\fP option, it sets the default capture filter expression. If used after an \fB\-i\fP option, it sets the capture filter expression for the interface specified by the last \fB\-i\fP option occurring before this option. If the capture filter expression is not set specifically, the default capture filter expression is used if provided. .RE .sp \-g .RS 4 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\(cqs group). .RE .sp \-h|\-\-help .RS 4 Print the version number and options and exit. .RE .sp \-i|\-\-interface |rpcap://:/|TCP@:|\- .RS 4 .sp Set the name of the network interface or pipe to use for live packet capture. .sp Network interface names should match one of the names listed in "\fBtshark \-D\fP" (described above); a number, as reported by "\fBdumpcap \-D\fP", can also be used. .sp If no interface is specified, \fBDumpcap\fP searches the list of interfaces, choosing the first non\-loopback interface if there are any non\-loopback interfaces, and choosing the first loopback interface if there are no non\-loopback interfaces. If there are no interfaces at all, \fBDumpcap\fP reports an error and doesn\(cqt start the capture. .sp Pipe names should be either the name of a FIFO (named pipe) or "\-" to read data from the standard input. On Windows systems, pipe names must be of the form "\(rs\(rs.\(rspipe\(rs\fBpipename\fP". Data read from pipes must be in standard pcapng or pcap format. Pcapng data must have the same endianness as the capturing host. .sp "TCP@:" causes \fBDumpcap\fP to attempt to connect to the specified port on the specified host and read pcapng or pcap data. .sp This option can occur multiple times. When capturing from multiple interfaces, the capture file will be saved in pcapng format, even if \fB\-P\fP is specified. .RE .sp \-\-ifdescr> .RS 4 Use \fIdescription\fP as the description in the capture file for the interface or pipe specified before it with \fB\-i\fP. .RE .sp \-\-ifname> .RS 4 Use \fIname\fP as the name in the capture file for the interface or pipe specified before it with \fB\-i\fP. .RE .sp \-I|\-\-monitor\-mode .RS 4 .sp Put the interface in "monitor mode"; this is supported only on IEEE 802.11 Wi\-Fi interfaces, and supported only on some operating systems. .sp Note that in monitor mode the adapter might disassociate from the network with which it\(cqs associated, so that you will not be able to use any wireless networks with that adapter. This could prevent accessing files on a network server, or resolving host names or network addresses, if you are capturing in monitor mode and are not connected to another network with another adapter. .sp This option can occur multiple times. If used before the first occurrence of the \fB\-i\fP option, it enables the monitor mode for all interfaces. If used after an \fB\-i\fP option, it enables the monitor mode for the interface specified by the last \fB\-i\fP option occurring before this option. .RE .sp \-k ,[],[],[> .RS 4 .sp Set the channel on the interface; this is supported only on IEEE 802.11 Wi\-Fi interfaces, and supported only on some operating systems. .sp \fIfreq\fP is the frequency of the channel. \fItype\fP is the type of the channel, for 802.11n and 802.11ac. The values for \fItype\fP are .RE .sp NOHT .RS 4 Used for non\-802.11n/non\-802.1ac channels .RE .sp HT20 .RS 4 20 MHz channel .RE .sp HT40\- .RS 4 40 MHz primary channel and a lower secondary channel .RE .sp HT40+ .RS 4 40 MHz primary channel and a higher secondary channel .RE .sp HT80 .RS 4 80 MHz channel, with \fIcenterfreq1\fP as its center frequency .RE .sp VHT80+80 .RS 4 Two 80 MHz channels combined, with \fIcenterfreq1\fP and \fIcenterfreq2\fP as the center frequencies of the two channels .RE .sp VHT160 .RS 4 160 MHz channel, with \fIcenterfreq1\fP as its center frequency .RE .sp \-L|\-\-list\-data\-link\-types .RS 4 List the data link types supported by the interface and exit. The reported link types can be used for the \fB\-y\fP option. .RE .sp \-M .RS 4 .sp When used with \fB\-D\fP, \fB\-L\fP, \fB\-S\fP or \fB\-\-list\-time\-stamp\-types\fP print machine\-readable output. The machine\-readable output is intended to be read by \fBWireshark\fP and \fBTShark\fP; its format is subject to change from release to release. .RE .sp \-n .RS 4 Save files as pcapng. This is the default. .RE .sp \-N .RS 4 .sp Limit the number of packets used for storing captured packets in memory while processing it. If used in combination with the \fB\-C\fP option, both limits will apply. Setting this limit will enable the usage of the separate thread per interface. .RE .sp \-p|\-\-no\-promiscuous\-mode .RS 4 .sp \fIDon\(cqt\fP put the interface into promiscuous mode. Note that the interface might be in promiscuous mode for some other reason; hence, \fB\-p\fP cannot be used to ensure that the only traffic that is captured is traffic sent to or from the machine on which \fBDumpcap\fP is running, broadcast traffic, and multicast traffic to addresses received by that machine. .sp This option can occur multiple times. If used before the first occurrence of the \fB\-i\fP option, no interface will be put into the promiscuous mode. If used after an \fB\-i\fP option, the interface specified by the last \fB\-i\fP option occurring before this option will not be put into the promiscuous mode. .RE .sp \-P .RS 4 Save files as pcap instead of the default pcapng. In situations that require pcapng, such as capturing from multiple interfaces, this option will be overridden. .RE .sp \-q .RS 4 .sp When capturing packets, don\(cqt display the continuous count of packets captured that is normally shown when saving a capture to a file; instead, just display, at the end of the capture, a count of packets captured. On systems that support the SIGINFO signal, such as various BSDs, you can cause the current count to be displayed by typing your "status" character (typically control\-T, although it might be set to "disabled" by default on at least some BSDs, so you\(cqd have to explicitly set it to use it). .RE .sp \-s|\-\-snapshot\-length .RS 4 .sp Set the default snapshot length to use when capturing live data. No more than \fIsnaplen\fP bytes of each network packet will be read into memory, or saved to disk. A value of 0 specifies a snapshot length of 262144, so that the full packet is captured; this is the default. .sp This option can occur multiple times. If used before the first occurrence of the \fB\-i\fP option, it sets the default snapshot length. If used after an \fB\-i\fP option, it sets the snapshot length for the interface specified by the last \fB\-i\fP option occurring before this option. If the snapshot length is not set specifically, the default snapshot length is used if provided. .RE .sp \-S .RS 4 Print statistics for each interface once every second. .RE .sp \-t .RS 4 Use a separate thread per interface. .RE .sp \-\-temp\-dir .RS 4 .sp Specifies the directory into which temporary files (including capture files) are to be written. The default behavior on UNIX\-compatible systems, such as Linux, macOS, \(rs*BSD, Solaris, and AIX, is to use the environment variable \fI$TMPDIR\fP if set, and the system default, typically \fI/tmp\fP, if it is not. On Windows, the \fI%TEMP%\fP environment variable is used, which typically defaults to \fI%USERPROFILE%\(rsAppData\(rsLocal\(rsTemp\fP. .RE .sp \-v|\-\-version .RS 4 Print the full version information and exit. .RE .sp \-w .RS 4 Write raw packet data to \fIoutfile\fP. Use "\-" for stdout. .RE .sp \-y|\-\-linktype .RS 4 .sp Set the data link type to use while capturing packets. The values reported by \fB\-L\fP are the values that can be used. .sp This option can occur multiple times. If used before the first occurrence of the \fB\-i\fP option, it sets the default capture link type. If used after an \fB\-i\fP option, it sets the capture link type for the interface specified by the last \fB\-i\fP option occurring before this option. If the capture link type is not set specifically, the default capture link type is used if provided. .RE .sp \-\-capture\-comment .RS 4 .sp Add a capture comment to the output file, if supported by the output file format. .sp This option is only available if we output the captured packets to a single file. .sp This option may be specified multiple times. Note that Wireshark currently only displays the first comment of a capture file. .RE .sp \-\-list\-time\-stamp\-types .RS 4 List time stamp types supported for the interface. If no time stamp type can be set, no time stamp types are listed. .RE .sp \-\-time\-stamp\-type .RS 4 Change the interface\(cqs timestamp method. .RE .sp \-\-update\-interval .RS 4 Set the length of time in milliseconds between new packet reports during a capture. Also sets the granularity of file duration conditions. The default value is 100ms. .RE .SH "DIAGNOSTIC OPTIONS" .sp \-\-log\-level .RS 4 Set the active log level. Supported levels in lowest to highest order are "noisy", "debug", "info", "message", "warning", "critical", and "error". Messages at each level and higher will be printed, for example "warning" prints "warning", "critical", and "error" messages and "noisy" prints all messages. Levels are case insensitive. .RE .sp \-\-log\-fatal .RS 4 Abort the program if any messages are logged at the specified level or higher. For example, "warning" aborts on any "warning", "critical", or "error" messages. .RE .sp \-\-log\-domains .RS 4 Only print messages for the specified log domains, e.g. "GUI,Epan,sshdump". List of domains must be comma\-separated. Can be negated with "!" as the first character (inverts the match). .RE .sp \-\-log\-debug .RS 4 Force the specified domains to log at the "debug" level. List of domains must be comma\-separated. Can be negated with "!" as the first character (inverts the match). .RE .sp \-\-log\-noisy .RS 4 Force the specified domains to log at the "noisy" level. List of domains must be comma\-separated. Can be negated with "!" as the first character (inverts the match). .RE .sp \-\-log\-fatal\-domains .RS 4 Abort the program if any messages are logged for the specified log domains. List of domains must be comma\-separated. .RE .sp \-\-log\-file .RS 4 Write log messages and stderr output to the specified file. .RE .SH "CAPTURE FILTER SYNTAX" .sp See the manual page of pcap\-filter(7) or, if that doesn\(cqt exist, tcpdump(8), or, if that doesn\(cqt exist, \c .URL "https://gitlab.com/wireshark/wireshark/\-/wikis/CaptureFilters" "" "." .SH "SEE ALSO" .sp wireshark(1), tshark(1), editcap(1), mergecap(1), capinfos(1), pcap(3), pcap\-filter(7) or tcpdump(8) .SH "NOTES" .sp This is the manual page for \fBDumpcap\fP 4.2.2. \fBDumpcap\fP is part of the \fBWireshark\fP distribution. The latest version of \fBWireshark\fP can be found at \c .URL "https://www.wireshark.org" "" "." .sp HTML versions of the Wireshark project man pages are available at .URL "https://www.wireshark.org/docs/man\-pages" "" "." .SH "AUTHORS" .sp \fBDumpcap\fP is derived from the \fBWireshark\fP capturing engine code; see the list of authors in the \fBWireshark\fP man page for a list of authors of that code.