Skip to content
Tutorials Center
My learning

Topics

Lesson 37 of 37 ยท Projects and Practice

Practice: Filter and Analysis Challenges

Test your Wireshark skills with display filter exercises, scenario questions and a small filter engine to experiment with, plus model answers for self-checking.

Reading about filters is easy. Writing them under pressure is the real skill. This final lesson gives you exercises: first the filters to write, then scenario questions on what a capture is telling you, and a tiny filter engine you can use to experiment with sample packets.

Try each exercise before opening the answer. Use a capture of your own network or one of the sample captures that the Wireshark project provides on its sample captures page. Never practice on traffic you are not allowed to analyze.

Part 1: write the display filter

Solve these on paper first, then test them. Answers follow.

  1. All DNS responses that report a non-existent name.
  2. TCP packets sent to port 443 that carry the SYN flag but not ACK.
  3. HTTP requests that use the POST method.
  4. Packets to or from the subnet 192.168.10.0/24.
  5. TLS Client Hello messages for a server name containing "example".
  6. TCP retransmissions in the stream with index 5.
  7. Packets larger than 1400 bytes that are not TCP.
  8. ICMP echo requests (ping) and replies.

Model answers

TEXT
1. dns.flags.response == 1 && dns.flags.rcode == 3
2. tcp.dstport == 443 && tcp.flags.syn == 1 && tcp.flags.ack == 0
3. http.request.method == "POST"
4. ip.addr == 192.168.10.0/24
5. tls.handshake.type == 1 && tls.handshake.extensions_server_name contains "example"
6. tcp.stream == 5 && tcp.analysis.retransmission
7. frame.len > 1400 && !tcp
8. icmp.type == 8 || icmp.type == 0

Part 2: a filter engine for practice

To get a feel for how display filters select packets, here is a toy evaluator. It is not Wireshark; it just supports fields, ==, !=, >, <, contains, &&, ||. Change the expressions and see what matches.

Python Experiment with filter expressions

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Wireshark's real filter language has much more: slices (eth.addr[0:3]), sets (tcp.port in {80 443}), functions (lower()), and field comparison with != meaning "no field equal to" (use !(a == b) for "all fields differ" in newer versions). Learn the details in the filters chapter of this course.

Part 3: scenario questions

For each scenario, name the evidence you would look for and the filter or window you would use.

  1. A user says the file server is slow, but only large copies. Which TCP flags and statistics would you check?
  2. A new device on the network is sending DHCP Discovers but never gets an address. What do you check in the capture?
  3. A web page loads after eight seconds. The handshake took 20 ms. Where is the delay?
  4. A workstation sends hundreds of DNS lookups for random names, almost all NXDOMAIN.
  5. Two machines show the same IP address in Expert Information.
  6. A colleague sends you a decryption key file with a capture of your company's website. What do you do before opening it?

Model answers

  1. Window size and zero window (tcp.analysis.zero_window), retransmissions, and TCP stream graphs (throughput, RTT). Compare handshake RTT with the window.
  2. Whether Discover packets reach the DHCP server's VLAN, whether Offers come back (dhcp), relay configuration, and whether another device answers.
  3. The server's response time (gap between request and response), not the network. See A Packet-Level Troubleshooting Workflow.
  4. Possible domain generation activity: check which process makes them, isolate the host, and review Malware Traffic and Beaconing.
  5. arp.duplicate-address-detected: two MACs claim one IP, either a misconfiguration or spoofing. See ARP spoofing.
  6. Confirm you are authorized and that the traffic and keys belong to systems you manage; treat both files as sensitive. See Decrypting TLS.

Part 4: build your own drill set

  • Download a sample capture from the Wireshark wiki (public sample captures) and write five questions about it for yourself or a teammate.
  • Time yourself: how fast can you find the first retransmission, the first DNS error, the server name of the first TLS handshake?
  • Practice the same question in tshark with -Y and -T fields.
  • Keep a personal cheat sheet of your ten most-used filters and columns, and store it with your profile.

Where to go next

  • Revisit Statistics and tshark and automate a daily check.
  • Learn the protocols behind the packets: TCP, TLS, DNS, HTTP/2, and QUIC.
  • Build a home lab with virtual machines so you have safe traffic to capture.
  • Keep ethics first: capture only what you may, and keep what you find private.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which filter shows only TCP connection attempts (SYN without ACK)?

    A SYN without ACK is the first packet of a handshake.
  2. 2. A page loads in eight seconds with a 20 ms handshake. Where should you look?

    A fast handshake means the network path is fine, so slowness is in the application.
  3. 3. What does dns.flags.rcode == 3 match?

    Response code 3 is NXDOMAIN: the name does not exist.
  4. 4. What should you confirm before analyzing a capture someone sends you?

    Captures can contain private information, so authorization and careful handling come first.

Summary

  • Practice writing filters from plain-language requirements until the common ones are automatic.
  • Use scenario thinking: symptom, evidence, filter or window, conclusion.
  • Toy tools and scripts help you understand filter logic, but real analysis happens in Wireshark and tshark.
  • Stay authorized, protect captured data, and keep learning protocol by protocol.

Next: back to the Wireshark tutorial overview