Wireshark Tutorial 2026 — Packet Analysis for Beginners

·

Wireshark is the world's most popular network protocol analyser. It captures network packets in real time and displays them in a human-readable format, letting you inspect every byte of traffic between hosts. Security analysts, network engineers, and penetration testers use it daily to diagnose network issues and detect threats.

This guide takes you from installation through live capture, display filters, HTTP and DNS analysis, following TCP streams, extracting files from pcap captures, and identifying malware indicators in network traffic — all with real filter examples you can use immediately.

◈ Table of Contents

01 What is Wireshark 02 Installation 03 Capture Interfaces & Filters 04 Display Filters — Complete Reference 05 HTTP Traffic Analysis 06 Following TCP/UDP Streams 07 DNS Analysis 08 Detecting Malware in Traffic
📷

01 — WHAT IS WIRESHARK & HOW IT WORKS

BEGINNER
01
Wireshark Architecture & Packet Flow
Overview

Wireshark uses pcap (on Linux/macOS) or Npcap (on Windows) to capture raw packets from network interfaces. It then dissects each packet through protocol dissectors that decode every layer — Ethernet, IP, TCP/UDP, and application-layer protocols like HTTP, DNS, and TLS.

Core Wireshark Components
  • Capture engine — uses libpcap/Npcap to capture raw frames from NICs
  • Protocol dissectors — decode 3000+ protocols automatically
  • Display filters — filter the view without re-capturing packets
  • Capture filters — limit what gets captured at the kernel level (BPF syntax)
  • Stream analysis — reassemble TCP/UDP streams into readable conversations
  • Statistics engine — conversations, endpoints, protocol hierarchy, I/O graphs
💾

02 — INSTALLATION

BEGINNER
01
Install on Kali, Ubuntu, Windows & macOS
Install

Wireshark is pre-installed on Kali Linux. On other systems, install from the official repository or wireshark.org. Root/admin privileges are needed to capture live traffic.

KALI LINUX
# Launch Wireshark GUI wireshark # Or command-line capture with tshark tshark -i eth0 -w capture.pcap
UBUNTU / DEBIAN
sudo apt update && sudo apt install wireshark -y # When prompted: select YES to allow non-superusers to capture sudo usermod -aG wireshark $USER newgrp wireshark
WINDOWS
# Download from: https://www.wireshark.org/download.html # The installer includes Npcap driver (required for capture) # Run as Administrator for live capture
MACOS
brew install --cask wireshark # Or download .dmg from wireshark.org
🌐

03 — CAPTURE INTERFACES & CAPTURE FILTERS

BEGINNER
01
Starting a Capture & Capture Filters (BPF)
Capture

When you launch Wireshark, the Welcome screen shows all available network interfaces with a live traffic sparkline. Double-click any interface to start capturing. Capture filters (BPF syntax) are applied before packets enter Wireshark — they reduce overhead but can't be changed without restarting the capture.

◈ Starting Your First Capture
  • 1
    Open Wireshark → select your active interface (eth0, wlan0, Wi-Fi) — the one with the traffic sparkline
  • 2
    Optionally enter a capture filter in the box (BPF syntax — see below)
  • 3
    Click the blue shark fin button (or Ctrl+E) to start capturing
  • 4
    Generate some traffic: browse a website, ping a host
  • 5
    Click the red square to stop. Use File → Save As to save as .pcap or .pcapng
CAPTURE FILTERS (BPF SYNTAX)
# Capture only HTTP traffic (port 80) port 80 # Capture HTTP and HTTPS port 80 or port 443 # Capture traffic to/from specific host host 192.168.1.100 # Capture only TCP traffic from a source src host 192.168.1.50 and tcp # Capture DNS queries port 53 # Capture non-ARP, non-DNS (general traffic) not port 53 and not arp # Command line capture with tshark sudo tshark -i eth0 -f "port 80" -w http_capture.pcap

Capture filters (BPF) run before packets reach Wireshark — use them to reduce file size during large captures. Display filters run after capture and can be changed anytime without losing data. Learn both: capture filters for performance, display filters for analysis.

📊

04 — DISPLAY FILTERS — COMPLETE REFERENCE

BEGINNER → INTERMEDIATE
01
Display Filter Syntax & Essential Filters
Filters

Display filters use Wireshark's own filter language, which is different from BPF capture filters. They filter the packet list view in real time. The filter bar turns green for valid syntax, red for invalid, and yellow for dubious.

PROTOCOL FILTERS
# Show only HTTP traffic http # Show only DNS dns # Show only TCP tcp # Show only ICMP (ping) icmp # Show only ARP arp # Show TLS (encrypted HTTPS) tls
IP ADDRESS FILTERS
# Traffic to or from specific IP ip.addr == 192.168.1.100 # Traffic FROM specific IP ip.src == 192.168.1.100 # Traffic TO specific IP ip.dst == 192.168.1.100 # Exclude specific IP ip.addr != 192.168.1.1 # Traffic within a subnet ip.addr == 192.168.1.0/24
PORT FILTERS
# Traffic on specific TCP port tcp.port == 80 tcp.port == 443 # Traffic from source port tcp.srcport == 4444 # Traffic to destination port tcp.dstport == 22 # UDP port udp.port == 53
COMBINING FILTERS (AND / OR / NOT)
# HTTP traffic from specific source http and ip.src == 192.168.1.50 # HTTP or DNS http or dns # All traffic EXCEPT DNS and ARP not dns and not arp # TCP SYN packets only (connection attempts) tcp.flags.syn == 1 and tcp.flags.ack == 0 # TCP RST packets (connection resets) tcp.flags.rst == 1 # Packets containing specific string frame contains "password" http contains "login"
Comparison Operators
  • == (eq) — equals
  • != (ne) — not equals
  • > (gt) — greater than
  • < (lt) — less than
  • contains — string search in packet data
  • matches — regex match
🌐

05 — HTTP TRAFFIC ANALYSIS

INTERMEDIATE
01
Analysing HTTP Requests & Responses
HTTP

HTTP analysis is one of Wireshark's most powerful features. You can see every GET/POST request, response code, headers, and body — including credentials sent over unencrypted connections.

KEY HTTP DISPLAY FILTERS
# All HTTP requests http.request # Only GET requests http.request.method == "GET" # Only POST requests (may contain credentials) http.request.method == "POST" # HTTP responses with error codes http.response.code == 401 # unauthorized http.response.code == 403 # forbidden http.response.code == 500 # server error # Find requests to specific URI http.request.uri contains "/login" http.request.uri contains "/admin" # Find credentials in HTTP body http.request.method == "POST" and http contains "password" # Show only HTTP headers (no body) http.request or http.response
◈ Extracting Objects from HTTP Traffic
  • 1
    Capture HTTP traffic or open a pcap file
  • 2
    Go to File → Export Objects → HTTP
  • 3
    See a list of all transferred files: images, scripts, executables, documents
  • 4
    Select any file → Save to extract it from the pcap
  • 5
    Use this to recover malware samples, documents, or credentials from captured traffic
🔄

06 — FOLLOWING TCP & UDP STREAMS

BEGINNER
01
Reassemble & Read Full Conversations
Streams

Individual packets are hard to read in context. "Follow Stream" reassembles the full TCP or UDP conversation into a human-readable view, showing both sides of the exchange in colour — client (red) and server (blue).

◈ Following a TCP Stream
  • 1
    Filter to the traffic of interest: http or tcp.port == 22
  • 2
    Right-click any packet in the conversation → Follow → TCP Stream
  • 3
    A window opens showing the full conversation — red = client sent, blue = server response
  • 4
    Use the dropdown at the bottom to switch between stream views: ASCII, Raw, Hex, C Arrays
  • 5
    Click Close — Wireshark auto-applies a display filter to show only packets from that stream
STREAM DISPLAY FILTER (AUTO-GENERATED)
# Wireshark generates this filter when you follow a stream tcp.stream eq 5 # stream number 5 # Navigate between streams tcp.stream eq 0 tcp.stream eq 1 # ... increment to move between conversations

Use Follow → UDP Stream for DNS, SNMP, and Syslog analysis. Use Follow → HTTP Stream for reassembled web requests including compressed or chunked bodies. For TLS traffic, configure the (Pre-)Master Secret log to decrypt it: Edit → Preferences → Protocols → TLS → (Pre)-Master-Secret log filename.

🌎

07 — DNS ANALYSIS

INTERMEDIATE
01
Inspecting DNS Queries & Responses
DNS

DNS is a goldmine for security analysis — it reveals what hosts are communicating with, C2 beaconing patterns, DNS tunnelling, and domain generation algorithm (DGA) activity. Every hostname lookup appears in DNS traffic even if the subsequent connection is encrypted.

DNS DISPLAY FILTERS
# All DNS traffic dns # Only DNS queries (questions) dns.flags.response == 0 # Only DNS responses dns.flags.response == 1 # Queries for a specific domain dns.qry.name contains "example.com" # DNS failures (NXDOMAIN — non-existent domain) dns.flags.rcode == 3 # Large DNS responses (possible DNS tunnelling) dns and frame.len > 512 # DNS TXT records (often used for exfiltration) dns.qry.type == 16 # DNS MX record queries dns.qry.type == 15
🚨

08 — DETECTING MALWARE IN NETWORK TRAFFIC

INTERMEDIATE
01
Malware Traffic Indicators in Wireshark
Threat Detection

Malware leaves distinctive patterns in network traffic. Knowing what to look for in Wireshark lets you quickly identify C2 communication, lateral movement, and data exfiltration in captured pcap files or live traffic.

IndicatorWireshark FilterWhat It Suggests
Periodic beaconingCheck I/O graph for regular spikes to single IPC2 heartbeat / RAT callback
DNS to random domainsdns.qry.name matches "[a-z]{12,}"DGA malware (Emotet, Dridex pattern)
Large DNS queriesdns and frame.len > 512DNS tunnelling / data exfiltration
Non-standard portstcp.port == 4444 or tcp.port == 1337Reverse shells, C2 callbacks
Base64 in HTTPhttp contains "=="Encoded payload / data exfiltration
Executable downloadshttp.response and http contains "MZ"Malware dropper delivering PE file
POST to long random URIhttp.request.method=="POST" and http.request.uri matches "[a-f0-9]{32}"C2 check-in with victim UUID
PRACTICAL ANALYSIS WORKFLOW
# Step 1: Get protocol hierarchy to see what's present Statistics > Protocol Hierarchy # Step 2: Check conversations for unusual IPs with high packet counts Statistics > Conversations > IPv4 (sort by packets) # Step 3: Filter for suspicious protocols not http and not dns and not arp and not icmp and tcp # Step 4: Look for scanning behaviour (SYN without ACK responses) tcp.flags.syn == 1 and tcp.flags.ack == 0 # Step 5: Check for cleartext credentials http.request.method == "POST" ftp contains "PASS" imap contains "LOGIN" pop contains "PASS"

Practice with malware pcap samples from malware-traffic-analysis.net — a free repository of real malware traffic captures with exercises and answers. Open them in Wireshark and work through identifying the infection chain, C2 server, and exfiltrated data.


⚠️

Only capture network traffic on networks you own or have explicit authorization to monitor. Unauthorized packet capture is illegal in most jurisdictions. Never capture traffic on corporate or public networks without written permission from the network owner.

◈ Stay Connected

Follow CyberHawk Threat Intel for network security tutorials, threat analysis, and professional SOC content.

🌐 Website ▶️ YouTube 𝕏 Twitter/X ♫ TikTok ✈️ Telegram
📝 Blog 📚 Courses 📋 SOPs 🔍 IOC Scanner

"They can't exploit you if you are the Exploit."