GO KALI FREE

Wireshark

Sniffing & Spoofing

Intermediatelow risk

Wireshark is the world's foremost network protocol analyzer. It lets you capture and interactively browse the traffic running on a computer network, showing packet details at the protocol level.

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 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.

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.

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

Step-by-Step Guide

  1. 1Start the application with elevated privileges
  2. 2Choose the network adapter you wish to monitor
  3. 3Initiate the packet capture sequence
  4. 4Allow the traffic to accumulate
  5. 5Implement search rules to isolate specific protocols or addresses
  6. 6Drill down into individual records to inspect their contents
  7. 7Reconstruct entire communication sequences using the stream function
  8. 8Terminate the session and export the data file

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

tshark

Sniffing & Spoofing

Ettercap

Sniffing & Spoofing

Burp Suite

Web Applications

Ngrep

Sniffing & Spoofing

Nmap

Information Gathering

Frequently Asked Questions

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.

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.

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.