Tcpdump CLI network sniffer
TIP: Capturing packets can only be done as ROOT! (Sudo)
Commands:
Filters:
Hosts
Ports
Protocols
Logical Operators
TCP Flags
Length
Binary Operations
A binary operation works on bits, i.e., zeroes and ones. An operation takes one or two bits and returns one bit.
Boolean values
Header Bytes
Using pcap-filter, Tcpdump allows you to refer to the contents of any byte in the header using the following syntax
1) proto refers to the protocol. For example, arp, ether, icmp, ip, ip6, tcp, and udp refer to ARP, Ethernet, ICMP, IPv4, IPv6, TCP, and UDP respectively.
2) expr indicates the byte offset, where 0 refers to the first byte.
3) size indicates the number of bytes that interest us, which can be one, two, or four. It is optional and is one by default.
Display packets
Last updated