GO KALI FREE
BeginnerTools

How to Use Tcpdump: Beginner's Guide to Packet Capture in Kali Linux

Learn how to use tcpdump in Kali Linux — capture packets, filter with BPF, save pcap files and read output, with a worked example and cheat sheet.

#how to use tcpdump#what is tcpdump#tcpdump tutorial#tcpdump commands#tcpdump cheat sheet#tcpdump kali linux#packet capture

What Is Tcpdump?

Tcpdump is an open-source command-line packet capture tool built on libpcap. It listens on a network interface, captures the packets passing through it, and prints or saves them so you can inspect traffic, troubleshoot connections, and spot suspicious activity. It is pre-installed on Kali Linux and uses Berkeley Packet Filter (BPF) expressions to capture only the traffic you ask for.

Why You Need Tcpdump

You need to see network traffic in real time from the command line — Tcpdump captures packets on any interface and displays or saves them for analysis. It uses BPF filter syntax for precise traffic selection and runs in environments where a GUI is unavailable.

A server stops answering, a login fails for no visible reason, or a lab machine talks to an address it should not. Ping and curl tell you that something is wrong; tcpdump shows you exactly what crossed the wire — the SYN that never got an answer, the DNS query going to the wrong server, the reset packet killing the connection. That is why it is the first tool most network troubleshooters reach for, and why it belongs in every Kali Linux workflow.

Prerequisites

  • Basic understanding of TCP/IP networking
  • Familiarity with the Linux command line
  • Root/administrator access for packet capture
  • Installing Tcpdump

    Tcpdump is pre-installed on Kali Linux. Verify it with:

    tcpdump --version
    

    If it is missing, install it for your system:

    # Debian / Ubuntu / Kali
    sudo apt update && sudo apt install tcpdump
    
    # Fedora / RHEL
    sudo dnf install tcpdump
    
    # Arch Linux
    sudo pacman -S tcpdump
    
    # macOS (capture still needs sudo)
    brew install tcpdump
    

    On Windows, tcpdump does not run natively. The closest equivalent is tshark, the command-line tool bundled with Wireshark, which uses the same BPF filter syntax and reads and writes the same pcap files. Install Wireshark (which includes Npcap, the packet-capture driver) and use tshark wherever this guide says tcpdump.

    How to Use Tcpdump in 6 Steps

    This is the whole workflow in miniature. Master these six steps and you can capture anything in this guide.

    Step 1: Check the install

    tcpdump --version
    

    You should see a version number and a libpcap version. If the command is not found, install it using the section above.

    Step 2: List your interfaces

    tcpdump -D
    

    Tcpdump prints every interface it can capture on, numbered: 1.eth0, 2.wlan0, 3.lo, and on Linux any. Pick the one carrying the traffic you care about.

    Step 3: Run your first capture

    sudo tcpdump -i eth0 -c 5
    

    The -c 5 stops after five packets so the capture ends by itself. You will see one line per packet, each starting with a timestamp. Press Ctrl+C to stop any capture that has no -c limit.

    Step 4: Add a filter

    sudo tcpdump -i eth0 -c 10 port 80
    

    Now only web traffic appears. Filters are the difference between a useful capture and a flood of noise — most of this guide is about writing good ones.

    Step 5: Save the capture to a file

    sudo tcpdump -i eth0 -w capture.pcap -c 100
    

    Nothing is printed; the packets go into capture.pcap in full. Saving first and analyzing later is the professional habit — live output can drop packets on a busy network.

    Step 6: Read the file back

    tcpdump -r capture.pcap -nn port 443
    

    Reading a file needs no root privileges, and you can apply a different filter while reading. Open the same file in Wireshark for a graphical view.

    Choosing an Interface

    The -i flag picks where tcpdump listens. Get it wrong and you capture nothing, or the wrong traffic entirely.

    # List interfaces with their numbers
    tcpdump -D
    
    # Capture on a named interface
    sudo tcpdump -i eth0
    
    # Capture on every interface at once (Linux only)
    sudo tcpdump -i any
    
    # Capture localhost traffic only
    sudo tcpdump -i lo
    

    With no -i flag, tcpdump uses the first interface it finds — usually fine on a laptop, unreliable on a machine with several interfaces. The any pseudo-device is convenient for a first look, but it can show the same packet twice when it crosses two interfaces, so prefer a named interface once you know which one carries the traffic. Loopback (lo) is the interface for traffic a machine sends to itself, which is exactly what the worked example below uses.

    Basic Usage

    sudo tcpdump -i eth0
    sudo tcpdump -i eth0 -c 100
    sudo tcpdump -i eth0 -w capture.pcap
    tcpdump -r capture.pcap
    

    Essential Options

    OptionDescription
    -i INTERFACENetwork interface
    -DList available interfaces
    -c COUNTStop after COUNT packets
    -w FILEWrite to file
    -r FILERead from file
    -nNo hostname resolution
    -nnNo hostname or port resolution
    -vVerbose output
    -vvMore verbose output
    -vvvMost verbose output
    -XHex and ASCII output
    -XXHex and ASCII, including the link-level header
    -AASCII output
    -tNo timestamp
    -ttTimestamp as seconds since 1970
    -tttTime since the previous packet
    -ttttFull date and time
    -s SNAPLENCapture SNAPLEN bytes per packet
    -lLine-buffered output (for piping to grep or tee)
    -ePrint the link-level header
    -SAbsolute TCP sequence numbers
    -qQuiet output (less protocol detail)
    -G SECONDSRotate the output file every SECONDS
    -C MBRotate the output file at MB megabytes
    -W COUNTKeep at most COUNT rotated files
    -B KBKernel capture buffer size, in KiB

    BPF Filter Expressions

    # Host filters
    sudo tcpdump -i eth0 host 192.168.1.100
    sudo tcpdump -i eth0 src host 10.0.0.1
    sudo tcpdump -i eth0 dst host 93.184.216.34
    
    # Port filters
    sudo tcpdump -i eth0 port 80
    sudo tcpdump -i eth0 portrange 8000-8100
    
    # Protocol filters
    sudo tcpdump -i eth0 tcp
    sudo tcpdump -i eth0 udp icmp arp
    
    # Combined
    sudo tcpdump -i eth0 tcp and port 80
    sudo tcpdump -i eth0 not arp and not icmp
    

    BPF is the filter language tcpdump, Wireshark, and tshark all share, so anything you learn here transfers directly. A filter is built from primitives joined by and, or, and not, with parentheses for grouping (quote them so the shell does not eat them).

    # One host, one direction
    sudo tcpdump -i eth0 src host 10.0.0.5 and dst port 443
    
    # A whole subnet
    sudo tcpdump -i eth0 net 192.168.1.0/24
    
    # Everything except the noise
    sudo tcpdump -i eth0 not arp and not icmp and not port 5353
    
    # Grouping with parentheses (note the quotes)
    sudo tcpdump -i eth0 '(port 80 or port 443) and host 93.184.216.34'
    
    # Only connection attempts (SYN packets, no data)
    sudo tcpdump -i eth0 'tcp[tcpflags] & tcp-syn != 0'
    
    # Only DNS queries
    sudo tcpdump -i eth0 udp port 53
    
    # Only ICMP (ping) traffic
    sudo tcpdump -i eth0 icmp
    
    # Only ARP requests
    sudo tcpdump -i eth0 arp
    
    # Packets longer than 1000 bytes
    sudo tcpdump -i eth0 greater 1000
    
    # SSH traffic to one server
    sudo tcpdump -i eth0 host 10.0.0.5 and port 22
    
    # Web traffic, either HTTP or HTTPS
    sudo tcpdump -i eth0 'tcp port 80 or tcp port 443'
    

    Two rules keep filters predictable: and binds tighter than or, so use parentheses whenever you mix them; and filters apply before packets reach userspace, so a tight filter costs almost nothing even on a busy interface, while no filter at all costs you a flood.

    Worked Example: Capturing a Real HTTP Request

    Theory is not enough — here is a complete capture you can run on your own machine in two minutes, with nothing leaving localhost.

    Open two terminals. In the first, start a tiny web server bound to localhost only:

    python3 -m http.server 8000 --bind 127.0.0.1
    

    In the second, start the capture on the loopback interface, then fetch the page:

    sudo tcpdump -i lo -nn -A port 8000
    
    curl http://127.0.0.1:8000/
    

    The capture shows the whole conversation. Sample output (illustrative — your ports, sequence numbers, and timestamps will differ):

    14:32:10.123456 IP 127.0.0.1.54321 > 127.0.0.1.8000: Flags [S], seq 1000000000, win 65495, length 0
    14:32:10.124000 IP 127.0.0.1.8000 > 127.0.0.1.54321: Flags [S.], seq 2000000000, ack 1000000001, win 65495, length 0
    14:32:10.124500 IP 127.0.0.1.54321 > 127.0.0.1.8000: Flags [.], ack 2000000001, win 65535, length 0
    14:32:10.125000 IP 127.0.0.1.54321 > 127.0.0.1.8000: Flags [P.], seq 1000000001:1000000100, ack 2000000001, win 65535, length 99: HTTP: GET / HTTP/1.1
    14:32:10.126000 IP 127.0.0.1.8000 > 127.0.0.1.54321: Flags [P.], seq 2000000001:2000000500, ack 1000000100, win 65535, length 499: HTTP: HTTP/1.0 200 OK
    

    Read it line by line: the first three lines are the TCP three-way handshake — SYN, SYN-ACK, ACK — proving the connection opened. The fourth line is the request itself, and because -A prints payload as ASCII you can read GET / HTTP/1.1 directly in the capture. The fifth line is the server answering 200 OK. The length field is the payload size, and seq/ack let you follow which bytes belong to which part of the conversation.

    Try it again with -X instead of -A to see the same request as hex plus ASCII, and with port 8000 removed to see how much background localhost traffic appears — that contrast is the best lesson in why filters matter.

    Reading Tcpdump Output Like a Pro

    One output line carries a surprising amount of information once you know its shape:

    22:15:30.123456 IP 192.168.1.100.54321 > 93.184.216.34.80: Flags [S], seq 123456789, win 65535, length 0
    

    From left to right: the timestamp (with microseconds), the protocol (IP), the source address and port (192.168.1.100.54321), the direction arrow, the destination address and port (93.184.216.34.80), the TCP flags, the sequence number, the advertised window, and the payload length. A length 0 packet with [S] is a connection attempt, not data — it is the handshake, and on a scan you will see many of them with no reply.

    Flags: [S] = SYN, [S.] = SYN-ACK, [.] = ACK, [P] = PUSH, [F] = FIN, [R] = RST.

    Control the output with the verbosity and timestamp flags:

    # Quiet: less protocol detail
    sudo tcpdump -i eth0 -q
    
    # Verbose: TTL, IP ID, options, and more
    sudo tcpdump -i eth0 -v
    
    # Very verbose: full protocol decode
    sudo tcpdump -i eth0 -vv
    
    # Readable date and time instead of bare clock time
    sudo tcpdump -i eth0 -tttt
    
    # Time between packets (great for spotting delays)
    sudo tcpdump -i eth0 -ttt
    
    # Absolute sequence numbers (default is relative)
    sudo tcpdump -i eth0 -S
    

    For payload inspection, -A prints ASCII (readable for HTTP, DNS names, and cleartext protocols), -X prints hex plus ASCII (the choice when the payload is binary), and -XX adds the link-level header on top. Modern tcpdump defaults to a 262,144-byte snapshot length, so packets are rarely truncated; on older builds, if you see [|tcp] truncation markers, raise it with -s 65535.

    Advanced Tcpdump Options

    Beyond the everyday flags, a few options solve specific problems:

    # Full packets, never truncated
    sudo tcpdump -i eth0 -s 0
    
    # Line-buffered output so grep sees packets immediately
    sudo tcpdump -i eth0 -l | grep "192.168.1.100"
    
    # Rotate the capture file every 60 seconds
    sudo tcpdump -i eth0 -G 60 -w capture-%Y-%m-%d_%H-%M-%S.pcap
    
    # Rotate at 100 MB, keep at most 5 files
    sudo tcpdump -i eth0 -C 100 -W 5 -w capture.pcap
    
    # Bigger kernel buffer to avoid dropped packets (size in KiB)
    sudo tcpdump -i eth0 -B 4096
    
    # Show the Ethernet header (MAC addresses)
    sudo tcpdump -i eth0 -e
    
    # Capture on all interfaces and save with timestamps in the filename
    sudo tcpdump -i any -nn -tttt -w all-traffic.pcap
    

    Rotation (-G, -C, -W) is what makes long captures safe: without it, a forgotten capture fills the disk. The %Y-%m-%d patterns in -w filenames are strftime formats, so each rotated file gets its own timestamped name automatically.

    Saving Captures and Analyzing Them in Wireshark

    The save-first workflow is the professional default: capture to a file, then analyze without time pressure.

    # Save 1000 packets to a file
    sudo tcpdump -i eth0 -w output.pcap -c 1000
    
    # Read the file back with a filter applied
    tcpdump -r output.pcap -nn port 443
    
    # Carve a subset into a new file
    tcpdump -r output.pcap -w web-only.pcap port 80
    
    # Count packets per host from a saved capture
    tcpdump -r output.pcap -nn | awk '{print $3}' | sort | uniq -c | sort -nr | head
    

    Reading a pcap needs no root privileges, so you can analyze captures on a different machine from the one that recorded them. The same file opens directly in Wireshark — drag it in, or open it from the File menu — where you get protocol dissection, stream following (Follow > TCP Stream), and statistics. tshark -r output.pcap gives you the same dissection from the command line. Keep the original pcap: it is the evidence, and every filtered view you make should be a new file derived from it.

    Tcpdump vs Wireshark vs TShark

    ToolInterfaceBest forBPF filtersScripting
    tcpdumpCommand lineQuick captures, servers, headless hostsYesYes
    WiresharkGraphicalDeep analysis, streams, statisticsYesNo
    TSharkCommand lineScripted analysis, same dissection as WiresharkYesYes

    Use tcpdump when you need to capture fast on a machine with no screen — a server, a router, a Kali box over SSH. Use Wireshark when you need to understand a capture: its protocol trees, colour rules, and stream views beat raw text for anything complicated. Use TShark when you want Wireshark's dissection inside a script, or on Windows where tcpdump does not run natively. Most practitioners use all three: tcpdump to capture, Wireshark to understand, tshark to automate.

    Tcpdump Commands Cheat Sheet

    TaskCommand
    List interfacestcpdump -D
    Capture on an interfacesudo tcpdump -i eth0
    Capture on all interfacessudo tcpdump -i any
    Capture localhost onlysudo tcpdump -i lo
    Capture 10 packets then stopsudo tcpdump -i eth0 -c 10
    Capture without DNS lookupssudo tcpdump -i eth0 -nn
    Save to a pcap filesudo tcpdump -i eth0 -w capture.pcap
    Read a pcap filetcpdump -r capture.pcap
    Read with a filtertcpdump -r capture.pcap port 443
    Filter by hostsudo tcpdump -i eth0 host 192.168.1.100
    Filter by source hostsudo tcpdump -i eth0 src host 10.0.0.1
    Filter by destination hostsudo tcpdump -i eth0 dst host 93.184.216.34
    Filter by portsudo tcpdump -i eth0 port 80
    Filter by port rangesudo tcpdump -i eth0 portrange 8000-8100
    Filter by protocolsudo tcpdump -i eth0 tcp
    Filter UDP, ICMP, ARPsudo tcpdump -i eth0 udp icmp arp
    Filter by subnetsudo tcpdump -i eth0 net 192.168.1.0/24
    Combine filterssudo tcpdump -i eth0 tcp and port 80
    Exclude trafficsudo tcpdump -i eth0 not arp and not icmp
    SYN packets onlysudo tcpdump -i eth0 'tcp[tcpflags] & tcp-syn != 0'
    Show ASCII payloadsudo tcpdump -i eth0 -A port 80
    Show hex + ASCIIsudo tcpdump -i eth0 -X port 443
    Verbose outputsudo tcpdump -i eth0 -v
    Full date and timesudo tcpdump -i eth0 -tttt
    Full packetssudo tcpdump -i eth0 -s 0
    Line-buffered for grepsudo tcpdump -i eth0 -l | grep 192.168.1.100
    Rotate every 60 secondssudo tcpdump -i eth0 -G 60 -w cap-%H-%M-%S.pcap
    Rotate at 100 MBsudo tcpdump -i eth0 -C 100 -W 5 -w cap.pcap
    DNS queries onlysudo tcpdump -i eth0 udp port 53
    Ping traffic onlysudo tcpdump -i eth0 icmp
    SSH traffic onlysudo tcpdump -i eth0 port 22
    Packets over 1000 bytessudo tcpdump -i eth0 greater 1000

    Troubleshooting Tcpdump Problems

    ProblemLikely causeFix
    You don't have permission to capture on that deviceNo root or capabilityRun with sudo, or grant cap_net_raw with setcap
    tcpdump: no suitable device foundNo usable interface or no permissionRun with sudo; check tcpdump -D lists interfaces
    tcpdump: eth0: No such device existsWrong interface nameList interfaces with tcpdump -D and use the exact name
    command not found: tcpdumpNot installedInstall per your OS (see Installing Tcpdump)
    Capture shows no packetsWrong interface, or filter too narrowTry -i any, then drop the filter and add it back piece by piece
    Output is very slowDNS lookups on every packetAdd -nn to disable hostname and port resolution
    packets dropped by kernelCapture buffer too small for the traffic rateTighten the filter, or raise the buffer with -B 4096
    Empty pcap fileCapture stopped before any matching packet arrivedCheck the filter matches real traffic; capture without -c for longer
    listening on eth0 then nothingQuiet network, or the filter excludes everythingGenerate traffic (ping, curl) and confirm the interface carries it

    Common Mistakes

  • Capturing on the wrong interface. The default interface is not always the one carrying your traffic. Always confirm with tcpdump -D first.
  • Forgetting -nn. Without it, every packet triggers DNS lookups, output crawls, and the capture itself can fall behind.
  • Capturing without a filter on a busy network. Unfiltered captures generate huge files and hide the packets you care about. Filter first, broaden later.
  • Forgetting sudo. Packet capture needs raw socket access. The permission error is the most common first-run failure.
  • Capturing on the wrong side of NAT. An address you see on the LAN is not the address the internet sees. Know which side of the router you are on before concluding anything.
  • Expecting to read encrypted traffic. HTTPS payloads are encrypted; tcpdump shows IPs, ports, and the TLS handshake (including the SNI hostname), not the page content.
  • Letting captures run without rotation. An unrotated -w file on a busy interface fills the disk. Use -G or -C for anything longer than a few minutes.
  • Best Practices

  • Filter first, broaden later. Start narrow, confirm you see the traffic, then widen the filter.
  • Save first, analyze later. Capture to a pcap, then read it back with different filters or in Wireshark.
  • Always use -nn. Name resolution slows captures and can change what you see. Resolve names afterwards if you need them.
  • Use -s 0 for full packets. Truncated packets hide payloads; modern defaults are generous, but verify on older builds.
  • Rotate long captures. -G or -C with -W keeps disk usage bounded.
  • Document the capture. Note the interface, filter, time, and purpose in the filename or a notes file — a pcap without context is hard to trust later.
  • When Not to Use Tcpdump

    Tcpdump cannot read encrypted payloads, so it will not show you the contents of an HTTPS session, a VPN tunnel, or an SSH connection — only their metadata. On very high-speed links it drops packets unless the filter is tight and the buffer is large, so it is the wrong tool for full-rate capture on a gigabit backbone (use a dedicated tap or a capture appliance). And the legal boundary is absolute: capture only traffic on systems you own or have written permission to test. Intercepting traffic on a network you do not control is illegal in most jurisdictions, including India under the IT Act — the lab-only framing in this guide is not optional.

    Keep Learning

  • Wireshark Guide
  • Linux Networking Basics
  • Nmap Beginner Tutorial
  • Ports and Protocols
  • Network Scanning with Nmap for Beginners
  • Wireshark
  • Nmap
  • Netcat
  • Summary

    Tcpdump is the standard command-line packet capture tool. Key techniques include BPF filters, saving to files, and understanding output format. The workflow is always the same: list interfaces, capture with a tight filter, save to a pcap, and analyze afterwards — in tcpdump, tshark, or Wireshark. Learn the six-step workflow, the BPF primitives, and the cheat sheet in this guide, and you can answer "what actually crossed the wire?" for almost any network problem.

    Knowledge Check

  • What does -nn do?
  • How do you filter for HTTP traffic?
  • What do [S], [S.], [.] represent?
  • What is the difference between -w and -r?
  • Why use BPF filters on busy networks?
  • How do you list the interfaces tcpdump can capture on?
  • Why does tcpdump show the TLS handshake but not the contents of an HTTPS session?
  • What does -G 60 do when combined with -w?
  • Answers: 1. It disables both hostname and port number resolution, so output shows raw IPs and port numbers and no DNS lookups slow the capture. 2. Use sudo tcpdump -i eth0 port 80 (or tcp and port 80); for HTTPS use port 443, but the payload will be encrypted. 3. [S] is SYN (connection start), [S.] is SYN-ACK, [.] is ACK — the three packets of the TCP handshake. 4. -w writes packets to a pcap file, -r reads packets back from a pcap file for display or analysis. 5. Unfiltered captures on busy networks generate massive files and include irrelevant traffic; BPF filters capture only matching packets. 6. Run tcpdump -D, which lists every available interface with its number. 7. HTTPS encrypts the payload, so tcpdump sees only metadata — IPs, ports, and the TLS handshake including the SNI hostname — not the page content. 8. It rotates the output file every 60 seconds, writing each interval to a new timestamped file.

    Frequently Asked Questions

    What is tcpdump?

    tcpdump is a command-line packet capture tool that uses libpcap to intercept and display network traffic. It supports BPF (Berkeley Packet Filter) syntax for precise filtering and is pre-installed on Kali Linux.

    Why do I need root to run tcpdump?

    Capturing raw network packets requires access to the network interface at the data link layer, which needs root privileges. Run sudo tcpdump or add capabilities with setcap cap_net_raw+ep /usr/bin/tcpdump for non-root capture.

    What does the -nn flag do?

    The -nn flag disables both hostname and port number resolution. Without it, tcpdump performs DNS lookups for every IP and resolves port numbers to service names, which slows capture significantly on busy networks.

    How do you filter HTTP traffic with tcpdump?

    Use sudo tcpdump -i eth0 port 80 to capture HTTP traffic. For more precision, combine with protocol filters: tcpdump -i eth0 tcp and port 80. For HTTPS, filter port 443 instead since the HTTP layer is encrypted.

    What do the TCP flags [S], [S.], [.] mean?

    [S] is a SYN (connection start), [S.] is SYN-ACK (acknowledgment of SYN), [.] is ACK (acknowledgment), [P] is PSH (data push), [F] is FIN (connection close), and [R] is RST (connection reset). These flags reveal the TCP handshake state.

    What is the difference between -w and -r?

    The -w flag writes captured packets to a file in pcap format (e.g., tcpdump -w capture.pcap), while -r reads a pcap file for display or analysis (e.g., tcpdump -r capture.pcap). Saving to files preserves full packet data.

    Why use BPF filters on busy networks?

    Unfiltered captures on busy networks generate massive files and include irrelevant traffic. BPF filters like host 10.0.0.5 and port 445 capture only traffic matching specific IPs, ports, or protocols, keeping capture files manageable.

    How do you capture and save packets to a file?

    Use sudo tcpdump -i eth0 -w output.pcap -c 1000 to capture 1000 packets and save them. The pcap file can then be opened in Wireshark for detailed protocol analysis or read back with tcpdump -r output.pcap.

    What is the difference between tcpdump and Wireshark?

    tcpdump is a command-line tool ideal for remote servers, automated monitoring, and headless environments. Wireshark provides a graphical interface with protocol dissection, stream following, and statistics. Use tcpdump for capture, Wireshark for analysis.

    How do you capture traffic on a specific interface?

    Use sudo tcpdump -i eth0 to capture on a specific interface. Run tcpdump -D to list available interfaces, or use -i any to capture on all interfaces simultaneously, which is useful for initial discovery.

    How do I install tcpdump on Kali Linux?

    Tcpdump comes pre-installed on Kali Linux — verify it with tcpdump --version. If it is missing, run sudo apt update && sudo apt install tcpdump. On Debian/Ubuntu use the same apt command, on Fedora/RHEL use sudo dnf install tcpdump, and on macOS use brew install tcpdump (you still need sudo to capture).

    Can tcpdump capture HTTPS traffic?

    Yes, but only the metadata. Tcpdump captures the encrypted packets — source and destination IPs, ports, and the TLS handshake, including the SNI hostname — but the HTTP request and response bodies are encrypted and unreadable. To inspect HTTPS content you need the session keys or a TLS-intercepting proxy in a lab you control.

    How do I capture packets on all interfaces at once?

    Use sudo tcpdump -i any on Linux. The any pseudo-device listens on every interface at once, which is handy for a first look, but the same packet can appear twice when it crosses two interfaces, so switch to a named interface (-i eth0) once you know where the traffic flows.

    Why is tcpdump showing no packets?

    Usually the wrong interface, a filter that is too narrow, or no traffic to capture. Check with tcpdump -D that you picked the right interface, try -i any, then drop the filter entirely and add it back piece by piece. Generate traffic with ping or curl while capturing, and make sure you ran it with sudo.

    What is the difference between tcpdump and tshark?

    Both are command-line packet tools that share BPF filter syntax and pcap files. Tcpdump is smaller, faster, and pre-installed on Kali, ideal for quick captures on servers. TShark is Wireshark's command-line twin: it dissects protocols in far more detail, so it is better for deep analysis and scripting, and it is the option on Windows where tcpdump does not run natively.

    Continue Learning

    Tools · Beginner

    How to Use Dirb: Beginner's Guide to Directory Brute-Forcing in Kali Linux

    Learn how to use Dirb in Kali Linux: run your first directory scan, pick the right wordlist, and read the results — with a worked example and cheat sheet.

    Tools · Beginner

    How to Use FFUF: Beginner's Guide to Fast Web Fuzzing in Kali Linux

    Learn how to use FFUF in Kali Linux — directory, subdomain and vhost fuzzing, parameter testing, filters and a worked DVWA example, with a cheat sheet.

    Tools · Beginner

    How to Use Gobuster: Beginner's Guide to Directory, DNS & VHost Enumeration in Kali Linux

    Learn how to use Gobuster in Kali Linux — dir, DNS and vhost modes, wordlists, and a worked DVWA example, with a cheat sheet and troubleshooting.

    Tools · Beginner

    How to Use Netcat: Beginner's Guide to the nc Command in Kali Linux

    How to use Netcat (nc) in Kali Linux: test ports, run a listener, grab banners, transfer files, and catch a reverse shell — worked example and cheat sheet.

    Related Security Tools

    Sniffing & Spoofing

    tcpdump

    tcpdump is a powerful, lightweight command-line packet analyzer that allows users to capture, parse, and filter TCP/IP and other packets transmitted or received over a network.

    Sniffing & Spoofing

    Wireshark

    Wireshark tutorial for beginners: capture packets, read the three panes, filter traffic and follow TCP streams — a hands-on guide to the world's foremost network protocol analyzer.

    Sniffing & Spoofing

    Netcat

    Learn how to use Netcat (nc) in Kali Linux to open a TCP or UDP connection, check a port, and see what a service sends back. Follow the examples to send your first message, inspect HTTP and SMTP responses, and transfer a test file without exposing sensitive data.

    Wireless Attacks

    Wifite

    Learn how to use Wifite in Kali Linux with this beginner tutorial: check your WiFi adapter, install Wifite, run your first authorized WiFi audit, capture WPA handshakes and PMKIDs, and crack them with a wordlist. Includes Wifite commands, a worked example, troubleshooting for common errors, and how Wifite compares with Aircrack-ng.

    Written by GO KALI FREE Team