Network forensics is the branch of digital forensics that captures, records, and analyzes network traffic to determine the source and course of a security incident or other event. The key difference from classic disk forensics is this: on a disk, evidence stays put; on a network it is fleeting. A packet you do not record the moment it crosses the network is gone for good. Because of that, the discipline relies either on continuous, planned recording of traffic or on fast action right after an event is detected.
What is network forensics?
The term was popularized by Marcus Ranum, who described network forensics as the capture, recording, and analysis of network events to discover the source of attacks or other incidents. In practice it means reconstructing what happened on the network: who talked to whom, over which protocols, which files and commands were sent, and in what order.
The evidentiary material here includes:
- raw packets, that is
PCAPfiles (short for packet capture); - flow records, meaning connection summaries in formats such as NetFlow or IPFIX;
- session logs produced by traffic sensors, for example Zeek;
- logs from network devices: routers, firewalls, DNS servers, and proxies.
Network forensics has two main uses. The first is about security: continuously watching the network for unusual traffic and detecting intrusions. The second is investigative and legal: from recorded traffic you can rebuild transferred files, search for keywords, and reconstruct communications (such as email or chat) for use in proceedings.
How does network forensics work? Catch-it-as-you-can vs stop-look-listen
Data is collected in two ways. They differ in whether you favor a complete dataset or saving resources:
- Catch-it-as-you-can — every packet passing a given point is written to storage, and the analysis is done later. It gives a full view backward in time but eats up huge amounts of disk space and needs fast write speeds.
- Stop-look-listen — each packet is first examined in memory, and only what matters is written to disk (for example session descriptions, alerts, payload slices). It saves space but needs a more powerful processor and carries the risk that a skipped detail will be lost.
A separate distinction is made between live analysis (in real time, while responding to an ongoing incident) and post-incident analysis (from archives, when looking for the cause and gathering evidence).
Full packet capture vs metadata and flow
There are two approaches to how much traffic to record. They differ in depth and cost:
- Full packet capture (FPC) — recording whole packets together with their content, as
PCAPfiles. It lets you rebuild transferred files and analyze content, but it takes up a lot of space. On fast networks that shortens the window over which you keep history. - Flow and metadata — NetFlow, sFlow, or IPFIX record only connection summaries: addresses, ports, protocol, byte and packet counts, timestamps. No content. Logs from sensors such as Zeek add a rich description of the application layer (DNS, HTTP, TLS, SMB) at a fraction of full-PCAP volume. That lets you keep history for months rather than hours.
Mature deployments combine both: continuous flow and metadata as the backbone of history, plus “smart PCAP” that records full packets only around a suspicious event, when an alert fires.
What is the forensic process and chain of custody?
A professional network investigation follows a set sequence. It is often described as OSCAR: Obtain information, Strategize, Collect, Analyze, Report. The typical stages are:
- Identification — defining the scope, the target systems, and the data sources.
- Preservation — locking in the data and protecting its integrity. Each trace gets a cryptographic checksum (for example
SHA-256), the original is kept separate from working copies, and read-only media are used where possible. - Collection — acquiring data from well-placed sensors. They are connected through a TAP (a hardware traffic tap) or through port mirror/SPAN (copying traffic on a switch).
- Examination and analysis — looking for signs of compromise and rebuilding sessions and the attack timeline.
- Presentation — documenting the conclusions for a team or a court.
The chain of custody is critical here. Every transfer of evidence from hand to hand must be recorded: case number, description, location, time, who is taking it over, signature. When a case goes to court, the evidence must meet admissibility standards. In the U.S. these include the Federal Rules of Evidence and the Daubert criteria: the method can be tested, has been peer reviewed, has a known error rate, and is accepted in the field. A mistake at any step, from a poorly placed sensor to a missing checksum, can undermine the entire case.
Which tools does network forensics use?
- Wireshark, tshark, tcpdump — capturing and closely analyzing packets, filtering traffic, and following connection streams.
- Zeek (formerly Bro) — a sensor that produces orderly session logs and a description of the application layer. The foundation when you want to keep history for a long time and more cheaply.
- Suricata, Snort — intrusion detection and prevention systems (IDS/IPS) that match traffic against rules and signatures. They are often what raises the alert that triggers a PCAP recording.
- NetworkMiner — extracts concrete artifacts from PCAP files: files, certificates, credentials.
- NetFlow/IPFIX collectors — gather and analyze flows for long-term history and for spotting unusual spikes in traffic.
How does network forensics differ from computer forensics?
Computer forensics (the forensic analysis of a single machine) examines what stays on one device: the file system, the registry, memory, system logs. Network forensics examines data in motion — fleeting and scattered across many nodes. Network data disappears quickly, but it shows how systems connect to one another and lets you assemble the timeline of an attack that passed through several machines. In practice the two fields complement each other: the computer shows what the attacker did on the machine, and the network shows how they communicated and how they moved.
How does network forensics relate to NDR, DFIR, and incident response?
Network forensics is part of the broader DFIR process (Digital Forensics and Incident Response) and is closely tied to NDR (Network Detection and Response, detection and response at the network layer). The difference is in goal and rigor. NDR and incident response play against the clock: detect, analyze, escalate, contain. Network forensics adds formal evidence preservation on top of that and is geared toward presenting the results, including in court.
The same network telemetry — full packets, flow, and sensor logs — feeds both live detection (SOC teams, threat hunting) and post-incident investigation. For a SOC team the value is concrete: when a SIEM, EDR, or IDS raises an alert, recorded traffic lets analysts confirm or rule out a breach and reconstruct the full course of an attack that single logs would not reveal.
Why is network forensics difficult?
- Volume and retention — full packet capture on a fast network means terabytes per day. Without a hybrid model the history window shrinks to hours.
- Encryption — more and more traffic is encrypted (TLS), so the content is often out of reach. Analysis shifts to metadata, to recognizing connections by their characteristic features (for example JA3/JA4 fingerprints), and to studying the shape of the traffic rather than its content.
- Data volatility — no sensor in the right place at the right time means permanent loss of evidence.
- Sensor placement — server-to-server traffic (east–west), cloud, and hybrid environments call for deliberate placement, otherwise blind spots appear.
- Privacy and compliance — capturing traffic touches personal data and must comply with regulations such as the GDPR.
Learn more
- Cyber Kill Chain — Network forensics can map traffic to stages of the cyber kill chain.
- Visibility — Network forensics depends on visibility into traffic, hosts, and sessions.
- Network TAP — A network TAP provides packet data used in network forensics investigations.
- Data Exfiltration (Wyciek danych) — Network forensics can identify signs of data exfiltration in traffic patterns.
- NSM (Network Security Monitoring) — Network security monitoring supplies evidence and alerts for network forensics.
- Data mining — Data mining helps uncover anomalies and patterns in network forensic data.
- Data Loss Prevention (DLP) — DLP and network forensics both help detect and investigate data leakage.
- BYOD (Bring Your Own Device) — BYOD increases endpoint diversity, making network forensics more complex.