Skip to main content
DARKPC.NET

Hash a Practice Evidence File and Verify the Manifest

Create a SHA-256 record for a synthetic evidence file and demonstrate how verification catches an altered working copy.

Difficulty Beginner

Prerequisites

Use a Linux terminal with GNU coreutils and an empty practice directory. You will create synthetic files. Work on material you own or are expressly authorised to handle. A real incident requires a documented acquisition method, restricted storage and appropriate handling of originals.

Create and verify a baseline

In the practice directory, create a small text file and record its digest alongside the filename.

printf '%s\n' 'Synthetic event at 10:00 UTC' > lab-event.txt
sha256sum -- lab-event.txt > capture.sha256
sha256sum --check --strict capture.sha256

The manifest contains a hexadecimal digest and a relative path. The check reads that path from your current directory and returns success when the current bytes match. Expect lab-event.txt: OK. Preserve a trusted copy of capture.sha256 separately when this pattern is used beyond a practice exercise.

Verify a working copy

mkdir working
cp -- lab-event.txt capture.sha256 working/
(
    cd working || exit 1
    sha256sum --check --strict capture.sha256
    printf '%s\n' 'Synthetic follow-up' >> lab-event.txt
    sha256sum --check --strict capture.sha256
)

The first working-copy verification should pass. The second should report a failed checksum and exit with a nonzero status. The parentheses scope the directory change to the subshell. Run sha256sum --check --strict capture.sha256 again from the parent directory to verify the baseline copy still passes.

Troubleshooting and practice

A missing-file error often means the verification command ran outside the directory implied by the manifest. A formatting error can result from wrapping or editing a manifest by hand. Compare the copy with the trusted baseline manifest before regenerating anything. A checksum records bytes, so it does not establish who created a file or whether the recorded event is true. Log the acquisition date, operator, source, tool version and storage location separately. Rename only the working copy and observe how verification reports a missing file even though its contents are unchanged.

References and related reading