Skip to content

Lesson 2 of 9 · 28m

Forensic Imaging, Hashing, and Write Blocking

Acquire complete, verifiable disk images using write protection, correct formats, and hash validation at every transfer boundary.

An image is the foundation of disk forensics. If acquisition is sloppy, every artifact you later discuss inherits that sloppiness. The goal is not merely to copy bytes; it is to prove that the bytes in your evidence container are the same bytes that were on the device at acquisition time, and that nothing you wrote went the other direction.

Image the device, not the convenient directory

A logical copy of Documents misses unallocated space, deleted files, volume shadow copies, slack, journals, and filesystem metadata. A full disk image preserves the partition table and every byte in order:

sudo dc3dd if=/dev/sdb of=/evidence/case42/sdb.img \
  hash=sha256 hlog=/evidence/case42/sdb.hashlog \
  log=/evidence/case42/sdb.acquisition.log

dcfldd is another common choice. On modern Linux, plain dd can work, but purpose-built imaging tools make hashing and audit logging harder to forget.

Use a write blocker when hardware access matters

A write blocker is a control between the evidence drive and your acquisition host. Hardware blockers are preferred for removable media because operating systems like to be helpful: they mount volumes, update metadata, replay journals, index content, or write thumbnails. Software write blocking can be valid, but only when you can explain how it is enforced.

evidence drive -> hardware write blocker -> acquisition host -> evidence storage

Document blocker model, firmware if available, serial numbers, and whether the device was tested before use. An untested blocker is a belief, not a control.

Hash at acquisition and again at verification

MD5 still appears in old workflows, but SHA-256 is the modern default. Calculate acquisition hashes, then verify after copying or moving evidence:

sha256sum /evidence/case42/sdb.img | tee /evidence/case42/sdb.sha256
sha256sum -c /evidence/case42/sdb.sha256

A hash mismatch does not tell you which copy is correct. It tells you that one side changed or transferred incorrectly. Stop and resolve it before analysis continues.

Know your image format

Raw dd images are simple and universally supported. E01 files add compression, chunking, embedded metadata, and acquisition hashes. AFF4 supports modern evidence containers and sparse data. Pick based on tooling and case needs, not fashion. Record the format, compression, acquisition tool version, source device capacity, and any unreadable sectors.

Bad sectors are evidence too

A failing drive may produce partial reads. Tools such as ddrescue prioritize readable regions first and retry bad areas later:

sudo ddrescue -d /dev/sdb /evidence/case42/failing.img /evidence/case42/ddrescue.map

Never pretend a zero-filled retry is original evidence. Preserve the map file and document exactly which ranges were unreadable.

Field notes

  • Mounting evidence read-write, even accidentally, can update journals and timestamps; mount images read-only in analysis.
  • Verify that /dev/sdb really is the target device before imaging; device letters change when drives are attached.
  • USB bridges may report capacity differently or hide HPA/DCO regions. Document bridge behavior.
  • Do not sanitize or re-use acquisition logs. They are part of the evidence record.
  • Cloud and mobile acquisition often are not full-disk imaging exercises; adapt the method and say so explicitly.

Was this lesson helpful?

Sign in to rate