All pages
Powered by GitBook
1 of 1

Loading...

Wireshark

Wireshark Comprehensive Guide & Cheat Sheet

Wireshark is the world’s most popular open-source network protocol analyzer, used for network troubleshooting, analysis, software and protocol development, and education. This guide provides a thorough overview, practical tips, and a quick-reference cheat sheet to help you master Wireshark.


What is Wireshark?

Wireshark is a powerful, open-source network protocol analyzer that captures and displays data packets traveling through a network in real time or from saved files. It is widely used by network administrators, security professionals, and developers for troubleshooting, security analysis, and protocol development .

Key Features:

  • Cross-platform (Windows, macOS, Linux)

  • Live capture and offline analysis

  • Deep inspection of hundreds of protocols

  • Powerful filtering capabilities

  • User-friendly graphical interface

  • Modular, extensible architecture

Wireshark 3.6 Screenshot


Installation & System Requirements

Windows

  • Requirements: Windows 10 or later, 1 GHz CPU, 2 GB RAM, 16–20 GB disk space

  • Install: Download from wireshark.org, run installer, follow prompts .

Linux

  • Requirements: Compatible kernel, 2 GB RAM, sufficient disk space, root/sudo access

  • Install: Use package manager (e.g., sudo apt install wireshark), configure permissions for non-root capture .

macOS

  • Requirements: Supported macOS version, 2 GB RAM, sufficient disk space

  • Install: Download from website or use Homebrew (brew install wireshark) .

Note: Ensure your network interface supports promiscuous mode for full packet capture.


User Interface Overview

Wireshark’s interface is designed for efficient navigation and analysis:

  • Main Menu Bar: File, Edit, View, Go, Capture, Analyze, Statistics, Help .

  • Main Toolbar: Quick access to start/stop capture, open/save files, apply filters.

  • Filter Toolbar: Enter display filters to refine packet view .

  • Interface List: Select network interface for capture.

  • Packet List Pane: Shows captured packets (number, time, source, destination, protocol, info).

  • Packet Details Pane: Hierarchical breakdown of selected packet’s protocol layers .

  • Packet Bytes Pane: Raw packet data in hexadecimal .


Fundamental Concepts & Architecture

  • Packet Analysis: Captures and dissects network packets, showing headers, payloads, and protocol details .

  • Network Sniffing: Intercepts and logs network traffic for analysis.

  • Open Source: Free, community-driven, extensible.

  • Modular Architecture: Capture engine (pcap), protocol dissectors, GUI .


Packet Capture Techniques

  • Promiscuous Mode: Captures all packets on the network segment.

  • Monitor Mode: For wireless networks, captures all wireless traffic .

  • Start/Stop Capture: Select interface, click the shark fin icon to start, red square to stop.

  • Save/Export: Save captures as .pcap files for later analysis.


Filters: Capture & Display

Capture Filters

  • Set before capture to limit what is recorded.

  • Syntax: Based on libpcap (tcpdump) language.

  • Examples:

    • Capture only HTTP: tcp port 80

    • Capture traffic from IP: host 192.168.1.1

    • Capture only TCP: tcp

  • Set in: Capture Options dialog .

Display Filters

  • Set after capture to refine what is shown.

  • Syntax: Wireshark-specific, more flexible.

  • Examples:

    • Show packets from IP: ip.addr == 192.168.1.1

    • Show DNS traffic: dns

    • Show TCP SYN packets: tcp.flags.syn == 1

  • Apply in: Filter toolbar .


Protocol Analysis Features

  • Packet Dissection: View protocol layers and fields in detail.

  • Protocol Decoding: Human-readable decoding for hundreds of protocols.

  • Filtering: Both capture and display filters for focused analysis.

  • Statistics Tools: Protocol hierarchy, conversations, endpoints, IO graphs.

  • Expert Information: Highlights errors, warnings, and protocol violations .


Common Analysis Scenarios

  • Troubleshooting: Diagnose slow networks, dropped connections, misconfigurations.

  • Security Analysis: Detect unauthorized access, malware, data exfiltration.

  • Performance Optimization: Identify bottlenecks, excessive retransmissions.

  • Compliance Verification: Ensure protocol standards are followed.

  • Protocol Development: Test and debug new or modified protocols .


Troubleshooting Best Practices

  1. Identify the Problem: Gather logs, error messages, user reports .

  2. Determine Scope: Isolate affected systems or segments .

  3. Establish Theory: Hypothesize likely causes based on symptoms .

  4. Test Theory: Use Wireshark to confirm or refute hypotheses .

  5. Propose & Test Solution: Implement fixes, monitor results.

  6. Collect Sufficient Data: Replicate issues, ensure enough packet data is captured.

  7. Use Actionable Filters: Apply specific filters to focus on relevant traffic.

  8. Analyze Patterns: Look for anomalies, repeated errors, or protocol violations .


Keyboard Shortcuts & Quick Reference

Action
Shortcut (Windows/Linux)
Shortcut (macOS)

Start Capture

Ctrl+E

Cmd+E

Stop Capture

Ctrl+E

Cmd+E

Open File

Ctrl+O

Cmd+O

Save Capture

Ctrl+S

Cmd+S

Find Packet

Ctrl+F

Cmd+F

Go to Packet

Ctrl+G

Cmd+G

Next Packet

↓

↓

Previous Packet

↑

↑

Expand All

*

*

Collapse All

-

-

Apply Display Filter

Ctrl+L

Cmd+L

Clear Display Filter

Ctrl+Shift+L

Cmd+Shift+L

Mark Packet

Ctrl+M

Cmd+M

Unmark All Packets

Ctrl+Shift+M

Cmd+Shift+M

Colorize Conversation

Ctrl+H

Cmd+H


Real-World Applications & Case Studies

  • Network Forensics: Analyzing malware (e.g., Zeus Botnet), reconstructing attacks.

  • CTF Challenges: Used in security competitions for traffic analysis.

  • Malware Traffic Analysis: Identifying command-and-control traffic, data exfiltration.

  • DNS Troubleshooting: Diagnosing resolution failures, cache poisoning.

  • Real-Time Forensics: Portable Wireshark setups for incident response.

  • Performance Analysis: Identifying latency, retransmissions, and bottlenecks .


Cheat Sheet

Common Capture Filters (set before capture)

  • Only TCP: tcp

  • Only UDP: udp

  • Only HTTP: tcp port 80

  • Only traffic from IP: host 192.168.1.1

  • Only traffic to/from subnet: net 192.168.1.0/24

  • Only traffic to port: port 443

Common Display Filters (set after capture)

  • All HTTP: http

  • All DNS: dns

  • Source IP: ip.src == 192.168.1.1

  • Destination IP: ip.dst == 10.0.0.5

  • TCP SYN packets: tcp.flags.syn == 1

  • TCP retransmissions: tcp.analysis.retransmission

  • Show only errors: tcp.analysis.flags && !tcp.analysis.ack_rtt

Useful Statistics Tools

  • Protocol Hierarchy: Statistics > Protocol Hierarchy

  • Conversations: Statistics > Conversations

  • Endpoints: Statistics > Endpoints

  • IO Graphs: Statistics > IO Graphs

Tips

  • Coloring Rules: Use to highlight traffic types (View > Coloring Rules).

  • Profiles: Create profiles for different analysis scenarios (Edit > Configuration Profiles).

  • Expert Info: Use for quick error/warning overview (Analyze > Expert Information).


Additional Resources

  • Wireshark Official Documentation

  • Wireshark Display Filter Reference

  • Wireshark User’s Guide (PDF)


By mastering these concepts, techniques, and shortcuts, you can leverage Wireshark for everything from basic troubleshooting to advanced network forensics and security analysis. Wireshark’s flexibility and depth make it an indispensable tool for anyone working with networks .