Lion Cipher Lab

Capture and read packets from the command line with tcpdump

Why it matters

The machines a defender most needs to watch usually have no screen: a web server in a rack, a cloud instance reached over SSH, a firewall, a remote sensor. On those, there is no window to open — you read the wire from the command line, and tcpdump is the tool that is already installed to do it. It is a small, fast packet capturer that prints traffic matching a filter you write, and it ships on nearly every Linux and macOS system by default, which makes it the one packet tool you can count on being there in an incident. Learning to point it at the right interface, narrow it with a filter, read…

What you'll learn

Steps in this lab

  1. First: capture only your own traffic, on your own network
  2. What tcpdump is, and making sure you have it
  3. See your interfaces and pick the one to capture on
  4. Your first controlled capture: a filter and a count limit
  5. Read the output: what each line is telling you
  6. Write real filters: host, port, protocol, and combining them
  7. Save a capture to a file, then read it back
  8. Why the headless version of this skill matters most

Open the full interactive lab →