Forensic Principles and the Order of Volatility
The first responder at the infected laptop wants to help. They pull the network cable, reboot "to stop it", run the anti-virus scan that deletes the sample, and copy a few log files to a USB stick. In ten minutes they have destroyed the running processes and network connections (gone with the reboot), the malware's file (deleted by the scan), the evidence that the logs are authentic (no hashes, no record of who copied what), and the timestamps of every file they touched. None of it was malicious; all of it makes the investigation harder and the evidence weaker if the case ever reaches a court, an insurer or a regulator.
Digital forensics is the discipline of collecting and analysing digital evidence so that the findings are reliable and can be shown to be. This lesson gives its principles and the order in which to collect evidence.
The principles
Different jurisdictions and bodies word them differently (ISO/IEC 27037 for the identification, collection, acquisition and preservation of digital evidence; the UK's ACPO guidelines; NIST SP 800-86 on integrating forensics into incident response), but the core is shared:
- Minimise change. Every action on a live system changes it. Prefer actions that change the least, and work on copies, never on the original evidence.
- Document everything. Who did what, when (in UTC), with which tool and version, and why. If it isn't written down, it didn't happen.
- Preserve integrity. Hash evidence at acquisition, store it read-only, verify the hash before each analysis (chain of custody).
- Be repeatable. Another examiner with the same evidence and tools should reach the same findings.
- Stay within authority. Collect only what the mandate (the incident ticket, a legal order, the employer's policy) covers; personal data needs a lawful basis and care.
- Collect in order of volatility. Capture what disappears fastest first.
Order of volatility (RFC 3227)
RFC 3227 ("Guidelines for Evidence Collection and Archiving", 2002, also BCP 55) lists evidence from most to least volatile. Its example order for a typical system:
| # | Evidence | Lost when |
|---|---|---|
| 1 | registers, cache | instantly |
| 2 | routing table, ARP cache, process table, kernel statistics, memory | the next reboot, or within minutes as things change |
| 3 | temporary file systems | reboot or clean-up |
| 4 | disk | overwritten over days or months (sooner on SSDs with TRIM) |
| 5 | remote logging and monitoring data relevant to the system | log rotation and retention |
| 6 | physical configuration, network topology | changes slowly |
| 7 | archival media | very slowly |
In practice responders rarely capture CPU registers; the actionable rule is: memory and live state first, then disk, then logs held elsewhere (unless retention is about to delete them, which moves them up). RFC 3227 also says to avoid running programs from the suspect system (use trusted tools from read-only media), to avoid actions that change access times of all files, and not to shut the system down before collection: a shutdown can trigger clean-up routines and loses everything in memory.
Planning a collection
The example turns RFC 3227 into a collection plan for a suspected compromised Windows laptop: it sorts the planned artefacts by volatility, flags the ones at risk, and then simulates the collection log a responder keeps, with a UTC time and a SHA-256 for every item. The "collected contents" are short synthetic strings standing in for the real outputs.
import hashlib
from datetime import datetime, timedelta, timezone
plan = [ # (artefact, volatility rank from RFC 3227 (1 = most volatile), minutes to collect, at risk?)
("disk image (C:)", 4, 90, False),
("memory image (16 GB)", 2, 12, True),
("network connections and ARP cache", 2, 1, True),
("running processes with command lines", 2, 1, True),
("proxy and DNS logs for this host (SIEM)", 5, 10, True), # retention deletes them in 2 days
("%TEMP% and browser cache", 3, 5, False),
("event logs (.evtx)", 4, 3, False),
]
order = sorted(plan, key=lambda a: (a[1], -a[3], a[2]))
start = datetime(2026, 1, 15, 9, 40, tzinfo=timezone.utc)
t = start
print("plan (most volatile first):")
for name, rank, minutes, risk in order:
print(f" rank {rank} {name:<42} ~{minutes:>3} min{' AT RISK' if risk else ''}")
print("\ncollection log")
for name, rank, minutes, _ in order:
contents = f"synthetic output of: {name}".encode() # stands in for the collected data
print(f"{t:%H:%M}Z {name:<42} sha256={hashlib.sha256(contents).hexdigest()[:16]}… by responder-1")
t += timedelta(minutes=minutes)
print(f"done at {t:%H:%M}Z, {(t - start).seconds // 60} minutes after start")plan (most volatile first):
rank 2 network connections and ARP cache ~ 1 min AT RISK
rank 2 running processes with command lines ~ 1 min AT RISK
rank 2 memory image (16 GB) ~ 12 min AT RISK
rank 3 %TEMP% and browser cache ~ 5 min
rank 4 event logs (.evtx) ~ 3 min
rank 4 disk image (C:) ~ 90 min
rank 5 proxy and DNS logs for this host (SIEM) ~ 10 min AT RISK
collection log
09:40Z network connections and ARP cache sha256=4fa91e2c3b06f3be… by responder-1
09:41Z running processes with command lines sha256=5c678a3bd3227e89… by responder-1
09:42Z memory image (16 GB) sha256=c2473cda38ee1ad3… by responder-1
09:54Z %TEMP% and browser cache sha256=9e60490b5983e177… by responder-1
09:59Z event logs (.evtx) sha256=905814617b4ac875… by responder-1
10:02Z disk image (C:) sha256=3d7f89dc0685c769… by responder-1
11:32Z proxy and DNS logs for this host (SIEM) sha256=aefcaca306bd6710… by responder-1
done at 11:42Z, 122 minutes after start
Two judgement calls show up. The SIEM logs are rank 5 in RFC 3227's list, but they are "at risk" (retention will delete them), so a second person should export them in parallel rather than wait 2 hours. And the disk image comes last because it is the least volatile, not because it is least important: most findings in most cases come from the disk.
How evidence handling is checked
- Peer review of the collection log: every item has a time, a tool, a person and a hash.
- Hash verification before analysis and before handing evidence over.
- Tool validation: forensic tools are tested on reference data sets (NIST's Computer Forensics Tool Testing programme and its CFReDS reference data) so their output can be trusted.
How to be ready before an incident
- A response kit: trusted collection tools on write-protected media (memory acquisition such as WinPmem or DumpIt for Windows, AVML or LiME for Linux; a triage collector such as KAPE or Velociraptor; a write blocker; large encrypted drives), with instructions.
- Decisions made in advance: who may isolate a host, when to take memory, when to call outside forensic help or law enforcement, how evidence is stored.
- Logging that survives: logs forwarded off the host to a central store, with enough retention (months, not days).
Pitfalls
- Rebooting or shutting down first. Memory, network state and some malware (fileless, or with clean-up on shutdown) are lost.
- Running the AV scan before collection. It deletes or quarantines the evidence.
- Using the suspect system's own tools. A compromised
tasklistor a rootkit can lie; use trusted binaries. - Local time in notes. Mixed time zones wreck timelines; write UTC.
- Pulling the plug vs isolating: disconnecting the network is often right (containment), but decide it consciously; some malware reacts to losing its connection.
Practice
1. Order these by RFC 3227: a disk image, the ARP cache, central firewall logs, a USB stick from the desk, running processes.
ARP cache and running processes (rank 2), disk image (4), firewall logs (5, unless retention is about to delete them), USB stick (archival or physical media: the least volatile, though it may still be the key evidence).
2. Why does RFC 3227 warn against shutting down a system before collecting evidence?
Memory contents, network connections and running processes are lost, and the shutdown itself runs code (including possible clean-up routines of the malware) that changes the disk.
3. Add "clipboard contents" to the plan. What rank and risk would you give it?
Rank 2 (in memory, lost on logoff or the next copy), at risk, about 1 minute. Add ("clipboard contents", 2, 1, True) and rerun.
Test yourself
According to RFC 3227, which should normally be collected first?
- The disk image
- Memory and the process table
- Archival backups
- Network topology diagrams
Why should responders avoid running tools from the suspect system?
- They are too slow
- They may be compromised and lie, and running them changes the system
- They are not licensed
- They need the network
What is the main reason for hashing evidence at acquisition?
- Compression
- To prove later that it has not changed
- To find the malware family
- To encrypt it
Which time zone should a collection log use?
- The responder's local time
- UTC
- The attacker's time zone
- Whatever the system clock shows