Skip to content
Pwnversity
DFIR-REDadvanced · 8 min · upd. 2026-11

Network forensics

T1071T1041Wireshark

Network forensics rebuilds malicious activity from what crossed the network: packet captures, flows, DNS, proxy, firewall and cloud firewall logs. It has an advantage no other source offers: the attacker does not control the network sensors, so they cannot erase what was already recorded there. It complements memory and disk analysis and is the main source for sizing an exfiltration.

  • Who the host talked to: C2 infrastructure, download servers, exfiltration destinations.
  • How much left: bytes sent per destination and period, the figure a regulator asks for in a breach.
  • Lateral movement: SMB, RDP, WinRM or SSH between internal hosts (lateral movement).
  • Scope: which other hosts contacted the same infrastructure, even without EDR.
Source Content Typical retention Limitation
Full PCAP Every packet, with content Hours or days (huge volume) Encryption; only where a sensor exists
Flows (NetFlow, IPFIX, VPC Flow Logs) Who, with whom, ports, bytes, duration Months No content
Zeek Per-protocol logs: connections, DNS, HTTP, TLS, files, certificates Months Depends on sensor placement
DNS (resolvers, Sysmon 22) Which names were queried and from which host Varies Encrypted DNS (DoH, DoT) bypasses it
Proxy and web gateway URL, user, category, bytes, user agent Months Only traffic that goes through it
Firewall and cloud firewall Allowed and denied connections Weeks or months Little detail
EDR Connections per process Per license Only hosts with an agent

The most useful combination in an incident is usually flows or Zeek for scoping (cheap, long retention) and PCAP on critical segments for detail.

flowchart TD
    A["IOC or suspicious host"] --> B["Flows / Zeek conn.log:<br/>destinations, volume, duration"]
    B --> C{"Anomalous pattern?"}
    C -->|"periodic connections"| D["Beaconing: intervals<br/>and jitter"]
    C -->|"lots of outbound volume"| E["Exfiltration:<br/>bytes per destination"]
    C -->|"internal SMB/RDP"| F["Lateral movement"]
    D --> G["DNS, TLS (SNI, JA4),<br/>certificates, HTTP"]
    E --> G
    F --> H["Correlate with 4624/4648<br/>and the timeline"]
    G --> I["PCAP if available:<br/>extract files and payloads"]
    I --> J["IOCs to the rest of the fleet"]

The following outputs come from a lab capture in which a simulated client polled an HTTP server every 5 seconds with ±0.5 s of random variation, as a beacon would:

Ventana de terminal
tshark -r lab.pcap -q -z conv,tcp # conversations: who, how much, when
tshark -r lab.pcap -q -z http,tree # summary of HTTP requests and responses
tshark -r lab.pcap -Y http.request -T fields \
-e frame.time_epoch -e http.request.uri -e http.user_agent
tshark -r lab.pcap --export-objects http,objects/ # files transferred over HTTP
1795179737.412330000 /?id=28342 Mozilla/5.0 (compatible; upd)
1795179742.187913000 /?id=9471 Mozilla/5.0 (compatible; upd)
1795179747.527213000 /?id=27526 Mozilla/5.0 (compatible; upd)

Other useful display filters:

Goal Filter
A host’s DNS queries dns.flags.response == 0 && ip.src == 10.0.0.15
TLS server names (SNI) tls.handshake.type == 1 and the tls.handshake.extensions_server_name field
HTTP POST requests http.request.method == "POST"
SMB2 between internal hosts smb2 && ip.dst == 10.0.0.0/8
Initiated connections (SYN) tcp.flags.syn == 1 && tcp.flags.ack == 0

Wireshark is for manual inspection; Zeek turns a PCAP into structured logs (zeek -r capture.pcap produces conn.log, dns.log, http.log, ssl.log, files.log), much easier to search at scale. NetworkMiner extracts files, credentials and hosts from a PCAP visually.

A C2 implant calls home at regular intervals, usually with random variation (jitter) so it does not look automated. Connection times to a destination are enough to measure it:

Ventana de terminal
tshark -r lab.pcap -Y http.request -T fields -e frame.time_epoch | python3 -c '
import sys, statistics as s
t = [float(x) for x in sys.stdin]; d = [b - a for a, b in zip(t, t[1:])]
print("requests", len(t), "| mean %.2fs | stdev %.2fs | jitter %.0f%%" % (s.mean(d), s.pstdev(d), 100*s.pstdev(d)/s.mean(d)))'
requests 12 | mean 4.91s | stdev 0.33s | jitter 7%

A small deviation relative to the mean across many connections to the same destination is the signature of beaconing. At scale, RITA runs on Zeek logs and scores the regularity of every source-destination pair. Legitimate software (updates, telemetry, NTP) also beacons: the result is a list of candidates to validate, not a verdict.

Almost all traffic is TLS: the content is hidden, but the metadata still talks.

  • SNI and certificates: the requested server name and the presented certificate (issuer, dates, self-signed). A freshly issued certificate for a freshly registered domain is a classic signal.
  • TLS client fingerprint: JA3 became unreliable once browsers started shuffling TLS extensions; JA4 (and the JA4+ family) replaces it and is computed by Zeek, Wireshark and many platforms.
  • Sizes and timing: byte and interval patterns are still visible.
  • Decryption: only with the key. On your own hosts, SSLKEYLOGFILE makes browsers write session keys that Wireshark uses to decrypt; at the perimeter, the proxy’s TLS inspection. More context in TLS.
  • ECH (Encrypted Client Hello) also encrypts the SNI; where it is used, the server name is no longer visible on the wire.
  • Volume: outbound bytes per destination and per host, compared with the baseline. Spikes toward storage services (MEGA, file-sharing services) or toward IPs with no domain.
  • Tools: rclone, WinSCP or curl to cloud storage are common in ransomware double extortion.
  • DNS tunnels: long, high-entropy subdomains, lots of TXT records, abnormal query volume toward a single domain.
  • DNS over HTTPS: a host querying DoH directly against an external resolver bypasses corporate DNS; detecting it means looking at TLS connections to known resolvers.
  • Encryption and legitimate protocols: C2 over HTTPS to well-known services (cloud storage, messaging, CDNs) to blend in with normal traffic.
  • Jitter and office hours: variable intervals and activity only during working hours to avoid standing out.
  • Domain fronting and redirectors: the SNI points to a legitimate domain while the real traffic goes elsewhere.
  • DoH and ECH: hide DNS queries and the server name.
  • Tunnels (DNS, ICMP, SSH over 443) to get around egress controls.
  • Operation Triangulation (Kaspersky, June 2023): Kaspersky detected an espionage campaign against its own staff’s iPhones while monitoring traffic on its corporate Wi-Fi network, which showed anomalous connections from the devices. The investigation then continued with iPhone backups and MVT (mobile forensics). Lesson: on devices where no agent can be installed, the network is often the only sensor available.
  • Inventory of network sources and their retention (PCAP, flows, Zeek, DNS, proxy, firewall, cloud)
  • Exports preserved with a hash before they rotate
  • Destinations of the affected host and volume per destination
  • Beaconing assessed (intervals, jitter, RITA) and validated
  • DNS: new domains, high entropy, tunnels, DoH
  • TLS: SNI, certificates, JA4
  • Internal lateral movement (SMB, RDP, WinRM, SSH)
  • Files and payloads extracted from the PCAP → sample triage
  • IOCs hunted across the network (IOC management) and merged into the timeline