Network Beginner Network Analysis / Packet Capture / Threat Detection

Wireshark � Network Analysis

A practical guide to capturing and analysing network traffic with Wireshark � covering display filters, protocol dissection, stream following, and identifying malicious activity in packet captures.

15 min read Hands-on Blue Team / DFIR

// What is Wireshark?

Wireshark is a free, open-source network protocol analyser. It captures live network traffic or reads from saved packet capture files (.pcap / .pcapng) and lets you inspect every packet in detail � from raw bytes up to application-layer data.

As a SOC analyst or DFIR responder, Wireshark is invaluable for investigating suspicious network activity, analysing malware command-and-control traffic, reconstructing file transfers, and understanding exactly what a compromised host was communicating with.

Wireshark uses libpcap (Linux/macOS) or Npcap (Windows) for live capture. On Windows, install Npcap when prompted during the Wireshark installer � without it, live capture won't work.

// Interface Overview

Wireshark's main window is split into three panes. Understanding what each one shows saves a lot of time when you're working through a large capture.

Packet List (top)

One row per packet. Shows number, timestamp, source/destination IP, protocol, length, and a summary. Click a row to select it.

Packet Details (middle)

Dissected layers for the selected packet � expanding each layer shows every field decoded from the raw bytes. Right-click any field to build a filter from it.

Packet Bytes (bottom)

Raw hex dump of the packet alongside ASCII decode. Highlighted bytes correspond to the field selected in the details pane.

Colour coding

Wireshark colours packets by protocol and state out of the box. You can customise colouring rules under View > Colouring Rules.

Default colourMeaning
Light greenTCP traffic
Light blueUDP traffic
Dark blueDNS queries / responses
Black (red text)TCP errors � bad checksum, retransmissions, out-of-order
YellowWindows-specific protocols (SMB, NetBIOS)
Purple / magentaICMP traffic

// Capture Filters

Capture filters are applied before packets are recorded. They reduce the volume of data captured, which matters on busy networks. Capture filters use BPF (Berkeley Packet Filter) syntax � different from display filter syntax.

Capture filters discard non-matching packets permanently. If you're not sure what you need, capture everything and use display filters to narrow it down afterwards � you can't get back packets that were filtered out at capture time.

FilterWhat it captures
host 192.168.1.10All traffic to or from a specific IP
src host 192.168.1.10Traffic originating from a specific IP
dst host 10.0.0.1Traffic destined for a specific IP
net 192.168.1.0/24All traffic within a subnet
port 443Traffic on port 443 (HTTPS) in either direction
tcp port 80TCP traffic on port 80 only
not port 22Exclude SSH � useful to stop your own session flooding the capture
tcpTCP traffic only
udpUDP traffic only
icmpICMP only (ping, traceroute)
host 1.2.3.4 and port 80HTTP traffic to/from a specific host

// Display Filters

Display filters are applied after capture � they hide packets that don't match without discarding them. This is the filter you'll use most during analysis. Display filters use Wireshark's own syntax and support any decoded field in any protocol.

The filter bar turns green for a valid filter, red for an invalid one, and yellow for a valid but potentially unintentional expression. Right-click any field in the Packet Details pane and choose Apply as Filter to build filters automatically.

General syntax

OperatorMeaningExample
==Equalsip.addr == 10.0.0.1
!=Not equalsip.addr != 10.0.0.1
> / <Greater / less thanframe.len > 1000
containsField contains a stringhttp.host contains "evil"
matchesRegex matchdns.qry.name matches "\.ru$"
&&ANDip.src == 10.0.0.1 && tcp.port == 80
||ORtcp.port == 80 || tcp.port == 443
!NOT!arp

Common display filters

FilterShows
ip.addr == 192.168.1.10All traffic to or from an IP
ip.src == 192.168.1.10Traffic from a specific source
tcp.port == 4444Traffic on a specific port � common C2 port
httpHTTP traffic only
http.requestHTTP GET/POST requests only
http.request.method == "POST"HTTP POST requests � data being sent out
dnsAll DNS queries and responses
dns.qry.name contains "pastebin"DNS lookups for a specific domain pattern
tlsTLS handshakes and encrypted traffic
tls.handshake.type == 1TLS Client Hello � start of a new TLS connection
tcp.flags.syn == 1 && tcp.flags.ack == 0TCP SYN packets only � useful for port scan detection
icmpAll ICMP traffic � ping sweeps, tunnelling
smb || smb2SMB file sharing � lateral movement indicator
frame contains "password"Any packet containing the word "password" in plaintext

// Protocol Analysis

Most investigations focus on a handful of protocols. Knowing what to look for in each one saves time.

HTTP

HTTP is plaintext, so everything is readable in Wireshark. Key fields to inspect:

FieldWhere to find itWhat to look for
Request URIhttp.request.uriSuspicious paths, encoded parameters, shell commands in URLs
Host headerhttp.hostDomain contacted � compare against threat intel
User-Agenthttp.user_agentMalware often uses fake or unusual User-Agent strings
POST bodyHTTP > Line-based text dataCredentials, exfiltrated data, C2 check-ins
Response codehttp.response.code200 = success, 404 = not found, 302 = redirect
Content-Typehttp.content_typeUnexpected types (e.g. application/octet-stream from a suspicious host)

DNS

DNS is a common channel for C2, exfiltration, and reconnaissance. Filter with dns and look for:

High Query Volume

Hundreds of queries to the same domain in a short window � likely beaconing or DGA (Domain Generation Algorithm) malware.

Long Subdomains

Subdomains longer than ~50 characters are suspicious � DNS tunnelling encodes data as subdomains (e.g. aGVsbG8gd29ybGQ.evil.com).

Random-looking Domains

DGA malware generates domains algorithmically. Look for high consonant clusters, random alphanumeric strings, or domains that fail a dictionary check.

Unusual Record Types

TXT and NULL record queries are rare in normal traffic but common in DNS tunnelling tools like dnscat2 and iodine.

TLS / HTTPS

The payload of TLS traffic is encrypted, but the handshake is visible. The Server Name Indication (SNI) field in the Client Hello reveals the destination hostname even over HTTPS.

Filter for TLS Client Hellos: tls.handshake.type == 1 � then look at tls.handshake.extensions_server_name for the destination domain.

If you have the server's private key or a pre-master secret log file, Wireshark can decrypt TLS traffic. Go to Edit > Preferences > Protocols > TLS to configure decryption.

// Following Streams

Wireshark reassembles fragmented packets and lets you read the full conversation between two hosts as a continuous stream. This is one of the most useful features for incident investigation.

Right-click any packet and choose Follow > TCP Stream (or UDP Stream, HTTP Stream, etc.). The stream window shows the full data exchange � client data in red, server data in blue by default.

Stream typeBest used for
TCP StreamAny TCP connection � raw reassembled data. Essential for shell sessions, custom protocols, or anything not decoded by a dissector.
UDP StreamUDP sessions � DNS responses, TFTP file transfers, custom UDP protocols.
HTTP StreamHTTP request and response together. Useful but TCP Stream often shows more.
TLS StreamEncrypted TLS data � only readable if you have keys loaded.

In the stream viewer, change the encoding from ASCII to Raw or Hex Dump if you're looking at binary data (malware downloads, file transfers). Use the Save as button to extract the raw content.

// Statistics & Analysis Tools

The Statistics and Analyze menus contain tools that give you a high-level picture of a capture before diving into individual packets.

ToolMenuWhat it does
Protocol HierarchyStatisticsBreakdown of protocols in the capture by packet count and bytes � instantly shows what makes up the traffic.
ConversationsStatisticsLists all communication pairs (IP, TCP, UDP) with byte counts. Sort by bytes to find high-volume connections.
EndpointsStatisticsAll unique IP/MAC addresses � useful for identifying active hosts.
I/O GraphStatisticsTraffic volume over time. Spikes indicate bursts of activity � useful for correlating with a timeline.
DNS StatisticsStatistics > DNSSummary of DNS query types, response codes, and top queried domains.
HTTP StatisticsStatistics > HTTPRequest types, response codes, and packet counter for HTTP traffic.
Expert InformationAnalyzeWireshark's automated findings � errors, warnings, notes. Start here when reviewing an unfamiliar capture.
TCP Stream GraphsStatistics > TCP Stream GraphsVisualise TCP sequence numbers, throughput, RTT, and window scaling for a selected connection.

Start with Protocol Hierarchy and Conversations. On an unfamiliar capture, these two views tell you what protocols are present and which hosts are talking the most � giving you a quick triage picture before reading individual packets.

// Identifying Suspicious Traffic

These are common patterns to look for when analysing a capture for malicious activity.

Port scanning

A host sending SYN packets to many ports on the same target in rapid succession. Filter and look for RST responses indicating closed ports.

Wireshark Display Filter
tcp.flags.syn == 1 and tcp.flags.ack == 0 and ip.src == 192.168.1.10

C2 beaconing

Malware that phones home on a regular interval shows up as evenly spaced connections � often to the same IP and port. Use Statistics > Conversations, sort by packet count, and look for repeated low-volume sessions at regular intervals.

Cleartext credentials

Credentials sent over unencrypted protocols (FTP, Telnet, HTTP Basic Auth, SMTP) are readable directly in Wireshark.

Wireshark Display Filter
ftp.request.command == "PASS"
Wireshark Display Filter
http.authorization

ARP poisoning

An attacker floods the network with ARP replies mapping their MAC to another host's IP � enabling man-in-the-middle. Look for a single MAC claiming multiple IP addresses.

Wireshark Display Filter
arp.opcode == 2

DNS exfiltration

Data encoded as subdomains in DNS queries � tunnelling tools like dnscat2 generate long, encoded subdomains at high frequency.

Wireshark Display Filter
dns.qry.name matches "\.[a-z0-9]{30,}\."

Suspicious indicators at a glance

IndicatorWhat it suggests
Outbound traffic on uncommon ports (4444, 1337, 8888)Reverse shell or C2 channel
ICMP packets with large payloads (>64 bytes)ICMP tunnelling for C2 or exfiltration
HTTP POST to an IP address (no domain)C2 check-in, data exfiltration
Unusual User-Agent strings in HTTPMalware mimicking a browser, or using a custom agent
Base64 strings in HTTP URIs or POST bodiesObfuscated payload or encoded data being sent
Repeated connections to a single external IP at regular intervalsBeaconing malware
SMB connections between non-server workstationsLateral movement, ransomware spreading
TLS to non-standard portsC2 using encrypted channel on an unexpected port

// Exporting Artefacts

Wireshark can reconstruct and export files and objects that were transferred during the captured session.

Export HTTP objects

Go to File > Export Objects > HTTP. Wireshark lists all files transferred over HTTP � images, scripts, executables, documents. Select items and save them for further analysis.

Handle exported files carefully. If you're extracting files from a malware capture, export to an isolated directory and analyse in a sandbox. An exported file could be a live executable.

Other export options

OptionMenu pathUse case
Export Objects > SMBFile > Export ObjectsExtract files transferred over SMB file shares
Export Objects > TFTPFile > Export ObjectsExtract TFTP file transfers � common in network device configs
Export Specified PacketsFile > Export Specified PacketsSave a filtered subset of packets as a new .pcap � useful for sharing a relevant slice of a large capture
Export Packet DissectionsFile > Export Packet DissectionsSave decoded packet data as CSV, JSON, or plain text for reporting or further processing

// Tips & Best Practices

Use tshark for large captures. Wireshark's command-line companion tshark can apply display filters, extract fields, and output to CSV or JSON without loading the full capture into the GUI � much faster for multi-GB pcap files.

Right-click to build filters. In the Packet Details pane, right-click any field and choose Apply as Filter > Selected to instantly populate the display filter bar. Faster and less error-prone than typing filters manually.

Save your filter expressions. You can bookmark frequently used display filters by clicking the + button next to the filter bar. Name them so you can reuse them quickly across investigations.

Name resolution can mislead. Wireshark resolves IP addresses to hostnames by default. Disable it under View > Name Resolution if DNS is slow or you want to see raw IPs. Resolved names are based on the capture machine's DNS � not necessarily accurate for the network you're analysing.

Encrypted traffic is the norm. Most modern traffic is TLS � Wireshark shows metadata but not payloads without keys. Focus on DNS, TLS SNI, certificate fields, and traffic patterns when payloads are encrypted. You can still extract a lot of context without decryption.