Skip to content

Lesson 2 of 9 · 21m

Handling Samples and Preserving Provenance

Receive, store, identify, hash, and document malware specimens without losing chain of custody or executing them accidentally.

Most analysts remember the payload. Good analysts remember where it came from, who touched it, how it arrived, what it was named, and which bytes were actually analyzed. Six weeks later, provenance is the difference between intelligence and a folder full of mystery files.

Store malware like evidence

Use encrypted or access-controlled storage with a predictable structure. A simple case layout is enough:

case-041/
  intake/
    original-email.eml
    invoice.zip
  samples/
    invoice.zip.sha256
    8d77f1...exe
  analysis/
    notes.md
    strings.txt
    pcaps/
  indicators/
    yara-rules.yar
    iocs.csv

Keep the original container untouched. Analyze copies. If the specimen arrived inside a ZIP, preserve the ZIP, its password source, and the extracted file separately.

Hash first, rename second

Compute hashes before moving or extracting anything:

sha256sum invoice.zip
sha256sum extracted/invoice.exe
certutil -hashfile invoice.exe SHA256

Name working copies by SHA256 or by a case identifier plus hash prefix. Original filenames are attacker-controlled metadata; they are useful evidence but terrible identifiers. invoice.pdf.exe tells a social-engineering story, not a unique identity.

Record provenance while it is fresh

For every specimen record source, time, recipient, delivery mechanism, parent process, original URL or message ID, extraction path, hashes, size, file type, and confidence that the bytes are complete:

2026-02-18T14:32Z
source: phishing report from finance mailbox
delivery: attachment in message-id <b5c2@mailer.example>
original name: remittance-advice.iso
sha256: 8d77f1...
notes: extracted from ISO, not directly downloaded

That parent context matters. A DLL sideloaded by a signed executable behaves differently from a lone executable, and the original container may carry Mark-of-the-Web metadata.

Field notes

  • Do not strip metadata to “make the sample clean.” The wrapper, timestamps, overlay, certificate, and archive comments may be evidence.
  • Keep a copy in write-only or offline storage if legal or incident-response preservation matters.
  • Record extraction errors. Corrupt samples and partial downloads often explain impossible analysis results.
  • A hash identifies bytes, not a family. Identical behavior can appear across repacked samples with different hashes.

Was this lesson helpful?

Sign in to rate