Skip to main content
Digital Forensics Principles & Chain of Custody
Lesson 23 of 24

Digital Forensics Principles & Chain of Custody

Apply core digital forensics principles, prioritize evidence using the order of volatility, verify bit-level integrity with SHA-256 and write-blockers, and maintain a defensible chain of custody.

Intermediate 22 min Blue Team / SOC

Learning objectives

  • Explain the core principles of digital forensics and why original evidence must remain unaltered
  • Prioritize evidence collection according to the RFC 3227 order of volatility
  • Verify evidence integrity using SHA-256 cryptographic hashes and write-blocking controls
  • Document every evidence transfer and handling step in a complete chain of custody record

Recommended first: Incident Response Lifecycle & Triage Containment

#Why this matters

During incident response triage and containment, responders isolate affected hosts to stop an attack. Once an investigation moves toward root-cause analysis, disciplinary action, or legal proceedings, technical findings alone are not enough. Investigators must prove that the digital evidence presented in a report is identical to what existed on the system at the time of the incident and has not been altered, fabricated, or confused with another source.

Even an unintentional change can invalidate key artifacts. Booting a seized laptop or plugging a suspect USB drive directly into a workstation causes the operating system to update timestamps, write mount metadata, or replay filesystem journals. Sound forensic practice prevents those silent edits from the first minute of handling.

#Core principles of digital forensics

NIST SP 800-86 defines four phases in the forensic process: collection, examination, analysis, and reporting. Across every phase, three foundational rules protect the credibility of the work:

  1. Never analyze original media. Acquire a bit-for-bit image of the original drive, seal the original, and perform all analysis on a verified working copy.
  2. Preserve repeatability. Record the exact tools, versions, commands, and UTC timestamps used so an independent examiner can repeat the steps and reach the same result.
  3. Prioritize by volatility. Following IETF RFC 3227, collect fragile data before durable data, because power loss or normal background activity erases volatile state first.
Priority Evidence source Typical lifespan
1 (Highest) CPU registers, cache, and active RAM Seconds to loss of power
2 Network connections, routing tables, and process tables Seconds to minutes
3 Temporary filesystems and swap space Minutes to reboot
4 Persistent disks (SSD, HDD, USB media) Days to years unless overwritten
5 (Lowest) Remote logs, SIEM archives, and offline backups Months to years

Because solid-state drives perform background garbage collection and TRIM operations while powered on, even persistent storage can lose deleted blocks quickly if left running. Responders capture RAM and live network state first, then acquire or isolate the drive promptly.

#Write-blockers and hash verification

Connecting suspect storage directly to an analysis machine risks immediate contamination. Modern operating systems automatically mount filesystems, update last-access metadata, create hidden indexing folders, or flush dirty filesystem journals.

A hardware write-blocker sits physically between the suspect drive (SATA, NVMe, or USB) and the forensic workstation. It allows read commands through while intercepting and rejecting all write commands at the interface level. When a hardware blocker is unavailable in a lab, responders apply software read-only controls (such as blockdev --setro and read-only mount options) before accessing an image, though hardware blocking remains the standard for physical seized drives.

Once data is acquired, examiners prove bit-for-bit integrity with a SHA-256 cryptographic hash. Legacy algorithms such as MD5 and SHA-1 are vulnerable to practical collision attacks and are not sufficient on their own for modern integrity assurance. If a single bit in a multi-gigabyte disk image changes, its SHA-256 digest changes completely.

Generating and verifying a SHA-256 manifest in a lab
$ sha256sum evidence_disk01.raw > evidence_disk01.sha256
$ cat evidence_disk01.sha256
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  evidence_disk01.raw
$ cp evidence_disk01.raw working_copy.raw
$ sha256sum working_copy.raw
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  working_copy.raw
$ sha256sum -c evidence_disk01.sha256
evidence_disk01.raw: OK

Notice the workflow: hash immediately at acquisition, store the digest alongside the evidence record, and verify every working copy against that baseline before starting analysis.

#Maintaining the chain of custody

Technical hashing proves what the data contains; the chain of custody proves who controlled it and when. Every physical drive, memory capture, and optical disc receives a unique evidence identifier and a chronological log from collection through archival or disposal.

  1. Identify & LabelAssign unique ID, photograph ports and serial numbers
  2. Acquire & HashImage via write-blocker and record SHA-256 digest
  3. Seal & StorePlace original in tamper-evident bag inside locked vault
  4. TransferLog date/time (UTC), releasing and receiving custodians, and purpose
  5. Analyze CopyVerify SHA-256 on working copy before running forensic tools

A complete chain of custody form records at least:

  • Case and item ID: Unique reference number plus make, model, capacity, and serial number.
  • Acquisition details: Collector name, exact physical or network location, tool used, and baseline SHA-256 hash.
  • Transfer entries: Date and time in UTC, printed names and signatures of both the releasing and receiving individuals, and the specific reason for transfer.

#Common mistakes

  • Plugging suspect media directly into a live OS: Automounting writes filesystem metadata and alters timestamps before acquisition begins.
  • Recording local timestamps without timezone offsets: Mixing local time across responders creates timeline contradictions; always use UTC.
  • Relying only on MD5 or skipping post-copy checks: Weak hashes and unverified copies leave silent storage corruption undetected.
  • Leaving custody gaps: Passing a drive across a desk or leaving it in an unlocked cabinet without a signed transfer entry breaks the chain of custody.

#Summary

Digital forensics requires preserving original evidence untouched, working only on verified copies, and documenting every step for repeatability. Following RFC 3227's order of volatility ensures ephemeral memory and network state are captured before persistent storage. Combining write-blockers, SHA-256 integrity verification, and a continuous UTC-timestamped chain of custody ensures evidence remains trustworthy from triage through reporting.

Knowledge check

Sign in to take the test, complete lessons and save your progress. Log in

Practice: test your knowledge