GO KALI FREE

Wireshark

Sniffing & Spoofing

Intermediatelow risk

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.

Client SYN sequence x, server SYN plus ACK sequence y acknowledging x plus one, and client ACK acknowledging y plus one establish an ordinary TCP connection.
TCP three-way handshakeConceptual active/passive open with no payload, loss or retransmission; not a packet capture. SYN consumes one sequence number; a pure ACK does not.Original conceptual diagram. On narrow screens, scroll the figure to read the labels.

Installation

sudo apt install wireshark

Basic Syntax

wireshark (GUI) or tshark (CLI)

Quick Facts

Full Name
Wireshark
License
GPL v2
Written In
C, C++
Platforms
Linux, Windows, macOS
Category
Network Protocol Analysis
Protocols
3000+ supported protocols
First Release
1998
Developer
Wireshark Foundation

Tool Overview

Wireshark is a network protocol analyzer. In this Wireshark tutorial, choose an interface you are authorised to monitor and capture a small amount of test traffic. Stop the capture, apply a display filter to find the packets you want to analyse, then inspect one packet, follow its TCP stream and save the capture.

Learning how to use Wireshark comes down to one workflow: start a capture, filter the packets, inspect them, follow the stream, and export what matters. Wireshark is the world's most widely used network protocol analyzer. It captures packets in real-time from live network interfaces or reads packet captures from saved files, providing detailed inspection of hundreds of protocols at every layer of the network stack.

For your first capture, use a wired client and a plain HTTP test page on another device you control. Select eth0, set the capture filter to tcp port 80, start the capture, load the page and stop. Enter http in the display filter bar and select a GET request. The top pane, Packet List, shows one summary row per visible packet. The middle pane, Packet Details, shows the decoded protocols and fields for the selected packet. The bottom pane, Packet Bytes, shows its raw bytes. Expand HTTP in Packet Details, then right-click the request in Packet List and choose Follow > TCP Stream to read the request and response together. Close the stream window, save the capture as capture.pcapng and choose File > Export Objects > HTTP to export the returned page separately.

The shortened, illustrative output below is in the style of tshark -i eth0 -c 5. The first three packets set up the TCP connection; the http display filter would show only the last two: 1 0.000000 192.168.1.10 → 192.168.1.20 TCP 51514 → 80 [SYN] 2 0.000294 192.168.1.20 → 192.168.1.10 TCP 80 → 51514 [SYN, ACK] 3 0.000346 192.168.1.10 → 192.168.1.20 TCP 51514 → 80 [ACK] 4 0.001089 192.168.1.10 → 192.168.1.20 HTTP GET / HTTP/1.1 5 0.002941 192.168.1.20 → 192.168.1.10 HTTP HTTP/1.1 200 OK

To install Wireshark in Kali Linux, run sudo apt install wireshark. If capture permissions are configured for the wireshark group, use an authorised account in that group to capture without running the GUI as root. On Windows, get the installer from the official Wireshark download page and install Npcap for live capture. On macOS with Homebrew, run brew install --cask wireshark and make sure the ChmodBPF helper is installed so your account can capture without running the app as root.

A capture filter controls what gets recorded. Set it before you start, using libpcap/BPF syntax: tcp port 80 keeps TCP packets with source or destination port 80, while host 192.168.1.1 keeps traffic to or from that address. A Wireshark display filter uses a different syntax and changes what you see without removing packets from the capture. Try http or dns to find packets decoded as those protocols, ip.addr == 192.168.1.1 to match an IPv4 address in either direction, or tcp.port == 443 to match a TCP port. To show only HTTP POST requests, use http.request.method == "POST". Clear a display filter to see the hidden packets again. You cannot recover packets that the capture filter excluded.

For an authorised capture of raw Wi-Fi frames, use an adapter that supports monitor mode. On Windows, you need both Npcap and a supported adapter. The wired eth0 exercise does not use monitor mode. If you prefer the terminal, tshark ships with Wireshark on Kali. Run tshark -D to list capture interfaces, or try the Kali example tshark -f "tcp port 80" -i eth0 for a live capture on eth0. To review the saved exercise instead, run tshark -r capture.pcapng -Y http. The -f flag takes a capture filter; -Y takes a display filter.

With support for over 3000 protocols, Wireshark is essential for network administrators, security professionals, and developers. Its powerful display filter language allows precise traffic isolation, while features like Follow TCP Stream, protocol hierarchy statistics, and IO graphs provide deep visibility.

Originally named Ethereal, Wireshark has been under continuous development since 1998. It supports live capture from Ethernet, Wi-Fi, Bluetooth, USB, and many other interface types, making it the universal tool for network traffic analysis.

Quick Reference Commands

Verified quick-reference commands for Wireshark
CommandPurpose
tshark -DList capture interfaces so you can choose the one that carries your test traffic.
tshark -f "tcp port 80" -i eth0Capture live TCP traffic to or from port 80 on eth0.
tshark -i eth0 -f "tcp port 80" -a duration:15 -w capture.pcapngCapture TCP port 80 traffic for 15 seconds and write it to capture.pcapng.
tshark -r capture.pcapng -Y httpRead a saved capture and show only packets decoded as HTTP.
tshark -r capture.pcapng -q -z follow,tcp,ascii,0Show TCP stream 0 in ASCII without printing the per-packet summaries.
Wireshark | Kali Linux Tools

Common Commands

wiresharkLaunch GUI - Open graphical interface
tshark -i eth0CLI capture - Command line capture
Filter: httpHTTP filter - Web traffic only
Filter: ip.addr == 192.168.1.1IP filter - Specific host
Filter: tcp.port == 443Port filter - Specific port
Filter: tcp.flags.syn == 1SYN packets - New connections
Filter: dnsDNS traffic - Name resolution
Filter: ftp || ftp-dataFTP traffic - File transfers
Filter: http.request.method == "POST"POST requests - Form submissions
Filter: http contains "password"Password search - Find creds
Filter: tcp.analysis.retransmissionRetransmissions - Network issues
Right-click > Follow > TCP StreamFollow stream - Full conversation
tshark -i eth0 -w capture.pcapSave capture - Write to file
tshark -r capture.pcap -Y "http"Read file - Filter saved capture
tshark -i eth0 -f "port 80"Capture filter - Capture only port 80
tshark -i eth0 -Y "http.request" -T fields -e http.host -e http.request.uriField extraction - Custom output
Filter: frame contains "secret"String search - Find in packets
Filter: tcp.stream eq 5Stream filter - Specific TCP stream
Filter: !(arp || icmp || dns)Exclude protocols - Hide noise
Filter: http.response.code >= 400Error responses - HTTP errors
tshark -i eth0 -a duration:60Timed capture - 60 seconds
tshark -i eth0 -b filesize:10000Ring buffer - Split by size
Filter: wlan.fc.type_subtype == 0x08WiFi beacons - AP announcements
Statistics > ConversationsConversations - Traffic stats
Statistics > Protocol HierarchyProtocol stats - Traffic breakdown
File > Export Objects > HTTPExport HTTP - Extract files
tshark -r capture.pcap -q -z io,phsProtocol hierarchy - Print a protocol breakdown from a file
tshark -r capture.pcap -q -z conv,tcpTCP conversations - Summarize traffic between endpoints
tshark -r capture.pcap -z follow,tcp,ascii,0Follow stream - Reassemble a TCP stream as ASCII
editcap -A '2026-01-01 00:00:00' in.pcap out.pcapTrim capture - Slice a PCAP by time window with editcap
mergecap -w merged.pcap a.pcap b.pcapMerge captures - Combine multiple PCAP files into one
dumpcap -i eth0 -w capture.pcapngHeadless capture - Record traffic to a file without opening the GUI
capinfos capture.pcapngCapture summary - Show packet count, duration and file details
wireshark -r capture.pcapngOpen capture - Load a saved file in the GUI without capturing

Step-by-Step Guide

  1. 1Get permission before you capture. For this Wireshark tutorial, use a client and a plain HTTP test server you control, on a network where you are authorised to capture traffic.
  2. 2Launch Wireshark as a non-root user with capture permissions. On Kali, use an authorised account in the wireshark group if capture access has been configured for that group.
  3. 3Open Capture > Options and select eth0 if it carries your test traffic. If eth0 is not listed or is not the right interface, select the one your client uses to reach the test server.
  4. 4In the capture filter field, enter tcp port 80. This records TCP traffic to or from port 80, including the packets that set up the connection.
  5. 5Click Start, then open the test page in the client's browser. Use plain HTTP on port 80 and a page that does not ask for credentials.
  6. 6Click Stop as soon as the page loads. Leave the capture open so you can inspect the exchange without collecting more traffic.
  7. 7Enter http in the display filter bar and press Enter. If no packets appear, check that your browser used plain HTTP on port 80 and that you captured on the correct interface.
  8. 8Select the GET request in Packet List and expand HTTP in Packet Details. Select a decoded field to highlight the corresponding bytes in Packet Bytes.
  9. 9Right-click the request and choose Follow > TCP Stream. Read the request and response for that connection together, then close the stream window.
  10. 10Choose File > Save As and save the capture as capture.pcapng. To save the returned test page as a separate file, choose File > Export Objects > HTTP and select the object from your test exchange.

Warnings

Use Cases

Network Troubleshooting

Identify network latency, packet loss, and connection issues by analyzing captured traffic patterns.

Protocol Analysis

Dissect and understand network protocols at every OSI layer with detailed field-level inspection.

Security Forensics

Investigate network security incidents by examining packet captures for malicious activity.

Bandwidth Monitoring

Analyze bandwidth usage patterns and identify which applications consume the most network resources.

Application Debugging

Debug application network behavior by examining exact request and response payloads.

Traffic Filtering

Use display filters to isolate specific traffic types, IP addresses, ports, or protocol fields.

Malware Traffic Analysis

Identify command-and-control communication, data exfiltration, and malicious network behavior in infected systems.

VoIP Call Inspection

Capture and reconstruct voice-over-IP calls, analyze SIP signaling, and verify call quality metrics.

Wireless Network Auditing

Monitor Wi-Fi beacon frames, probe requests, and deauthentication packets for wireless security assessments.

Compliance Verification

Verify that network traffic adheres to organizational security policies and regulatory compliance requirements.

Key Features

People Also Ask

How do I use Wireshark on Kali Linux?

Launch with 'sudo wireshark' from the terminal or Applications menu. Select a network interface and click the blue shark fin to start capturing. Use the display filter bar to narrow traffic — try 'http', 'ip.addr == 10.10.10.10', or 'tcp.port == 80'. Wireshark is pre-installed on Kali Linux.

What are Wireshark display filters?

Display filters narrow captured packets without re-capturing. Syntax: 'ip.addr == 10.10.10.10' for IP, 'tcp.port == 443' for port, 'http.request.method == POST' for HTTP methods, 'dns' for DNS, 'tcp.flags.syn == 1' for SYN packets. Combine with '&&' and '||' operators.

Wireshark vs tcpdump — which should I use?

Wireshark provides a GUI for interactive deep analysis with protocol dissection and stream following. tcpdump is a lightweight CLI tool ideal for remote servers, scripts, and headless captures. Use tcpdump for quick captures and Wireshark for detailed analysis.

How do I follow a TCP stream in Wireshark?

Right-click any packet in the stream → Follow → TCP Stream. This reconstructs the entire conversation in readable form. You can also Follow → HTTP Stream for web traffic. This is essential for reconstructing sessions, viewing transferred data, and analyzing authentication flows.

How do I install Wireshark on Linux?

On Kali Linux, it's pre-installed. On Ubuntu/Debian: 'sudo apt install wireshark'. During installation, allow non-root users to capture when prompted. On macOS: 'brew install --cask wireshark'. On Windows, download the installer from wireshark.org.

What is Wireshark used for?

Wireshark captures and analyzes network traffic at the packet level. It's used for network troubleshooting, security analysis, protocol debugging, forensics, and educational purposes. You can inspect every field of every packet across hundreds of protocols.

Related Tools

tcpdump

Sniffing & Spoofing

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.

Ettercap

Sniffing & Spoofing

Ettercap is a comprehensive suite for man-in-the-middle attacks. It features sniffing of live connections, content filtering, and active or passive dissection of many protocols.

Nmap

Information Gathering

Learn how to use Nmap, the free open-source network scanner: run your first port scan, discover live hosts, detect services and operating systems, and check for vulnerabilities with NSE scripts — a beginner tutorial for Kali Linux.

Burp Suite

Web Application

Burp Suite is the industry-standard web application security testing platform from PortSwigger, free as Community Edition on Kali Linux. Learn how to use Burp Suite: install it, route your browser through its proxy, intercept your first request, and test it with Repeater and Intruder.

Netcat

Sniffing & Spoofing

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.

arpspoof

Sniffing & Spoofing

arpspoof redirects packets from a target host on the LAN to another host by forging ARP replies. It is a simple and effective utility part of the dsniff suite.

Related Cybersecurity Guides

Tools · Beginner

Wireshark Guide: Network Protocol Analysis

Master Wireshark for network traffic capture, protocol analysis, filtering, and troubleshooting with practical examples.

Networking · Beginner

OSI Model Explained: The Seven Layers of Networking

Master the OSI model's seven layers, understand how each layer functions, learn real-world protocol examples, and use the model for troubleshooting.

Networking · Beginner

Networking Basics: Understanding TCP/IP, DNS, and Network Protocols

Learn the fundamentals of computer networking including the OSI model, TCP/IP protocol suite, IP addressing, subnetting, DNS, and network security essentials.

Networking · Intermediate

Firewall Fundamentals: Network Security and Configuration

Learn firewall types, architectures, rule configuration, and best practices for network security and traffic filtering.

Frequently Asked Questions

How do I use Wireshark on Kali Linux?

Start Wireshark with sudo wireshark (or capture from the terminal with tshark -i eth0), choose the interface you want to monitor, and start the capture. Generate or wait for the traffic you want to inspect, stop the capture, then use display filters such as http, dns or ip.addr == 192.168.1.1 to isolate it. Right-click any packet and choose Follow > TCP Stream to read a full conversation, and save the capture as a PCAP file for later analysis. Only capture traffic on networks you own or have explicit permission to test.

How do I download and install Wireshark on Kali Linux?

Wireshark comes pre-installed on most Kali Linux images. If it is missing, run sudo apt update && sudo apt install wireshark, and allow non-superusers to capture packets when the installer asks (or add your user to the wireshark group). On Windows and macOS, download the free installer from wireshark.org.

What is Wireshark used for?

Wireshark is a network protocol analyzer used for capturing and inspecting network packets in real-time. It is used for network troubleshooting, protocol development, security analysis, and education.

Can Wireshark decrypt HTTPS traffic?

Wireshark can decrypt HTTPS traffic if you have access to the SSL/TLS private keys (using SSLKEYLOGFILE) or if you configure a man-in-the-middle proxy.

Is Wireshark legal to use?

Wireshark itself is legal, but using it to capture traffic on networks without authorization violates privacy laws. Always obtain permission before capturing traffic on networks you do not own.

How is Wireshark different from tcpdump?

Both capture packets, but Wireshark provides a graphical interface with protocol dissection, color coding, and advanced filtering. tcpdump is a lightweight CLI tool suitable for scripting and remote captures.

What is the difference between capture filters and display filters?

Capture filters use BPF syntax and are applied during packet capture to reduce file size. Display filters use Wireshark's own syntax and are applied after capture to narrow down the displayed packets without re-capturing.

What file formats does Wireshark support?

Wireshark reads and writes PCAP and PCAPNG formats natively. It can also import captures from tcpdump, Network Monitor, and many other third-party packet capture tools and formats.

How do I follow a specific TCP conversation?

Right-click on any packet in the conversation and select Follow > TCP Stream (or UDP/HTTP Stream). This reconstructs the full payload data exchanged between the two endpoints.

Can Wireshark capture on remote machines?

Wireshark itself captures locally, but you can use SSH tunneling with remote tshark captures or the RPCAP protocol to capture packets on remote systems and analyze them in the Wireshark GUI.

How do I find passwords in a Wireshark capture?

Use display filters like http contains "password" or follow TCP streams to view plaintext credentials. Note that encrypted protocols like HTTPS will not reveal passwords without decryption keys.

What is the maximum capture file size Wireshark can handle?

Wireshark can handle multi-gigabyte capture files, but performance degrades with very large files. Use capture filters, ring buffers, and file size limits to manage capture size effectively.

Does Wireshark work on wireless networks?

Yes, Wireshark can capture on Wi-Fi interfaces in monitor mode to see all wireless traffic including beacon frames, probe requests, and data frames from nearby access points.

How do I extract files from a Wireshark capture?

Go to File > Export Objects and select the protocol (HTTP, SMB, TFTP, etc.). Wireshark will list all transferred files that can be saved to disk for further analysis.

What are coloring rules in Wireshark?

Coloring rules visually distinguish packet types in the packet list. Default rules color TCP in green, UDP in blue, errors in red, and retransmissions in dark purple. You can customize rules under View > Coloring Rules.

Can Wireshark analyze VoIP calls?

Yes, Wireshark can decode SIP signaling, reconstruct RTP audio streams, and play back VoIP calls using the Telephony menu. It supports SIP, H.323, SCCP, and IAX2 protocols.

How do I create custom display filters?

Wireshark display filters use protocol field names like ip.src, tcp.port, or http.host. Combine them with operators (==, !=, contains, matches) and logical connectors (&&, ||, !) to build precise filter expressions.

How do I capture packets from a remote machine with Wireshark?

Use SSH tunneling with remote tshark: ssh user@remote 'tshark -i eth0 -w -' > remote.pcap. Alternatively, use Wireshark's RPCAP protocol for remote capture. For Windows, use tshark on the remote machine and transfer the PCAP file. Remote captures are essential when you need to monitor traffic on systems without GUI access.

Can Wireshark detect network intrusions?

Wireshark itself does not detect intrusions, but it can identify suspicious traffic patterns like unusual ports, data exfiltration, and C2 communication through display filters. Combine with IDS/IPS tools like Snort or Suricata for automated intrusion detection. Wireshark is best for forensic analysis of captured suspicious traffic.

How do I analyze DNS traffic in Wireshark?

Use the display filter 'dns' to show all DNS traffic. For specific queries: 'dns.qry.name contains example.com'. To see DNS responses: 'dns.flags.response == 1'. For DNS tunneling detection: 'dns.qry.name.len > 50' (unusually long queries). DNS analysis helps identify covert channels, C2 communication, and DNS poisoning attacks.

What is the difference between promiscuous mode and monitor mode?

Promiscuous mode allows Wireshark to capture all traffic on the local network segment by not filtering by MAC address. Monitor mode (for WiFi) captures all wireless frames including beacons, probes, and data from all nearby access points. Promiscuous mode works on wired Ethernet; monitor mode is required for wireless packet capture.

How do I export Wireshark results for a security report?

Export packets as PCAP/PCAPNG for technical evidence: File > Save As. Export as plain text: File > Export Packet Dissections > As Plain Text. Export specific packets: use display filters first, then File > Export Specified Packets. For screenshots, capture key packets showing evidence of vulnerabilities or attacks to include in your report.

How do I detect ARP spoofing with Wireshark?

Use the display filter 'arp' to show all ARP traffic. Look for duplicate IP addresses mapped to different MAC addresses, gratuitous ARP replies, and rapid ARP announcement floods. The 'arp.duplicate-address-detected' filter identifies conflicting ARP entries. Combine with 'arp.opcode == 2' to focus on ARP replies which are used in poisoning attacks.

Can Wireshark decrypt WPA2 encrypted WiFi traffic?

Yes, if you have the WiFi password. Go to Edit > Preferences > Protocols > IEEE 802.11, enable decryption, and enter the WPA2 pre-shared key. Wireshark will decrypt captured WiFi traffic in real-time. For enterprise WPA2-802.1X, you need the EAP session keys from the RADIUS server.

How do I use Wireshark IO graphs for bandwidth analysis?

Go to Statistics > IO Graphs to visualize traffic volume over time. Configure different display filters on separate graph lanes to compare protocols (e.g., HTTP vs DNS). Adjust the interval (1 second, 100ms) for different granularity. IO graphs help identify traffic spikes, DoS attacks, and data exfiltration patterns.

How do I use tshark for automated packet analysis?

tshark is Wireshark's command-line companion: tshark -r capture.pcap -Y 'http.request' -T fields -e http.host extracts HTTP hostnames. Use -T json for structured output. Combine with scripts for automated analysis: tshark -r capture.pcap -Y 'dns.qry.name.len > 50' | wc -l counts suspicious DNS queries. tshark is ideal for CI/CD security pipelines and batch processing.

How do I create custom Wireshark display filter expressions?

Build filters using protocol fields: ip.src==192.168.1.0/24, tcp.port==443, http.request.method==POST. Combine with logical operators: ip.src==10.0.0.1 && tcp.port==80. Use 'contains' for pattern matching: http.host contains 'example.com'. Save frequently used filters as display filter buttons via Analyze > Display Filter Macros.

Is Wireshark easy to learn?

Yes, if you start with one connection rather than trying to make sense of every packet on a busy network. Use this Wireshark tutorial to capture a plain HTTP request to a test page you control, find it with the http display filter and follow its TCP stream. Once you can do that, practise finding the same traffic by IP address or port.

Can Wireshark be detected?

Passive capture sends no packets, so the capture itself is not detectable on the wire. That does not mean running Wireshark is invisible: name resolution can generate traffic, and quirks in promiscuous mode can reveal activity. Capture only where you have permission.

How do I capture Wi-Fi traffic with Wireshark?

To capture raw Wi-Fi frames on a network you are authorised to monitor, select a wireless adapter that supports monitor mode and enable that mode before starting. On Windows, you need Npcap and a supported adapter; installing Npcap alone will not make an unsupported adapter work in monitor mode.

Can I use Wireshark on my phone?

There is no official Wireshark app for Android or iOS. If you have a capture file from an authorised test, open it in Wireshark on a desktop or laptop to analyse it.

How do you use Wireshark step by step?

Install Wireshark, pick an interface you are authorised to monitor, set a capture filter such as tcp port 80, start the capture, generate the traffic, stop, then filter with http, inspect a packet and follow its TCP stream. The 10-step guide on this page walks through each step in order.

How to capture IP in Wireshark?

To capture only one host, set the capture filter host 192.168.1.1 before you start. To find that host in a capture you already have, type ip.addr == 192.168.1.1 in the display filter bar. Use ip.src == 192.168.1.1 for traffic sent by the host and ip.dst == 192.168.1.1 for traffic sent to it.

Tags

#sniffing-spoofing

Output Explanation

The main screen is divided into sections showing a broad list of intercepted traffic, the granular protocol breakdown of a selected item, and its raw hexadecimal output. Color coding is used heavily to signify traffic patterns, with red typically indicating errors. The Packet List columns — No., Time, Source, Destination, Protocol, Length and Info — summarise each packet; click any row to see its decoded fields in Packet Details and its raw bytes in Packet Bytes.

Ethical Usage Notice

This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.