In this section

Wireshark and TShark for Investigators: Conversations, Display Filters, Retransmissions and Export Objects

Module 0

Introduction

A capture holds everything a sensor saw for as long as it ran, and almost none of it matters to the question being asked. Reading packets well is mostly reading fewer of them: orienting in the capture, narrowing to the conversation that answers the question, then reading that conversation closely enough to say what it carried and whether what it carried arrived whole.

From a capture to the packets that matterThe whole capture973 frames, a minute of a LANProtocol hierarchyHTTP, TLS, DNS, ARP: what is in itConversationsone dominates: ws45 to dl.example.org, port 80Display filterthe HTTP requests to that serverOne streamthe request for svc.bin and its response

Orientation narrows a capture before any packet is read: what protocols it holds, which conversations dominate, then the requests inside one of them.

This lesson does that once, end to end, on a minute of the lab LAN. An alert names a workstation and a domain; the capture shows what was fetched; the object it yields is checked against the file the endpoint team found. Module 3 teaches each step in depth with Wireshark and TShark, from the packet list and display filters to stream reconstruction, analysis flags and object extraction at scale.

1

Start From the Question

An alert, and the capture that covers it

Every packet investigation should start with a question written down, because the question decides which packets to read. Here it is the alert the monitoring team raised:

$ cat alert.txt
Alert  2026-11-10, proxy and DNS monitoring
Host   ws45 (10.20.30.45)
Rule   First-seen domain contacted directly, bypassing the web proxy
Detail dl.example.org (203.0.113.66), HTTP and HTTPS; user agent WindowsPowerShell
Ask    What did ws45 fetch from dl.example.org, and what happened afterwards?

The alert says three things worth testing: ws45 reached dl.example.org without going through the company's web proxy, it used both HTTP and HTTPS, and the user agent claimed to be Windows PowerShell rather than a browser. The question it asks is the right one: what was fetched, and what happened next.

The capture comes from the LAN sensor and covers about a minute. Before opening it, capinfos says what it holds:

$ capinfos -c -a -e lan.pcap
File name:           lan.pcap
Number of packets:   973
Earliest packet time: 2026-11-10 05:26:33.336484
Latest packet time:   2026-11-10 05:27:32.634969

The time range has to cover the event. A capture that starts after the request or ends before the response cannot answer the question however carefully it is read, so the first and last packet times are checked against the alert's time before anything else. This one covers the window, so the next step is to see what is in it.

Two details of the alert matter before any packet is opened. It names an address and a domain, so the capture can be searched for either. And it gives a date but no exact time, so the capture's time range has to be checked against the alert's window rather than assumed to cover it.

Writing the question down first also protects against the commonest waste of time in packet work: scrolling. A capture of a minute on a quiet LAN is already close to a thousand frames, and a capture of an hour on a busy network is millions.

Without a question, every frame looks equally worth reading. With one, most of the capture can be set aside in the first minute, and the reading that follows is aimed at the frames that could change the answer. The question can be refined as the evidence comes in, but it is never left blank.

2

Orient Before You Read

The protocol hierarchy

The protocol hierarchy counts frames and bytes by the protocols TShark recognized in them, nested the way the protocols are nested on the wire:

$ tshark -r lan.pcap -q -z io,phs | sed -n 5,16p

frame                                    frames:973 bytes:804148
  eth                                    frames:973 bytes:804148
    arp                                  frames:10 bytes:420
    ip                                   frames:963 bytes:803728
      udp                                frames:18 bytes:1488
        dns                              frames:18 bytes:1488
      tcp                                frames:945 bytes:802240
        tls                              frames:28 bytes:13302
        http                             frames:439 bytes:634412
          tls                            frames:7 bytes:3339
          data-text-lines                frames:2 bytes:534

Most of the capture is TCP, and most of the TCP bytes are HTTP: plain, unencrypted web traffic, which is unusual today and immediately interesting. There is some TLS, DNS for name resolution, and a little ARP. Nothing exotic, and nothing that suggests the traffic is using a protocol to hide another.

Reading the hierarchy is a matter of comparison. On most corporate networks today, nearly all web traffic is TLS, and plain HTTP is a small remainder: updates, internal tools, the occasional old site. Here the HTTP bytes outweigh everything else in the capture together. That ratio is the first sign that one HTTP transfer is large, and the conversation list will show which one.

The hierarchy is a map, not a finding. It says where to look, not what happened. Its counts are frames and bytes as the dissectors labeled them, so a protocol on an unusual port, or one the dissectors cannot identify, lands under a generic heading such as data.

A large share of unidentified data is itself worth investigating, because it is what an attacker using a custom protocol looks like at this level. Its value is in what stands out: a protocol that should not be on this network, a large share of bytes in an unexpected place, or, as here, a lot of plain HTTP on a network where most web traffic is encrypted.

Set out as questions, the orientation is short:

Orient before reading packets

What is in the capture?

capinfos and the protocol hierarchy: time range, size, protocols

Who talked most?

The conversation list, sorted by bytes or frames

What was asked for?

A display filter on the requests, with the fields as columns

What came back?

The response on the same stream, and whether it is whole

Those four questions are the orientation every capture gets, whatever tool reads it. In Wireshark they are the Statistics menu; in TShark they are -z options and display filters. Module 3 covers both, and the habit of running them before opening a single packet.

3

Who Talked to Whom

The conversation list

The conversation list groups packets by the two endpoints of each TCP connection and totals them. Sorted by size, the largest are at the top:

$ tshark -r lan.pcap -q -z conv,tcp | sed -n 6,11p \
  | awk '{print $1, $2, $3, $10, $11, $12}'
10.20.30.45:37358 <-> 203.0.113.66:80 808 754 kB
10.20.30.45:38752 <-> 10.20.30.46:8000 40 26 kB
10.20.30.46:38906 <-> 10.20.0.8:3128 18 4286 bytes
10.20.30.45:37520 <-> 203.0.113.66:443 17 3981 bytes
10.20.30.45:47604 <-> 203.0.113.66:443 17 3981 bytes
10.20.30.45:37346 <-> 203.0.113.66:80 15 1807 bytes

One conversation dominates: ws45 to 203.0.113.66, the address the alert gave for dl.example.org, on port 80, with 808 frames, far more than anything else. That is almost certainly the download.

The smaller conversations to the same server on ports 80 and 443 are the other requests the alert mentioned. The one to 10.20.30.46 on port 8000 is local traffic between two workstations, and the one to 10.20.0.8 is the other workstation using the proxy as it should.

The endpoints in the list are addresses and ports, not names. The alert supplied the name for 203.0.113.66; in a capture with DNS, the name can also be read from the lookup that preceded the connection, which lesson 0.4 does.

Sorting is the point. A conversation list sorted by bytes puts the transfers that moved data at the top, which for most questions about what was fetched or sent is exactly where to start. Sorted by frames, it surfaces chatty connections that moved little but talked often, which matters later in the course for command-and-control. Sorted by start time, it becomes a rough timeline.

The list also holds things that are easy to miss in the packet view. A connection to the same server on port 8080 appears with just two frames:

$ tshark -r lan.pcap -Y 'tcp.port==8080' -T fields \
  -e frame.number -e ip.src -e tcp.flags.str
872	10.20.30.45	··········S·
873	203.0.113.66	·······A·R··

A SYN from ws45 and a reset from the server: something tried port 8080, and the server refused. A refused connection is evidence of an attempt, and it belongs in the timeline even though no data moved.

Whether the attempt came from the same script is a question for the endpoint, but its timing beside the downloads makes it worth recording. Module 1 covers reading a connection's outcome from its flags, and Module 3 the conversation and endpoint statistics in full.

4

What Was Asked For

A display filter on the requests

A display filter narrows the packets shown without changing the capture. This one keeps HTTP requests to the alert's server, and prints three fields from each:

$ tshark -r lan.pcap -Y 'http.request && ip.dst==203.0.113.66' -T fields \
  -e frame.number -e tcp.stream -e http.request.uri
48	2	/s/
52	2	/s/install.ps1
65	3	/b/svc.bin

Three requests on two streams: the client asked for /s/, then /s/install.ps1, and on a new connection /b/svc.bin. A directory, a PowerShell script, and a binary. The user agent on the last request:

$ tshark -r lan.pcap -Y frame.number==65 -T fields -e http.user_agent
Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.4648

The string names Windows PowerShell 5.1 as the client. A person browsing would have sent a browser's string, and none of the three requests did. A user agent is chosen by the client and can say anything, so it is a claim about the software rather than proof of it.

The sequence reads as a script fetching a second script, and the second script fetching a binary, which is a common pattern for malware delivery and also for legitimate software installers, so the user agent alone decides nothing. It narrows the question.

What would settle it is the content of install.ps1, which the capture also carries in plain text, and what happened on the host after the binary arrived, which only the endpoint can say.

The stream numbers matter as much as the URIs. TShark numbers each TCP connection in the order it first appears, and every later step, following the stream, listing its analysis flags, extracting its objects, refers to it by that number. Here the script and its first fetch shared one connection, and the binary came over a fresh one, stream 3, which is the one to read closely.

Display filters are Wireshark's main instrument, and their syntax is a language in its own right: field existence, comparisons, sets, string matching, slices. Module 3 teaches it in depth, including the filters that look right and match the wrong packets. The filter used here, a protocol test joined to an address comparison, is the shape most investigation filters take.

5

What Came Back

A response the default settings missed

Every request should have a response on the same stream. Listing the HTTP responses TShark parsed:

$ tshark -r lan.pcap -Y http.response -T fields \
  -e frame.number -e tcp.stream -e http.response.code
26	1	200
50	2	302
55	2	200
908	5	200

There are responses on the other streams, but none on stream 3, the one that carried the request for svc.bin. That looks like a request that was never answered, which would be a significant finding. It is not true. The conversation list showed 808 frames on that connection, far too many for an unanswered request; a large response was sent. TShark simply did not assemble it into an HTTP message.

The reason is in how TCP was repaired on that stream, which the next section reads. The lesson here is about the tool: when TShark or Wireshark does not show something, the first question is whether it was absent from the wire or merely not reassembled.

Wireshark's dissectors build an HTTP message by collecting the TCP payload in sequence until the message is complete. If a segment arrives out of order and the dissector does not wait for it, the message is never completed and no response is shown, even though every byte is in the file.

Default dissector settings are chosen for speed and the common case, and a stream with retransmissions or segments out of order is not the common case.

The reasonable mistake

Trusting the first export

An analyst runs Export Objects on the capture with default settings, gets 170 small files and no svc.bin, and reports that the download did not complete.

Instead: Read why the response was not reassembled before concluding anything about the transfer. Here three segments arrived out of order after retransmission; with out-of-order reassembly on, the file exports whole and matches the endpoint's copy byte for byte.

The mistake is worth naming because the false conclusion, that the download failed, would change the whole investigation: no binary, no execution, no compromise. Every later step would rest on it. Checking the frame count of the stream against the absence of a response takes seconds and catches it.

The same caution applies to every tool view in the course. Zeek's logs, Suricata's alerts and Wireshark's panes all show the traffic as their parsers understood it, and a parser can be wrong about a stream that broke the usual pattern. When a view disagrees with the raw counts, the counts win until the disagreement is explained.

6

Gaps and Repairs

Three dropped packets, three retransmissions

TCP numbers every byte and acknowledges what it has received, so a missing segment shows up as a gap followed by a retransmission. TShark's analysis flags mark them:

$ tshark -r lan.pcap -Y tcp.analysis.retransmission -T fields \
  -e frame.number -e tcp.stream -e ip.src -e tcp.seq
208	3	203.0.113.66	94646
472	3	203.0.113.66	307209
716	3	203.0.113.66	519772

Three retransmissions, all from the server, all on stream 3. The firewall's own log, from the same window, explains why:

$ cat firewall-drops.txt
firewall dropped 3 packets from 203.0.113.66 port 80

Put together with the retransmissions, the sequence on the stream is:

What happened on the download streamws4510.20.30.45Firewalldropped threedl.example.org203.0.113.66GET /b/svc.bin, WindowsPowerShellresponse data, segment after segmentmost segments deliveredthree segments dropped by the firewallACK: the next byte expected is still the missing oneretransmission fills the gap

Three server segments never reached ws45 and were sent again; TCP repaired every gap, so the file arrived whole despite the firewall dropping 3 packets.

The firewall dropped 3 packets from the server; TCP noticed each gap, the server sent the missing segments again, and ws45 received everything. This is the opposite of the capture loss in lesson 0.1, and the distinction matters:

Two kinds of missing packet

Lost on the network

Dropped between the endpoints; TCP retransmits, the receiver gets everything, the capture shows the repair

Lost by the capture

Never recorded by the sensor; the endpoints were fine, the capture has a gap nothing will fill (lesson 0.1)

The repair is visible in the acknowledgments. While a segment is missing, the receiver keeps acknowledging the byte just before the gap, however much later data arrives, and the sender eventually resends from that point. Module 3 reads that pattern frame by frame, because it is how an analyst tells a real loss from a sensor that simply missed a packet.

Matching the two counts, three dropped and three retransmitted, is a small piece of corroboration that is easy to skip.

It turns an inference about network loss into a finding supported by two independent records, the firewall's log and the packets, and it rules out the other explanation for retransmissions, a problem at the sensor rather than on the network, because the capture itself recorded both the gap and its repair.

Not every retransmission has a cause this tidy. On busy networks they come from congestion, wireless links and timers firing early, and most investigations cannot point to the device that dropped each packet. When a log like the firewall's exists, it is worth the minute it takes to match it.

Because the retransmitted segments arrived after later data, they were out of order, and TShark's default setting does not reassemble out-of-order segments into a message. That is why the HTTP response was missing in section 5. Module 3's lesson on analysis flags follows one of these gaps to its repair and shows Zeek's view of the same stream.

7

Extracting and Checking the Object

The hash is the identity

Exporting objects writes every file an HTTP stream carried to disk. With default settings, on this capture:

$ tshark -r lan.pcap -q --export-objects http,/tmp/obj-default
ls /tmp/obj-default | wc -l
1020

Over a hundred small files: TShark wrote each piece of the unreassembled response as its own object. With out-of-order reassembly turned on for one run, the same export produces three files, one of them svc.bin, and its hash:

$ tshark -r lan.pcap -o tcp.reassemble_out_of_order:TRUE \
  -q --export-objects http,/tmp/obj
ls -l /tmp/obj | awk 'NR > 1 {print $5, $9}'
sha256sum /tmp/obj/svc.bin | cut -c1-64
23343 %2f
23343 %2f(1)
23343 %2f(2)
23343 %2f(3)
23343 %2f(4)
23343 %2f(5)
23343 %2f(6)
1052 install(1).ps1
1052 install(2).ps1
1052 install(3).ps1
1052 install(4).ps1
1052 install(5).ps1
1052 install(6).ps1
1052 install.ps1
1448 object159
1448 object175
1448 object176
1448 object178
1448 object179
1448 object181
1448 object182
1448 object184
1448 object187
1448 object190
1448 object212
1448 object220
1448 object221
1448 object224
1448 object227
1448 object230
1448 object232
1448 object233
1448 object235
1448 object236
1448 object239
1448 object244
1448 object247
1448 object268
1448 object270
1448 object271
1448 object273
1448 object276
1448 object290
1423 object292
1448 object293
1448 object295
1448 object298
1448 object301
1448 object304
1448 object307
1448 object310
1448 object312
1448 object315
1448 object316
1448 object318
1448 object319
1448 object321
1448 object322
1448 object324
1448 object327
1448 object330
1448 object333
1448 object382
1448 object383
1448 object386
1448 object389
1448 object392
1448 object394
1448 object395
1448 object397
1448 object398
1448 object401
1448 object406
1448 object409
1448 object417
1448 object419
1448 object420
1448 object422
1448 object425
1448 object474
1423 object476
1448 object477
1448 object479
1448 object482
1448 object485
1448 object488
1448 object491
1448 object494
1448 object496
1448 object499
1448 object500
1448 object502
1448 object503
1448 object505
1448 object506
1448 object508
1448 object511
1448 object514
1448 object517
1448 object540
1448 object541
1448 object544
1448 object547
1448 object550
1448 object552
1448 object553
1448 object555
1448 object556
1448 object559
1448 object564
1448 object567
1448 object576
1448 object578
1448 object579
1448 object581
1448 object584
1448 object632
1423 object634
1448 object635
1448 object637
1448 object640
1448 object643
1448 object646
1448 object649
1448 object652
1448 object654
1448 object657
1448 object658
1448 object660
1448 object661
1448 object663
1448 object664
1448 object666
1448 object669
1448 object672
1448 object674
1448 object718
1448 object719
1448 object722
1448 object725
1448 object728
1448 object730
1448 object731
1448 object733
1448 object734
1448 object737
1448 object742
1448 object745
1448 object754
1448 object756
1448 object757
1448 object759
1448 object762
1448 object764
1423 object766
1448 object767
1448 object769
1448 object772
1448 object775
1448 object778
1448 object781
1448 object784
1448 object786
1448 object789
1448 object790
1448 object792
1448 object793
1448 object795
1448 object796
1448 object798
1448 object801
1448 object804
1448 object807
1448 object813
1448 object814
1448 object817
1448 object820
1448 object822
1448 object823
1448 object834
1448 object842
5 object865
700002 svc(1).bin
700002 svc(2).bin
700002 svc(3).bin
700002 svc(4).bin
700002 svc(5).bin
700002 svc.bin
c0f8d9d1006c89aa9129008312589ed5e274fd3a64ce1339d6a9c1d8eb3e3a45

And the endpoint team's report on the file they recovered:

$ cat endpoint-report.txt
Endpoint team, ws45: file recovered from the user profile
Path     C:\Users\finance01\AppData\Local\Temp\svc.exe
Size     700002 bytes
SHA-256  c0f8d9d1006c89aa9129008312589ed5e274fd3a64ce1339d6a9c1d8eb3e3a45

The same size and the same SHA-256. The file in the capture is the file on the workstation; the script saved it under a different name. That join, from a network object to an endpoint file by hash, is the strongest link a network investigation can make to a host, and it is written down as a record:

An extracted object, recorded

What

svc.bin, 700002 bytes, from stream 3

From

GET /b/svc.bin, frame 65, dl.example.org

How

TShark 4.6.9, --export-objects http, out-of-order reassembly on

Check

SHA-256 equal to the endpoint team's copy

The record says what the object is, where it came from, how it was extracted and how it was checked. A reviewer can repeat every step from it.

Two cautions apply to extracted objects. They are live content: a binary exported from a capture is the same file the attacker delivered, and it is handled the way any malware sample is, on an analysis machine and never opened casually.

And an object's integrity is only as good as the stream it came from; if the capture itself had lost packets, as in lesson 0.1, the export would be incomplete however the reassembly was set, and the hash would not match.

The size matters as well as the hash. A size that matches with a different hash means the content differs; a hash that matches settles both.

The hash comparison is also what turns two separate investigations into one. The endpoint team knew a file existed on ws45; the network team knew a binary was downloaded. Matching hashes say they are the same file and fix when and from where it arrived.

8

What Module 3 Builds On It

Packet investigation in full

Module 3 teaches each step this lesson took. It starts with the Wireshark window and its TShark equivalents and the packet citation every finding uses, then the display filter language, the protocol hierarchy, conversations and endpoints, following and reconstructing streams, retransmissions and the analysis flags, extracting files and objects safely, and TShark pipelines that run the same analysis over many files.

The order is deliberate:

Module 3, in order

01Reading a capturethe window, time formats, the citation
02Display filtersthe language, and filters that mislead
03Statisticshierarchy, conversations, endpoints
04Streamsfollowing TCP, HTTP and TLS
05Analysis flagsretransmissions and gaps
06Objects and scaleextraction, then TShark pipelines

The module's exercise is a second capture from the same lab: ws46 reaching a file share through the proxy, with a download, an upload and a transfer that stops short. It asks for an extracted object record for each object, which is the record section 7 wrote.

The habit to carry into it is the order this lesson used: write the question, orient with the hierarchy and the conversations, narrow with a display filter, read the stream, check whether anything was lost or not reassembled, and only then extract, hash and record.

Most mistakes in packet work come from reading packets before orienting, or trusting a tool's default view of a stream that was not the default case.

The skills compound. A display filter written well in Module 3 is reused in every later module; a stream read correctly once is read the same way when the stream is a beacon or an exfiltration. Module 3 is where the course's working vocabulary for packets is set.

None of it needs an expensive tool. Wireshark and TShark are free, and every command in this lesson runs as written against the lab pack's copy of the capture.

Each lesson in the module uses the same capture this lesson read, so the hosts, streams and frames recur, and the lesson on retransmissions follows one of these three gaps from the dropped segment to its repair in more detail than section 6 could.

Do

Practice

What did ws45 fetch?
the lab capture

The prepared evidence below is the same capture in three views: its largest TCP conversations, the HTTP requests to the alert's server, and the objects it yields with out-of-order reassembly on. Find the download, the PowerShell requests, and whether the file is the one the endpoint team found.

If you have Wireshark installed, open any capture of your own and run Statistics, Protocol Hierarchy and Statistics, Conversations before opening a single packet. Write down the three conversations you would read first, and why.

Reading packets is narrowing: the question first, then the protocol hierarchy and the conversations, then a display filter, then one stream read closely. What a tool does not show may still be on the wire, so missing responses are checked against how TCP repaired the stream. An extracted object is identified by its hash, which is what ties a network transfer to a file on a host.

The next lesson reads the same kind of activity without packets, from the logs that most networks keep instead.

Versions this lesson relies on: Wireshark and TShark 4.6.9; Zeek 9.0.1 (LTS); Suricata 8.0.8.