GRC Careers

HomeResourcestcpdump

CS-054 · Network Tools

tcpdump

The lightweight command-line packet capture tool for servers and authorized network diagnostics.

Executive Summary

tcpdump is a free, command-line tool that captures and displays network packets on a system. Because it is small, fast, and available on most Unix-like systems, it is the go-to way to capture traffic on servers where a graphical tool is not practical. It should only be used on interfaces and networks you own or are authorized to inspect.

What It Is

tcpdump is a command-line packet capture and analysis utility built on the libpcap library. It records the packets crossing a chosen network interface and prints a concise, text summary of each one, or writes them to a capture file for later analysis. It supports the Berkeley Packet Filter syntax, a compact and powerful language for selecting exactly which packets to keep, such as traffic to a particular host or port. Because it runs entirely in a terminal and has almost no dependencies, tcpdump is ideal for capturing on remote servers, network devices, and headless systems, and the files it produces open cleanly in graphical analyzers like Wireshark.

Why It Matters

Much troubleshooting comes down to one question: is the traffic actually arriving, and what does it look like? On a server with no desktop, tcpdump is often the fastest way to answer that. It confirms whether requests reach an application, whether responses go back, where a handshake fails, and whether a firewall is silently dropping packets. For defenders, a quick tcpdump can confirm suspicious activity in real time or capture evidence during an incident. Its filter language lets a professional narrow a flood of traffic to the exact conversation that matters, which makes it both efficient and precise. Because captures can contain sensitive data, they must be handled with care.

How It Works

tcpdump puts a network interface into a capture mode and reads each packet as it passes. By default it prints a one-line summary per packet, showing timestamp, addresses, ports, protocol flags, and size, and it can print more or less detail on request. The key to using it well is filtering: a Berkeley Packet Filter expression tells the kernel to hand tcpdump only the packets you care about, which reduces load and noise. A common pattern is to capture on a specific interface, for example tcpdump -i eth0, optionally adding a filter for a host or port and writing the results to a file for deeper analysis elsewhere. Because it captures at a low level, running it usually requires elevated privileges, and on switched networks it sees only the traffic reaching that interface unless a mirror port or tap is used.

Architecture Diagram

Confirm authorization to captureSelect the interface, for example eth0Apply a BPF filter to focusCapture live and print or write to fileOpen the file in a full analyzer if neededStore the capture securely and report
tcpdump selects an interface, applies a filter, then either prints a summary or writes packets to a file.

Visual Workflow

Confirm you are authorized to capture on the host and interface.Choose the interface to capture on, for example tcpdump -i eth0.Add a Berkeley Packet Filter expression to keep only relevant traffic, such as a host or port.Reproduce the problem or capture the time window of interest.Write packets to a capture file for deeper review in Wireshark if needed.Store the file securely, analyze it, and document the findings.

Common Attacks

Common Mistakes

Best Practices

Quick Checklist

Recommended Tools

Wireshark
Graphical analyzer that opens tcpdump capture files for deep inspection
tshark
Command-line analyzer with richer decoding than tcpdump alone
libpcap
Underlying capture library that tcpdump is built on
termshark
Terminal interface that adds Wireshark-style navigation to captures

Industry Standards

NIST SP 800-61
Incident handling guide where live and stored captures support investigation
NIST SP 800-86
Guidance on using network data as part of forensic response
CIS Critical Security Controls
Network monitoring and logging that packet capture reinforces

Career Relevance

tcpdump is a core skill for systems and network administrators, network security engineers, and SOC analysts and incident responders who need to capture traffic on servers and network devices where graphical tools are unavailable. Comfort with the Berkeley Packet Filter syntax and knowing when to hand a capture file to Wireshark are practical expectations for the hands-on roles that AI-Governance-Jobs.com serves.

Interview Questions

Related Certifications

CompTIA Network+ CompTIA Security+ GIAC Certified Intrusion Analyst (GCIA)

Further Reading

Key Takeaways

Download PDFDownload PNG

FAQ

When would I use tcpdump instead of Wireshark?

Use tcpdump when you need to capture on a server or network device with no graphical interface, or when you want a fast, scriptable capture. You can then open the resulting file in Wireshark for detailed analysis.

Why does tcpdump need administrator or root privileges?

Capturing packets requires low-level access to the network interface, which the operating system restricts. That is why capture is typically run with elevated privileges.

Can tcpdump see all the traffic on my network?

It only sees traffic reaching the interface it captures on. On a switched network you need a mirror or monitoring port or a network tap to observe traffic between other devices.

Get all 116 reference sheets
The complete AGJ Cybersecurity Professional Reference Library, print-ready PDFs and PNGs.
Browse the library

Related Careers

Related certifications

CompTIA Network+CompTIA Security+GIAC Certified Intrusion Analyst (GCIA)

Current openings

Live openings appear on the web version. Browse the job board for current GRC and security roles.
Browse all jobs

Suggested learning path

  1. Ground the basics with CS-001 Cybersecurity
  2. Study this sheet: tcpdump
  3. Go deeper: Wireshark
  4. Go deeper: Traceroute
  5. Validate it: work toward CompTIA Network+
  6. Find the role: browse current openings

Related sheets

More in Network Tools

Share this LinkedIn Facebook X Email