Skip to main content

Digital Forensics

Core Principles

Preserve → Acquire → Analyze → Report

Never work on original evidence — always work from a forensic copy.


Chain of Custody

A documented, unbroken record of who handled evidence, when, and how.

Required fields:
- Evidence ID / case number
- Description of evidence
- Date/time collected
- Collected by (name + signature)
- Location of collection
- Hash value of original
- All transfers (who → who, date/time, reason)

Formal, legally mandated preservation of data relevant to litigation or investigation.
Prevents deletion, modification, or destruction of ESI (Electronically Stored Information).


Evidence Acquisition

# Forensic disk image (preserve original)
dd if=/dev/sda of=/mnt/evidence/image.dd bs=4M status=progress
dcfldd if=/dev/sda of=image.dd hash=sha256 hashlog=hash.txt

# Verify integrity
sha256sum image.dd > image.dd.sha256
md5sum image.dd > image.dd.md5

# Mount read-only (never write to evidence)
mount -o ro,loop image.dd /mnt/evidence

Preservation Techniques

TechniquePurpose
Write blockersHardware/software to prevent any writes to original media
Hashing (MD5/SHA-256)Verify evidence integrity at every stage
Secure storagePhysically controlled environment with access logging
Legal complianceFollow jurisdiction-specific rules of evidence

E-Discovery

Collection and preservation of ESI as evidence in legal proceedings.

Covers:
- Emails and attachments
- Documents, spreadsheets
- Databases
- SMS / MMS / instant messages
- Cloud storage, backups
- Log files

Memory Forensics (Volatility)

# Identify profile
volatility -f memory.dmp imageinfo

# Running processes
volatility -f memory.dmp --profile=Win7SP1x64 pslist
volatility -f memory.dmp --profile=Win7SP1x64 pstree

# Network connections
volatility -f memory.dmp --profile=Win7SP1x64 netscan

# Command history
volatility -f memory.dmp --profile=Win7SP1x64 cmdscan

# Find injected code
volatility -f memory.dmp --profile=Win7SP1x64 malfind

# Dump a process
volatility -f memory.dmp --profile=Win7SP1x64 procdump -p PID -D /output/

File Carving

# Recover files from image
foremost -i image.dd -o /output/
photorec image.dd

# Strings from binary
strings -n 8 image.dd | grep -i "password\|http\|login"

Investigation Data Sources

SourceValue
Firewall logsTrack, analyze, and detect suspicious traffic
IDS/IPS logsIntrusion attempts, signatures triggered
Endpoint logsUser behavior, process execution, file changes
Application logsApp errors, auth events, data access
Network logsTraffic patterns, connections, DNS queries
SIEM dashboardCorrelated view across all sources
Packet capturesFull payload analysis of network communication
MetadataOrigin, timestamps, interactions — used to reconstruct timelines

Reporting

Documents must include:

  • Methods used
  • Tools and versions
  • Findings and conclusions
  • Chain of custody record
  • Hash verification results
  • Timeline of events