OwlArch

Software

🔙 Go back home

TCPDump

Network Sniffer and Packet Analyzer

Introduction

tcpdump is a command-line tool for capturing and analyzing network traffic. It is widely used by system administrators and cybersecurity professionals to diagnose network issues, monitor packets, and investigate security incidents.

Features

Installation

  1. Open a terminal.
  2. Install tcpdump using:
    sudo pacman -S tcpdump  
    

Install Verification

Check the version to confirm installation:

tcpdump --version  

Uninstall

sudo pacman -R tcpdump  

Usage

Basic Commands

Capture Traffic on a Specific Interface

sudo tcpdump -i eth0  

Save Capture to a File

sudo tcpdump -i eth0 -w capture.pcap  

Read Packets from a File

tcpdump -r capture.pcap  

Filtering Examples

Filter by Protocol (e.g., ICMP)

sudo tcpdump -i eth0 icmp  

Filter Traffic for a Specific Host

sudo tcpdump -i eth0 host 192.168.1.1  

Filter Traffic on a Specific Port (e.g., HTTP)

sudo tcpdump -i eth0 port 80  

Advanced Filters

Capture TCP Traffic Between Two Hosts

sudo tcpdump -i eth0 tcp and host 192.168.1.10 and host 192.168.1.20  

Display Packet Contents in ASCII/Hex

sudo tcpdump -i eth0 -A  

Example Workflow

Capture DNS Queries

sudo tcpdump -i eth0 port 53  

Capture HTTP GET Requests

sudo tcpdump -i eth0 'tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420'  

Official Documentation & More Info

Contributing

tcpdump is maintained by the TCPDUMP Group. Contributions are welcome via patches or bug reports.

Support

License

tcpdump is released under the BSD 3-Clause License.


🔙 Suricata 🔜 TheHarvester