☼
⌃
☰

Wireshark

Table of Contents

Network protocol analyser — captures and inspects traffic at the packet level. Used for malware C2 analysis, credential capture during pentests, troubleshooting, and as evidence in DFIR investigations. Display filters (typed in the filter bar) and capture filters (set before capturing, BPF syntax) are different languages — most day-to-day work uses display filters.

Related: Malware Analysis REMnux Incident Response Pivoting PCAP

Capture

TEXT
Capture → choose interface → start (shark fin icon)
Ctrl+E       — stop/start capture
Ctrl+S       — save capture
File → Open — load a .pcap/.pcapng for offline analysis

Capture Filters (set before capture starts)

TEXT
host 192.168.1.10              # traffic to/from a specific host
net 192.168.1.0/24             # traffic within a subnet
port 443                       # traffic on a specific port
host 192.168.1.10 and port 80  # combine conditions
not arp and not icmp           # exclude noise

Display Filters

Applied after capture, in the filter bar. Different syntax from capture filters.

Basic

TEXT
ip.addr == 192.168.1.10              # traffic to/from this IP
ip.src == 192.168.1.10               # source only
ip.dst == 192.168.1.10               # destination only
tcp.port == 443
udp.port == 53
http
dns
tls

Combining Filters

TEXT
ip.addr == 192.168.1.10 and tcp.port == 443
http.request.method == "POST"
http and ip.addr == 192.168.1.10
not (ip.addr == 192.168.1.1)         # exclude an address (e.g. gateway noise)

HTTP-Specific

TEXT
http.request                          # all HTTP requests
http.request.method == "POST"
http.request.uri contains "login"
http.response.code == 200
http contains "password"              # search payload for plaintext credentials

DNS-Specific

TEXT
dns.qry.name contains "suspicious"
dns.flags.response == 0               # queries only, not responses
dns.qry.type == 1                     # A record queries

TCP Stream Analysis

TEXT
tcp.stream eq 5                       # isolate a single conversation
tcp.flags.syn == 1 and tcp.flags.ack == 0   # SYN packets — connection attempts
tcp.analysis.retransmission           # retransmitted packets — possible issues
tcp.analysis.flags                    # any TCP anomaly

Security and Malware Analysis Use

Following a Conversation

TEXT
Right-click packet → Follow → TCP Stream / HTTP Stream
# Reconstructs the full conversation in readable form —
# fastest way to read plaintext credentials, exfiltrated data,
# or C2 commands sent in cleartext

Extracting Files from a Capture

TEXT
File → Export Objects → HTTP (or SMB, DICOM, etc.)
# Lists every file transferred in the capture — save any of
# interest for separate analysis (e.g. malware dropped via HTTP)

Identifying C2 Beaconing

TEXT
Statistics → Conversations → sort by Duration or Packets
# Look for: regular-interval connections to the same destination,
# small consistent packet sizes, long-duration single conversations

# Filter to isolate a suspect destination
ip.addr == <suspect_C2_IP>

# Statistics → IO Graph — visualise traffic over time, beaconing
# shows as regular spikes at consistent intervals

Credential Capture

TEXT
http contains "password"
http.request.method == "POST" and http contains "pass"
ftp.request.command == "PASS"

DNS Tunnelling / DGA Indicators

TEXT
dns.qry.name.len > 50              # unusually long queries
dns and frame.len > 100            # oversized DNS packets (data exfil)
# DGA domains often appear as long, random-looking subdomains —
# sort Statistics → DNS by query name to spot patterns

Statistics Menu

TEXT
Statistics → Protocol Hierarchy   — breakdown of traffic by protocol
Statistics → Conversations        — every host pair, sortable by volume
Statistics → Endpoints            — every unique host involved
Statistics → IO Graph             — traffic volume over time, spot beaconing

Command Line — tshark

For scripted or headless analysis, tshark provides the same engine without the GUI.

SHELL
# Capture to file
tshark -i eth0 -w capture.pcap

# Read and filter an existing capture
tshark -r capture.pcap -Y "http.request"

# Extract specific fields
tshark -r capture.pcap -Y "dns" -T fields -e dns.qry.name | sort -u

Tips

  • Follow TCP/HTTP Stream is the single highest-value feature for security analysis — reconstructs readable conversations instantly instead of reading packet-by-packet
  • Statistics → Conversations sorted by duration is the fastest way to spot a long-lived C2 connection in a large capture
  • Capture filters reduce file size at capture time; display filters refine an already-captured file — use capture filters when you know what you're looking for in advance, display filters otherwise
  • http contains "password" catches a surprising number of legacy or misconfigured applications still sending credentials in cleartext
  • When analysing malware traffic from Malware Analysis sandbox runs, export HTTP objects first — often the fastest path to the actual payload or C2 response content