Sniffing & Spoofing
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.
sudo apt install wireshark
wireshark (GUI) or tshark (CLI)
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.
| Command | Purpose |
|---|---|
tshark -D | List capture interfaces so you can choose the one that carries your test traffic. |
tshark -f "tcp port 80" -i eth0 | Capture live TCP traffic to or from port 80 on eth0. |
tshark -i eth0 -f "tcp port 80" -a duration:15 -w capture.pcapng | Capture TCP port 80 traffic for 15 seconds and write it to capture.pcapng. |
tshark -r capture.pcapng -Y http | Read a saved capture and show only packets decoded as HTTP. |
tshark -r capture.pcapng -q -z follow,tcp,ascii,0 | Show TCP stream 0 in ASCII without printing the per-packet summaries. |
wiresharkLaunch GUI - Open graphical interfacetshark -i eth0CLI capture - Command line captureFilter: httpHTTP filter - Web traffic onlyFilter: ip.addr == 192.168.1.1IP filter - Specific hostFilter: tcp.port == 443Port filter - Specific portFilter: tcp.flags.syn == 1SYN packets - New connectionsFilter: dnsDNS traffic - Name resolutionFilter: ftp || ftp-dataFTP traffic - File transfersFilter: http.request.method == "POST"POST requests - Form submissionsFilter: http contains "password"Password search - Find credsFilter: tcp.analysis.retransmissionRetransmissions - Network issuesRight-click > Follow > TCP StreamFollow stream - Full conversationtshark -i eth0 -w capture.pcapSave capture - Write to filetshark -r capture.pcap -Y "http"Read file - Filter saved capturetshark -i eth0 -f "port 80"Capture filter - Capture only port 80tshark -i eth0 -Y "http.request" -T fields -e http.host -e http.request.uriField extraction - Custom outputFilter: frame contains "secret"String search - Find in packetsFilter: tcp.stream eq 5Stream filter - Specific TCP streamFilter: !(arp || icmp || dns)Exclude protocols - Hide noiseFilter: http.response.code >= 400Error responses - HTTP errorstshark -i eth0 -a duration:60Timed capture - 60 secondstshark -i eth0 -b filesize:10000Ring buffer - Split by sizeFilter: wlan.fc.type_subtype == 0x08WiFi beacons - AP announcementsStatistics > ConversationsConversations - Traffic statsStatistics > Protocol HierarchyProtocol stats - Traffic breakdownFile > Export Objects > HTTPExport HTTP - Extract filestshark -r capture.pcap -q -z io,phsProtocol hierarchy - Print a protocol breakdown from a filetshark -r capture.pcap -q -z conv,tcpTCP conversations - Summarize traffic between endpointstshark -r capture.pcap -z follow,tcp,ascii,0Follow stream - Reassemble a TCP stream as ASCIIeditcap -A '2026-01-01 00:00:00' in.pcap out.pcapTrim capture - Slice a PCAP by time window with editcapmergecap -w merged.pcap a.pcap b.pcapMerge captures - Combine multiple PCAP files into onedumpcap -i eth0 -w capture.pcapngHeadless capture - Record traffic to a file without opening the GUIcapinfos capture.pcapngCapture summary - Show packet count, duration and file detailswireshark -r capture.pcapngOpen capture - Load a saved file in the GUI without capturingIdentify network latency, packet loss, and connection issues by analyzing captured traffic patterns.
Dissect and understand network protocols at every OSI layer with detailed field-level inspection.
Investigate network security incidents by examining packet captures for malicious activity.
Analyze bandwidth usage patterns and identify which applications consume the most network resources.
Debug application network behavior by examining exact request and response payloads.
Use display filters to isolate specific traffic types, IP addresses, ports, or protocol fields.
Identify command-and-control communication, data exfiltration, and malicious network behavior in infected systems.
Capture and reconstruct voice-over-IP calls, analyze SIP signaling, and verify call quality metrics.
Monitor Wi-Fi beacon frames, probe requests, and deauthentication packets for wireless security assessments.
Verify that network traffic adheres to organizational security policies and regulatory compliance requirements.
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.
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 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Master Wireshark for network traffic capture, protocol analysis, filtering, and troubleshooting with practical examples.
Networking · BeginnerMaster the OSI model's seven layers, understand how each layer functions, learn real-world protocol examples, and use the model for troubleshooting.
Networking · BeginnerLearn the fundamentals of computer networking including the OSI model, TCP/IP protocol suite, IP addressing, subnetting, DNS, and network security essentials.
Networking · IntermediateLearn firewall types, architectures, rule configuration, and best practices for network security and traffic filtering.
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.
This tool is designed for authorized security testing, educational purposes, and legitimate network administration only. Unauthorized access to computer systems is illegal.