Wireshark packet analysis: capture, filter and read traffic step by step

This blog introduced Wireshark, a network protocol analyzer widely used for ethical hacking and network troubleshooting. We covered its features, installation steps, use cases, and practical examples, making it easier for beginners to start using Wireshark effectively.

Dec 21, 2024 - 14:16
Updated: 1 month ago
105.9k
Wireshark packet analysis: capture, filter and read traffic step by step

Quick answer: Wireshark captures network packets and lets you inspect them layer by layer. The workflow is: choose an interface, capture, apply a display filter such as http or ip.addr == 192.168.1.10, follow a TCP stream, and check statistics. Capture only on networks you own or are authorised to monitor, and expect encrypted traffic to hide its content.

Key takeaways

  • Capture filters limit what is recorded; display filters limit what you see.
  • Follow TCP Stream and the Statistics menu answer most beginner questions.
  • Encrypted traffic such as HTTPS shows metadata but not content.
  • Practise on public sample captures first.
  • Capture only on networks you own or have permission to monitor.

What is Wireshark?

Wireshark is a free packet analyser. It records network traffic and shows each packet broken down by protocol layer. Its documentation is at wireshark.org/docs. Defenders use it to troubleshoot and investigate. Ethical hackers use it to understand what a test generates and what an attacker could see.

Legal note: capturing traffic on a network you do not own or administer, without permission, can break the law. Capture on your own lab or home network.

What is the basic workflow?

  1. Pick an interface (Wi-Fi, Ethernet or a VM adapter) and start the capture.
  2. Generate some traffic, such as browsing a lab web page or running ping.
  3. Stop the capture and save it as a .pcapng file.
  4. Filter to the traffic you care about.
  5. Inspect the packet detail pane, layer by layer.
  6. Follow the stream to read a whole conversation.
  7. Note findings with packet numbers.

What is the difference between capture and display filters?

A capture filter is set before you start and limits what is recorded, for example host 192.168.56.101. A display filter is set afterwards and only changes what you see. Display filters are more powerful. Beginners should capture everything on a quiet lab network and filter later.

GoalDisplay filter
One hostip.addr == 192.168.56.101
HTTP traffichttp
DNS lookupsdns
A TCP porttcp.port == 443
TCP resetstcp.flags.reset == 1
Contains textframe contains "login"

More on filters in mastering Wireshark filters.

How do you read a conversation?

Right-click a packet and choose Follow, TCP Stream. Wireshark reassembles the data. For an unencrypted lab web server you can read the request and response. This shows why sending credentials over plain HTTP is unsafe.

Which statistics help?

  • Statistics, Conversations shows which hosts talk the most.
  • Statistics, Protocol Hierarchy shows the protocol mix.
  • Statistics, I/O Graph shows traffic over time, useful for spotting bursts.
  • File, Export Objects, HTTP lists files transferred in clear text.

Can Wireshark read HTTPS?

Not without the keys. TLS encrypts the content. You still see IP addresses, ports, the server name in some handshakes and traffic volume. In your own lab you can decrypt your own browser traffic by setting a session key log file, as described in the Wireshark documentation.

What is tshark?

Tshark is Wireshark's command-line version, useful on servers and in scripts.

$ tshark -i eth0 -c 100 -w sample.pcapng
$ tshark -r sample.pcapng -Y "dns" -T fields -e ip.src -e dns.qry.name

The first records 100 packets. The second reads the file and prints source IP and queried name for DNS packets.

Where can you practise?

The Wireshark sample captures page hosts public pcap files for many protocols. Download one, open it and answer simple questions: which hosts talked, which protocols appeared, was anything sent in clear text?

What mistakes do beginners make?

  • Capturing on the wrong interface and seeing nothing.
  • Staring at thousands of packets without a filter.
  • Forgetting that a capture can contain passwords and personal data. Store and share it carefully.
  • Assuming a suspicious packet proves an attack.

For a gentler start, see Wireshark for beginners.

Next steps

Practise with a trainer in our Computer Network course or the CEH v13 AI course.

Related reading

Frequently Asked Questions

Wireshark captures and analyses network packets. Network engineers use it to troubleshoot problems, and security professionals use it to investigate suspicious traffic and understand what a test or attack looks like on the wire.

A capture filter is set before recording and limits which packets are saved. A display filter is applied afterwards and only changes which captured packets you see. Display filters are more flexible.

Not without the session keys, because TLS encrypts the content. You can still see addresses, ports and volume. In your own lab you can decrypt your own browser traffic using a key log file.

Right-click a packet in the TCP conversation and choose Follow, then TCP Stream. Wireshark reassembles the data into one readable view, which is useful for unencrypted protocols.

The tool is legal. Capturing traffic on networks you do not own or administer without permission can be illegal. Use your own lab or home network, and handle captures carefully because they may hold sensitive data.

The Wireshark wiki hosts a page of public sample capture files covering many protocols. Open one and practise filtering, following streams and answering simple questions about the traffic.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.