Skip to content
Tutorials Center
My learning

Topics

Lesson 12 of 37 ยท Filters and Display

Find, Follow Streams and Export

Search packets, mark and comment, follow TCP, UDP, TLS and HTTP streams, open conversations by tcp.stream, and export objects and packet subsets safely.

Filters narrow a capture; this lesson covers the other everyday actions: finding a particular packet, following a conversation as the application saw it, marking and commenting packets for later, and extracting files or subsets. Most of these live under Edit, Analyze, Statistics and File.

Find a packet

Edit > Find Packet (Ctrl+F) opens a search bar with three kinds of search:

  • Display filter: find the next packet matching a filter.
  • Hex value: find a byte sequence, for example 47:45:54 ("GET").
  • String: find text, in the Packet List, the Packet Details or the Packet Bytes, with an optional case-insensitive match and a character set choice.
  • Regular expression: the same, with a pattern.

Use Ctrl+N / Ctrl+P to jump to the next or previous match. Go > Go to Packet (Ctrl+G) jumps by number, and Go > Next/Previous Packet in Conversation follows one flow.

Filter or search? A filter hides all non-matching packets, which is best when you want to see all matches together. Find leaves the capture whole, which is best when you need the surrounding context.

Mark and comment

  • Mark a packet (Ctrl+M) to color it black with white text. Mark the packets you care about, then show only them with the filter frame.marked == 1, or step through them with Shift+Ctrl+N. Marks last until you close the file unless you save a packet comment.
  • Ignore a packet (Ctrl+D) to exclude it from analysis temporarily.
  • Packet comments: right-click > Packet Comment. In pcapng files the comment is saved in the file, and can be shown with frame.comment or pkt_comment fields (the field name varies by version; use Statistics > Capture File Properties to see all comments). Comments are the right way to document findings: "client retransmits here because the proxy dropped it".

Follow a stream

TCP delivers a byte stream split into many segments. Reading it segment by segment is painful. Follow TCP Stream (Analyze > Follow > TCP Stream, Ctrl+Alt+Shift+T) reassembles the payload of one connection into a readable view, with client data in one color and server data in another. Wireshark also applies a display filter such as tcp.stream eq 4 for you; clear it to return to the full capture.

Related commands:

  • Follow UDP stream, for datagram conversations.
  • Follow TLS stream: only readable if you supply keys (see the decryption lesson); otherwise you see encrypted bytes.
  • Follow HTTP stream and HTTP/2 stream, which decode transfer encodings and let you pick a stream ID.
  • Show data as: ASCII, hex dump, raw, YAML, C arrays, and so on. Save as writes the stream to a file.

Follow stream is also a privacy hazard: for clear-text protocols (HTTP, FTP, Telnet, POP3) it shows passwords and messages exactly as typed. Treat what you see accordingly, and do not paste it into tickets without redaction. It is also the reason these protocols should be replaced by encrypted alternatives.

flowchart LR
    S1["Segment 1<br/>seq 1, 'GET / HT'"] --> R["Reassemble by<br/>sequence number"]
    S3["Segment 3<br/>seq 11, 'Host: a'"] --> R
    S2["Segment 2<br/>seq 9, 'TP/1.1'"] --> R
    R --> OUT["GET / HTTP/1.1<br/>Host: a"]

Segments can arrive out of order; reassembly puts the bytes back by sequence number.

A stand-in for stream reassembly

The next program reassembles invented TCP segments by their sequence numbers, discards duplicates (retransmissions) and shows the stream, which is the idea behind Follow TCP Stream. It handles the simple case (no overlap with different data).

Python Reassemble a TCP stream from segments (stand-in)

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.

A stand-in for Find Packet

Find Packet can search a string or a hex value in the packet bytes. This stand-in does both on invented payloads and reports the packet number and the offset, as the Packet Bytes pane would let you see.

Python Find a string or hex value in packets (stand-in)

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.

Conversations and endpoints

Statistics > Conversations lists every pair of endpoints per protocol (Ethernet, IPv4, TCP, UDP...) with packet and byte counts, durations and bits per second in each direction. Click a row, then Conversation Filter, or right-click > Apply as Filter to isolate it. Statistics > Endpoints lists single hosts. These tables answer "who is talking the most?" in seconds and are the starting point of many investigations. See protocol hierarchy and statistics later in the course.

Export objects

Wireshark can rebuild files that crossed the network in clear text. File > Export Objects supports HTTP, IMF (email), SMB, TFTP, DICOM and more. Choose an entry and Save. This is useful to retrieve a web page or an image from a capture of your own session, or to inspect a suspicious download from an incident capture in a safe, isolated lab.

Objects extracted from a capture of malicious traffic can be real malware. Never open them on your normal computer. Handle them in a disposable virtual machine without network access, and never run an extracted executable.

Export and save subsets

  • File > Export Specified Packets: save all displayed packets (the current filter) or a range, or only marked packets, as a new capture file. Use it to hand a colleague just the relevant conversation.
  • File > Export Packet Dissections: write the packet list or details as text, CSV or JSON for reports.
  • File > Export Packet Bytes: save the raw bytes of the selected field or packet.
  • File > Print (or save as PDF): selected packets as a document.
  • Edit > Copy: copy values, filters, the whole packet as hex or as a C array.
  • File > Export TLS Session Keys writes the keys Wireshark knows about.

Before sharing a file outside your organization, sanitize it: remove packets that are not needed, and consider that IP addresses, host names, cookies and tokens are inside. Tools such as editcap can trim, and anonymizers can rewrite addresses.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does Follow TCP Stream do?

    It orders the segments by sequence number and displays the application data of the connection, with each direction in its own color.
  2. 2. Which filter isolates connection number 4 as numbered by Wireshark?

    Wireshark numbers each TCP connection with tcp.stream starting from 0.
  3. 3. Why is Follow Stream a privacy risk on clear-text protocols?

    Clear-text protocols such as HTTP, FTP and Telnet send credentials unencrypted, and Follow Stream makes them readable.
  4. 4. You want to give a colleague only the packets of one conversation. What do you do?

    Filter to the conversation, then export the displayed packets as a new file.

Summary

  • Find packets by filter, hex, string or regex; mark and comment packets to document what you learn.
  • Follow TCP/UDP/TLS/HTTP stream reassembles a conversation; it applies a filter like tcp.stream eq N.
  • Statistics > Conversations shows who talks to whom and how much.
  • Export Objects rebuilds files from clear-text transfers; handle them as potentially dangerous.
  • Export only the packets you need, and sanitize files before sharing.

Next: Ethernet and ARP