UnixDroid

Lesson 2 of 8 · 7 min

The forensic process & order of volatility

The four phases every investigation follows, and why you always grab RAM before the hard disk.

Forensics isn't random poking around a hard drive. Every serious investigation follows the same process, so the results can be trusted by your manager, a client or a court.

The four phases

NIST's guide SP 800-86 breaks forensic work into four phases:

1. Collection. Identify where evidence might be (laptop, server, phone, cloud logs) and acquire it without changing it.

2. Examination. Process the raw data: recover deleted files, parse logs, extract artifacts.

3. Analysis. Connect the dots. Who did what, when and how?

4. Reporting. Explain the findings clearly, with proof, so someone else can check them.

The golden rule across all four: work on copies, never on the original.

Order of volatility

Some evidence disappears the moment a machine is switched off, so you collect the most fragile data first. This is called the order of volatility (from RFC 3227):

Collect first to lastExampleHow long it survives
CPU registers and cache—Nanoseconds
RAM, running processes, network connectionsMalware living only in memoryUntil shutdown
Temporary files and swap/tmp, pagefileUntil reboot or cleanup
DiskFiles, logs, registryMonths to years
Remote logs and backupsSIEM, cloud logsDepends on retention

Tip: Pulling the plug on a running machine destroys RAM, along with any fileless malware, open connections and encryption keys. If the system is still on, capture memory first.

Live response: what to grab from a running system

Before a Linux system is shut down, an investigator typically records:

date -u              # current time in UTC
w                    # who is logged in right now
ps auxf              # running processes as a tree
sudo ss -tunap       # network connections and listening ports
ip a                 # network interfaces and IPs
sudo lsof -nP | head -50   # files opened by processes

On Windows, the rough equivalents are tasklist /v, netstat -ano, query user and ipconfig /all.

Save every output to an external USB drive or a network share, not to the suspect disk.

Golden rules

  • Write down everything you do, with the time in UTC.
  • Touch the evidence as little as possible.
  • Run trusted tools from your own USB, not the suspect machine's programs. An attacker may have replaced them.
  • If you're not sure, stop and ask. A mistake during collection can't be undone.

Good forensics is less about clever tools and more about discipline: the right order, the right copy and a written record of every step.

Try it yourself
  1. On your Kali VM, create a folder: mkdir ~/live-response
  2. Run date -u > ~/live-response/start.txt to record when you started.
  3. Run each live-response command from this lesson and save its output, for example sudo ss -tunap > ~/live-response/connections.txt
  4. Open connections.txt and list every process that is listening on a port. Is anything there you didn't expect?
No Linux machine? Practise in the free online terminal

Quick check

Which should you collect first from a running machine: the hard disk or RAM?

Need a hint?

The most volatile evidence goes first.

Finished this lesson?

Done lessons keep your daily streak going 🔥

0 day streak

0 lessons done

best 0 days

Log in to keep your streak on every device →