tcpdump -DLists all available network interfaces on the system that can be captured.
The classic packet capture tool: capture and filter traffic with BPF expressions and write it to pcap files for later analysis.
sudo apt install tcpdumptcpdump -DLists all available network interfaces on the system that can be captured.
tcpdump -nDisables DNS name resolution to display IP addresses instead of hostnames.
Example
tcpdump -n -i eth0tcpdump -nnDisables both DNS name resolution and port name resolution (shows port numbers).
Example
tcpdump -nn -i eth0tcpdump -tDisables timestamp printing on each line.
Example
tcpdump -t -i eth0tcpdump -ttPrints an unformatted unix epoch timestamp on each line.
Example
tcpdump -tt -i eth0tcpdump -ttttPrints a human-readable date and timestamp for every packet.
Example
tcpdump -tttt -i eth0tcpdump -c 10Captures exactly 10 packets and then automatically exits.
Example
tcpdump -c 10 -i eth0tcpdump -vEnables verbose output to see TTL, ID, total length, and options.
Example
tcpdump -v -i eth0tcpdump -vvEnables extra verbose output including NFS and SMB file decoding.
Example
tcpdump -vv -i eth0tcpdump -vvvEnables maximum verbosity for full protocol decoding and analysis.
Example
tcpdump -vvv -i eth0tcpdump -qPrints less protocol information for a cleaner, easier to read line.
Example
tcpdump -q -i eth0tcpdump -ePrints the link-level header on each line, showing MAC addresses.
Example
tcpdump -e -i eth0tcpdump -APrints packets in ASCII format, useful for reading web pages or plain text data.
Example
tcpdump -A -i eth0tcpdump -XPrints packets in both Hex and ASCII format, essential for payload analysis.
Example
tcpdump -X -i eth0tcpdump -xxPrints the full packet data in hex, including the ethernet header.
Example
tcpdump -xx -i eth0tcpdump -s 0Sets snapshot length to default (unlimited) to capture full packet bodies instead of truncating.
Example
tcpdump -s 0 -i eth0tcpdump -w capture.pcapWrites raw packet data to a standard PCAP file for later analysis.
Example
tcpdump -w capture.pcap -i eth0tcpdump -r capture.pcapReads and analyzes packets from a previously saved PCAP file.
tcpdump host 192.168.1.50Filters traffic specifically to or from the host IP 192.168.1.50.
Example
tcpdump -n host 192.168.1.50tcpdump net 10.0.0.0/24Captures all traffic belonging to the 10.0.0.0/24 subnet.
Example
tcpdump -n net 10.0.0.0/24tcpdump port 80Captures traffic flowing through port 80 (HTTP) regardless of direction.
Example
tcpdump -n port 80tcpdump portrange 1000-2000Captures traffic on a range of ports from 1000 to 2000.
Example
tcpdump -n portrange 1000-2000tcpdump tcpFilters output to show only TCP protocol traffic.
Example
tcpdump -n tcptcpdump udpFilters output to show only UDP protocol traffic.
Example
tcpdump -n udptcpdump icmpFilters output to show only ICMP (Ping/Unreachable) traffic.
Example
tcpdump -n icmptcpdump arpFilters output to show only ARP address resolution traffic.
Example
tcpdump -n arptcpdump ip6Filters output to show only IPv6 traffic.
Example
tcpdump -n ip6tcpdump "src 10.0.0.1 and dst port 80"Combines filters to match packets from 10.0.0.1 going to port 80.
Example
tcpdump -n "src 10.0.0.1 and dst port 80"tcpdump "port 80 or port 443"Matches packets using either port 80 or port 443.
Example
tcpdump -n "port 80 or port 443"tcpdump "not port 22"Excludes all SSH traffic from the capture.
Example
tcpdump -n "not port 22"tcpdump "host 10.0.0.1 and (port 80 or port 443)"Uses parentheses to group logic for a specific host on web ports.
Example
tcpdump -n "host 10.0.0.1 and (port 80 or port 443)"tcpdump "tcp[tcpflags] & tcp-syn != 0"Captures only TCP packets with the SYN flag set (connection requests).
Example
tcpdump -n "tcp[tcpflags] & tcp-syn != 0"tcpdump "tcp[tcpflags] & tcp-ack != 0"Captures only TCP packets with the ACK flag set.
Example
tcpdump -n "tcp[tcpflags] & tcp-ack != 0"tcpdump "tcp[tcpflags] & tcp-fin != 0"Captures only TCP packets with the FIN flag set (connection termination).
Example
tcpdump -n "tcp[tcpflags] & tcp-fin != 0"tcpdump "tcp[tcpflags] & tcp-rst != 0"Captures only TCP packets with the RST flag set (connection reset).
Example
tcpdump -n "tcp[tcpflags] & tcp-rst != 0"tcpdump "tcp[tcpflags] & tcp-push != 0"Captures packets with the PUSH flag, indicating data should be processed immediately.
Example
tcpdump -n "tcp[tcpflags] & tcp-push != 0"tcpdump "tcp[tcpflags] & (tcp-syn|tcp-ack) == (tcp-syn|tcp-ack)"Captures only SYN-ACK packets, representing the server response in a handshake.
Example
tcpdump -n "tcp[tcpflags] & (tcp-syn|tcp-ack) == (tcp-syn|tcp-ack)"tcpdump "ip[2:2] > 600"Uses byte offset filtering to capture packets with a total IP length greater than 600.
Example
tcpdump -n "ip[2:2] > 600"tcpdump "tcp[13] & 2 != 0"Manual BPF filter checking the 13th byte of TCP header for the SYN flag.
Example
tcpdump -n "tcp[13] & 2 != 0"tcpdump "ip[6] & 128 != 0"Detects packets with the 'Evil Bit' (Reserved bit) set in the IP header.
Example
tcpdump -n "ip[6] & 128 != 0"tcpdump ip6 proto 6Captures IPv6 traffic specifically using the TCP protocol (Protocol 6).
Example
tcpdump -n ip6 proto 6tcpdump -X -s 0 port 80Captures full HTTP packets in Hex/ASCII to inspect payloads for malicious data.
tcpdump "tcp[tcpflags] == 0"Detects Null Scan attacks where a packet is sent with no TCP flags set.
Example
tcpdump -n "tcp[tcpflags] == 0"tcpdump "tcp[tcpflags] & (tcp-fin|tcp-urg|tcp-push) == (tcp-fin|tcp-urg|tcp-push)"Detects Xmas Tree scans which set the FIN, URG, and PUSH flags simultaneously.
Example
tcpdump -n "tcp[tcpflags] & (tcp-fin|tcp-urg|tcp-push) == (tcp-fin|tcp-urg|tcp-push)"tcpdump "tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420"Advanced filter matching the bytes 'GET ' at the beginning of the TCP payload.
Example
tcpdump -A "tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420"tcpdump "tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354"Advanced filter matching the bytes 'POST' at the beginning of the TCP payload.
Example
tcpdump -A "tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x504f5354"tcpdump "tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x48545450"Matches 'HTTP' in payload, useful for finding HTTP responses or custom headers.
Example
tcpdump -A "tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x48545450"tcpdump -lMakes stdout line-buffered, allowing immediate piping to tools like grep.
Example
tcpdump -l -i eth0 | grep 'Error'tcpdump -A -s 0 "tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)"Filters for TCP segments that actually contain data (payload) to ignore empty ACKs.
tcpdump udp port 53Standard filter for monitoring DNS queries and responses.
Example
tcpdump -n udp port 53tcpdump udp port 123Captures Network Time Protocol traffic for troubleshooting sync issues.
Example
tcpdump -n udp port 123tcpdump port 67 or port 68Captures DHCP discovery, offer, request, and ack sequences.
Example
tcpdump -n port 67 or port 68tcpdump "icmp[icmptype] == icmp-timexceed"Captures TTL Exceeded messages, useful for visualizing traceroutes targeting your network.
Example
tcpdump -n "icmp[icmptype] == icmp-timexceed"tcpdump "icmp[icmptype] == icmp-unreach"Captures Destination Unreachable messages, often indicating closed ports or firewall rejects.
Example
tcpdump -n "icmp[icmptype] == icmp-unreach"tcpdump -w sensitive.pcap port 21 or port 23 or port 110Captures cleartext protocols (FTP, Telnet, POP3) to harvest credentials.
tcpdump -i eth0 -n "broadcast or multicast"Identifies noisy broadcast traffic that might be causing network storms.
tcpdump -n "not host 192.168.1.50"Captures everything EXCEPT traffic from a specific noisy backup server or admin host.
tcpdump -xPrints payload in hex without ASCII, useful for strict byte-level header verification.
Example
tcpdump -x -i eth0tcpdump -SPrints absolute TCP sequence numbers instead of relative ones, critical for TCP stream analysis.
Example
tcpdump -S -i eth0tcpdump mplsCaptures Multi-Protocol Label Switching packets.
Example
tcpdump -n mplstcpdump -U -w capture.pcapWrites packets to file immediately as they arrive without buffering (Packet Buffered).
tcpdump "host 10.0.0.1 and not port 22 and not port 53"Focuses on a host while removing standard administrative noise like SSH and DNS.
Example
tcpdump -n "host 10.0.0.1 and not port 22 and not port 53"Wireshark’s terminal version: capture and decode traffic with full dissectors and display filters, and extract fields to text.
“Network grep” — matches regular expressions against packet payloads, like grep for network traffic.
The utilities that ship with Wireshark — editcap, mergecap, capinfos, dumpcap and text2pcap — for working with capture files.
A high-performance, multi-threaded IDS/IPS and network security monitoring engine with EVE JSON logging.
A suite for man-in-the-middle attacks on LANs: ARP poisoning, sniffing and content filtering, for authorised testing.
A high-performance Linux networking toolkit using zero-copy packet mmap: capture, replay, traffic generation and analysis.