Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

How to collect digital evidence

After this lesson: I can collect digital evidence in a sensible order without changing it.

55 min lesson3 commandsIncident response and forensics lab: investigate a compromised server in your browser

Why a switched-off server loses evidence

Digital evidence is any data on a device that can show what happened, such as a log, a file or a running program. It is easy to spoil: switching a machine off, or opening a file the wrong way, can change or erase what you wanted to keep.

In this lesson you learn which evidence to collect first, and how to keep it so that other people can trust it.

By the end of this lesson

Note

I can collect digital evidence in a sensible order without changing it.

Key words

WordWhat it means
Digital forensicsfinding and keeping evidence from computers so it can be checked
Volatiledata that is lost when the power goes off
Order of volatilitythe order to collect evidence, the most fragile first
Working copya duplicate you examine instead of the original
Chain of custodya written record of who held the evidence, and when
Write protectedset so that nobody can change it by accident

The cells students fill in are left blank in this preview.

Some evidence vanishes when the power goes off

Memory (RAM) holds the programs that are running now. It is volatile: switch the machine off and it is gone. A file on the disk stays until somebody deletes or overwrites it.

So you collect in the order of volatility. The most fragile evidence comes first, and the most lasting comes last.

Worked example: the order of volatility

OrderEvidenceHow long it lasts
1Memory (RAM)Until the machine restarts
2Network connectionsSeconds to minutes
3Running processesUntil they stop
4Temporary filesUntil a restart or a clean-up
5Files on the diskUntil deleted or overwritten
6Logs on another machineUntil the other machine rotates them
7Backups and archivesMonths or years

The cells students fill in are left blank in this preview.

Never examine the original

Every time you open the original, you risk changing it. So you make a working copy and examine that. The original stays untouched, and anybody can go back to it.

In this lab the evidence in the folder case is already write protected. You will see that first, then copy it.

Who owns a file, and its mode

Command
stat -c "%a %U" case/etc/passwd

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Try to add a file to the evidence

Command
touch case/etc/new.txt

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Make a working copy

Command
cp -rT --preserve=timestamps case work

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

A common mistake

Warning

Many people think that only looking at a file leaves it alone. But opening a file can change the time it was last opened, and some programs write to a file as they open it. Open a copy, never the original, and keep the original read only.

A chain of custody lists who held it

Evidence is only worth something if people believe it is the same as when you found it. The chain of custody is a written list: who had it, when, what they did and why.

Any gap in the list is a gap in the story. A court, a manager or a lecturer may ask you to fill it.

Worked example: a chain of custody record

TimeWhoWhat was doneFingerprint of the copy
09:05R. KhanCopied the shop server logs to a USB drive9f2c41ab
09:40R. KhanGave the USB drive to J. Moore, who locked it away9f2c41ab
14:10J. MooreMade a working copy to examine9f2c41ab

The cells students fill in are left blank in this preview.

Going further

Write the chain of custody for a laptop that you take from a desk at 10:00 and hand to a colleague at 10:20. List each person, each time and each action in a table. Then say what could go wrong if the 10:00 to 10:20 row is missing.

About this lab and its source: Incident response and forensics lab: investigate a compromised server in your browser

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.