tshark -DLists all network interfaces available for packet capturing
Wireshark’s terminal version: capture and decode traffic with full dissectors and display filters, and extract fields to text.
sudo apt install tsharktshark -DLists all network interfaces available for packet capturing
tshark -i eth0Captures live traffic from a specific interface named eth0
tshark -i anyCaptures traffic from all available interfaces simultaneously
tshark -p -i eth0Captures traffic in non-promiscuous mode, seeing only traffic destined for the host
tshark -w capture.pcap -i eth0Writes captured raw packet data to a file in pcapng format
tshark -b files:5 -b filesize:10000 -w rolling.pcapCreates a ring buffer of 5 files, rotating when each reaches 10MB
tshark -F pcap -w legacy.pcapSaves the capture in the legacy pcap format instead of pcapng
tshark -r capture.pcapReads and displays packets from a previously saved capture file
tshark -f "host 192.168.1.10" -i eth0Captures only traffic to or from a specific IP address
tshark -f "tcp port 80" -i eth0Captures only TCP traffic on port 80
tshark -f "net 10.0.0.0/24" -i eth0Captures traffic belonging to the specified subnet
tshark -f "not arp and not port 53" -i eth0Excludes ARP and DNS traffic from the capture to reduce noise
tshark -s 64 -i eth0Captures only the first 64 bytes of each packet (snapshot length)
tshark -r capture.pcap -Y "http.request"Displays only HTTP request packets from the loaded file
tshark -r capture.pcap -Y "ip.addr == 192.168.1.5"Filters the view to show only packets involving a specific IP
tshark -r capture.pcap -Y "tcp.flags.reset == 1"Displays only TCP packets where the RST (reset) flag is set
tshark -r capture.pcap -Y "frame.time_delta > 0.2"Shows packets that arrived more than 200ms after the previous packet
tshark -r capture.pcap -2 -R "tcp.analysis.flags"Performs a two-pass analysis to accurately filter TCP retransmissions and flags
tshark -r capture.pcap -Y "!(ip.addr == 192.168.1.1)"Displays all traffic NOT involving the specified IP address
tshark -r capture.pcap -T fields -e ip.src -e ip.dstExtracts only the source and destination IP addresses
tshark -r capture.pcap -T fields -e http.host -e http.request.uriExtracts the hostname and URI from HTTP requests
tshark -r capture.pcap -T fields -E separator=, -e frame.number -e ip.addrOutputs extracted fields in a CSV-like format separated by commas
tshark -r capture.pcap -T fields -E header=y -e ip.src -e tcp.portIncludes a header row with field names in the output
tshark -r capture.pcap -T fields -e textExtracts the top-level summary text for each packet
tshark -r capture.pcap -q -z io,phsDisplays a protocol hierarchy statistics tree without printing packets
tshark -r capture.pcap -q -z conv,ipShows a table of conversations between IPv4 addresses
tshark -r capture.pcap -q -z conv,tcpDisplays TCP conversation statistics including duration and byte counts
tshark -r capture.pcap -q -z endpoints,ipLists all unique IP endpoints found in the capture file
tshark -r capture.pcap -q -z http,treeGenerates a breakdown of HTTP packet counts and response codes
tshark -r capture.pcap -q -z dns,treeDisplays statistics on DNS query types and response codes
tshark -r capture.pcap -z expertDisplays expert information including errors, warnings, and notes
tshark -r capture.pcap -z service_response_time,httpCalculates the time between HTTP requests and their corresponding responses
tshark -r capture.pcap -z expert,errorDisplays only the error-level items from the expert information
tshark -r capture.pcap -z follow,tcp,ascii,0Follows TCP stream index 0 and outputs the content in ASCII
tshark -r capture.pcap -z follow,udp,hex,1Follows UDP stream index 1 and outputs the content in hexadecimal
tshark -r capture.pcap -z follow,http,ascii,2Follows the HTTP stream index 2 showing request and response bodies
tshark -r capture.pcap -o "ssl.keys_list:127.0.0.1,443,http,server.pem"Decrypts SSL/TLS traffic using the specified server private key
tshark -r capture.pcap -o "tls.keylog_file:keys.log"Decrypts TLS traffic using a browser-generated session key log file
tshark -r capture.pcap -U "secrets.txt"Uses an IPsec ESP secret key file for decryption
tshark -r capture.pcap -Y "tcp.analysis.retransmission"Filters for packets identified as TCP retransmissions
tshark -r capture.pcap -Y "tcp.analysis.lost_segment"Identifies gaps in the sequence numbers indicating lost segments
tshark -r capture.pcap -T fields -e tcp.analysis.ack_rttExtracts the Round Trip Time (RTT) calculated from ACK packets
tshark -r capture.pcap -Y "tcp.analysis.window_update"Shows packets that only update the TCP window size
tshark -r capture.pcap -Y "http.user_agent contains 'python'"Detects HTTP requests made by Python scripts, often used by bots
tshark -r capture.pcap -Y "dns.qry.name.len > 50"Identifies unusually long DNS queries potentially indicating tunneling
tshark -r capture.pcap -Y "tcp.dstport == 4444 or tcp.dstport == 1337"Monitors ports commonly used by malware and reverse shells
tshark -r capture.pcap -Y "icmp.type == 8 and data.len > 100"Detects large ICMP Echo Requests which may indicate data exfiltration
tshark -r capture.pcap -Y "kerberos.error_code"Displays Kerberos authentication errors useful for detecting attacks
tshark -r capture.pcap --export-objects "http,dest_dir"Extracts all files transferred over HTTP to a destination directory
tshark -r capture.pcap --export-objects "smb,dest_dir"Extracts files transferred via SMB file shares
tshark -r capture.pcap -Y "ftp.request.command == 'USER' or ftp.request.command == 'PASS'"Filters for plaintext FTP credentials found in the capture
tshark -r capture.pcap -Y "usb.urb_type"Analyzes USB traffic captured via usbmon
tshark -r capture.pcap -Y "smb2.filename contains 'pass'"Searches for SMB2 file access requests containing 'pass' in the name
tshark -r capture.pcap -Y "mysql.query"Displays packets containing MySQL database queries
tshark -r capture.pcap -Y "sip.Method == 'INVITE'"Filters for VoIP SIP calls initiation packets
tshark -r capture.pcap -Y "wlan.fc.type_subtype == 0x08"Filters for 802.11 Beacon frames in WiFi traffic
tshark -r capture.pcap -Y "eth.dst == ff:ff:ff:ff:ff:ff"Filters specifically for Ethernet broadcast traffic
tshark -r capture.pcap -Y "http.request.method == 'POST'" -T fields -e http.file_dataExtracts the actual payload data sent in HTTP POST requests
tshark -r capture.pcap -o "gui.column.format:\"Time\",\"%t\",\"Delta\",\"%D\""Customizes the output columns to show Time and Delta columns only
tshark -r capture.pcap -z io,stat,1,"COUNT(http.request) http.request","AVG(frame.len) frame.len"Calculates HTTP request count and average frame length per second
tshark -r capture.pcap -Y "tls.handshake.type == 1" -T fields -e tls.handshake.extensions_server_nameExtracts the SNI (Server Name Indication) from TLS Client Hellos
tshark -r capture.pcap -Y "modbus.func_code"Filters for SCADA/ICS Modbus traffic function codes
tshark -G protocolsLists all protocols supported by the installed version of tshark
tshark -G fields | grep "wifi"Searches the glossary of filter fields for WiFi related fields
tshark -r capture.pcap -Y "frame contains \"password\""Searches the entire packet raw bytes for the string 'password'
tshark -r capture.pcap -Y "frame matches \"(?i)login\""Uses case-insensitive regex to search for 'login' in the packet
tshark -vDisplays version information, compiled libraries, and running environment
tshark -r capture.pcap -T fields -e ip.src -e ip.geoip.countryExtracts source IPs and their associated GeoIP country code
The utilities that ship with Wireshark — editcap, mergecap, capinfos, dumpcap and text2pcap — for working with capture files.
The classic packet capture tool: capture and filter traffic with BPF expressions and write it to pcap files for later analysis.
A network security monitor that turns traffic into rich, structured logs of connections, DNS, HTTP, TLS and files.
A network intrusion detection and prevention system that inspects traffic in real time against a rule language.
A suite for man-in-the-middle attacks on LANs: ARP poisoning, sniffing and content filtering, for authorised testing.
“Network grep” — matches regular expressions against packet payloads, like grep for network traffic.