Digital Forensics

Network Forensics

Traffic Analysis & Investigation Guide

14 min read

Table of Contents
  1. What is Network Forensics?
  2. Packet Capture Methods
  3. Wireshark Analysis
  4. Key Network Artifacts
  5. Malware Traffic Analysis

What is Network Forensics?

Network forensics is the capture, recording, and analysis of network traffic to discover the source of security attacks or other problem incidents. It's essential for incident response and legal investigations.

Packet Capture Methods

tcpdump

# Capture all traffic on eth0
tcpdump -i eth0 -w capture.pcap

# Capture specific host
tcpdump -i eth0 host 192.168.1.100 -w host.pcap

# Capture HTTP traffic
tcpdump -i eth0 port 80 or port 443 -w http.pcap

# Capture with rotation (100MB files, keep 10)
tcpdump -i eth0 -w capture_%Y%m%d_%H%M%S.pcap -G 3600 -C 100 -W 10

Zeek (formerly Bro)

# Process PCAP file
zeek -r capture.pcap

# Generates logs:
# conn.log - All connections
# dns.log - DNS queries
# http.log - HTTP requests
# ssl.log - TLS/SSL connections
# files.log - Files transferred

Wireshark Analysis

Essential Display Filters

# Filter by IP
ip.addr == 192.168.1.100

# Filter by protocol
http || dns || tls

# Failed TCP connections
tcp.flags.syn == 1 && tcp.flags.ack == 0 && tcp.analysis.retransmission

# HTTP POST requests
http.request.method == "POST"

# Find passwords in cleartext
http contains "password" || ftp contains "PASS"

# DNS queries to suspicious TLD
dns.qry.name contains ".xyz" || dns.qry.name contains ".top"

# Large data transfers (exfiltration)
tcp.len > 10000

Follow Streams

Right-click packet → Follow → TCP Stream to reconstruct full conversation.

Key Network Artifacts

DNS QueriesC2 domains, tunneling, DGA detection
HTTP HeadersUser-agent strings, referrers, cookies
TLS CertificatesSelf-signed, expired, suspicious issuers
Connection DurationBeaconing patterns (regular intervals)
Data VolumeUnusual upload (exfiltration)

Malware Traffic Analysis

Indicators to Look For

Extract Files from PCAP

# Wireshark: File → Export Objects → HTTP

# NetworkMiner (Windows)
# Automatically extracts files, images, credentials

# Foremost
foremost -i capture.pcap -o extracted_files/

Updated: December 2024