Order of Volatility: What to Capture First
The Clock Is Ticking
When you respond to a compromised system, evidence is being destroyed every second. Running processes exit, logs rotate, temporary files are deleted, and memory is overwritten. The order of volatility defines which evidence must be captured first because it disappears fastest.
RFC 3227 defines the order of volatility from most volatile to least volatile:
- CPU registers and cache — nanoseconds to milliseconds
- Routing tables, ARP cache, process table, kernel statistics — seconds to minutes
- Memory (RAM) — minutes to hours (persists until power loss)
- Temporary file systems — hours to days
- Disk (persistent storage) — days to years
- Remote logs and monitoring data — weeks to years
- Physical configuration, network topology — permanent
- Backup media — permanent
The rule: capture the most volatile evidence first. If you image the disk before capturing memory, you lose all running process data, network connections, and encryption keys.
Memory Capture
Memory is the most valuable forensic artifact on a live system. It contains:
- Running processes — including hidden or rootkit processes
- Network connections — active and recent connections, including C2 channels
- Loaded drivers — including malicious drivers
- Encryption keys — for encrypted volumes and TLS sessions
- Credentials — plaintext passwords and hashes in memory
- Injected code — reflective DLL injection, process hollowing
- Command history — recent commands executed by attackers
# Memory capture on Linux using LiME
# Build LiME kernel module against the target kernel headers
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
# Load the module and capture memory
insmod lime.ko "path=/mnt/evidence/memdump.lime format=lime"
# Verify the capture
ls -lh /mnt/evidence/memdump.lime
sha256sum /mnt/evidence/memdump.lime > /mnt/evidence/memdump.lime.sha256
# Memory capture on Windows using WinPmem
winpmem_mini_x64.exe -o C:\evidence\memdump.raw
# Verify hash
certutil -hashfile C:\evidence\memdump.raw SHA256
Memory capture must be performed before any other action on the live system. Do not run antivirus scans, do not reboot, do not install tools on the system — all of these modify memory.
Live System Artifacts
Before powering off the system, collect these volatile artifacts:
# Running processes
ps aux > /mnt/evidence/processes.txt
# Network connections
netstat -tunap > /mnt/evidence/netstat.txt
ss -tunap > /mnt/evidence/ss.txt
# ARP cache
arp -a > /mnt/evidence/arp.txt
# Routing table
ip route > /mnt/evidence/route.txt
# Open files
lsof > /mnt/evidence/lsof.txt
# Mounted filesystems
mount > /mnt/evidence/mount.txt
# System uptime and time
uptime > /mnt/evidence/uptime.txt
date > /mnt/evidence/date.txt
Each command modifies the system slightly (it runs a process), so minimize the number of commands and capture the most critical artifacts first.
Disk Imaging
After volatile evidence is captured, image the disk. A forensic disk image is a bit-for-bit copy of the entire drive, including deleted files, unallocated space, and slack space.
# Disk imaging with dd (Linux)
# Use a write blocker to prevent any writes to the source drive
dd if=/dev/sda of=/mnt/evidence/disk-sda.dd bs=4M conv=noerror,sync status=progress
# Calculate hash for integrity verification
sha256sum /mnt/evidence/disk-sda.dd > /mnt/evidence/disk-sda.dd.sha256
# Disk imaging on Windows using FTK Imager
# Create a forensic image (E01 format) of the physical drive
# FTK Imager > Create Disk Image > Physical Drive > Select source
# Output: E01 format with compression and hashing
The E01 format (Expert Witness Format) is the industry standard for forensic disk images. It includes compression, hashing, and metadata about the imaging process. The raw dd format is simpler but lacks built-in integrity verification.
Write Blockers
A write blocker is a hardware or software device that prevents any writes to the source drive during imaging. This is essential for evidence integrity — if the source drive is modified during imaging, the evidence is no longer a true copy and may be inadmissible in court.
Hardware write blocker: Source Drive → [Write Blocker] → Forensic Workstation
Software write blocker: Linux: blockdev --setro /dev/sda
Windows: diskpart > attributes disk set readonly
Always use a write blocker when imaging a drive that will be used as evidence. The hash verification (SHA-256) proves that the image is identical to the original, but only if the original was not modified during imaging.
Chain of Custody and Evidence Handling
Evidence That Stands Up in Court
Forensic evidence is only valuable if it is admissible in legal proceedings. Admissibility requires proof that the evidence was not tampered with, altered, or contaminated from the moment of collection through presentation in court. The chain of custody is the documentation that proves this.
What Is Chain of Custody?
Chain of custody is a chronological document that tracks every person who handled the evidence, what they did with it, when they did it, and where it was stored. It answers:
- Who collected the evidence?
- When and where was it collected?
- Who has handled the evidence since collection?
- What was done with the evidence (analysis, copying, transport)?
- Where has the evidence been stored?
- How was the evidence protected from tampering?
Any gap in the chain of custody — a period where the evidence was unaccounted for — can be used to challenge its admissibility.
Chain of Custody Form
Chain of Custody Form
Evidence ID: IR-2026-0930-001-E001
Description: Seagate 2TB HDD, Serial: Z4D0A1B2C3
Collected from: WS-042, 10.0.2.15, Finance Department
Collected by: J. Smith, IR Team
Collection date: 2026-09-30 15:30 UTC
Collection method: dd forensic image with hardware write blocker
Image hash (SHA-256): a1b2c3d4e5f6...
Custody Log:
| Date/Time | Handler | Action | Location |
|-----------|---------|--------|----------|
| 2026-09-30 15:30 | J. Smith | Collected and imaged | WS-042 |
| 2026-09-30 16:00 | J. Smith | Transported to IR lab | IR Lab |
| 2026-09-30 16:15 | M. Chen | Received and verified hash | IR Lab |
| 2026-09-30 16:30 | M. Chen | Stored in evidence locker | Locker #12 |
| 2026-10-01 09:00 | M. Chen | Checked out for analysis | IR Lab |
| 2026-10-01 17:00 | M. Chen | Returned to evidence locker | Locker #12 |
Evidence Storage
Evidence must be stored in a physically secure location with access controls:
- Evidence locker — locked cabinet with access logging
- Access control — only authorized personnel can access
- Environmental controls — temperature and humidity controlled to prevent media degradation
- Write protection — evidence media is stored write-protected
Hash Verification
Cryptographic hashes (SHA-256) prove that evidence has not been altered:
# Calculate hash of original evidence
sha256sum /mnt/evidence/disk-sda.dd
# Output: a1b2c3d4e5f6...
# Verify hash at any time — must match the original
sha256sum -c /mnt/evidence/disk-sda.dd.sha256
# Output: /mnt/evidence/disk-sda.dd: OK
The hash is calculated at collection time and verified every time the evidence is accessed. If the hash does not match, the evidence has been altered and is no longer admissible.
Forensic Workstation Hygiene
The forensic workstation used for analysis must be clean and isolated:
- No internet connection — prevents remote access and malware infection
- Write blockers — all evidence drives are mounted read-only
- Forensic tools — only validated, tested tools (FTK, EnCase, Autopsy, Volatility)
- Documentation — every action on the workstation is logged
# Mount evidence image read-only with loop device
mount -o ro,loop /mnt/evidence/disk-sda.dd /mnt/forensic/analysis
# Verify the mount is read-only
mount | grep /mnt/forensic/analysis
# Output: /dev/loop0 on /mnt/forensic/analysis type ext4 (ro,relatime)
Common Chain of Custody Mistakes
- No documentation — collecting evidence without recording who, when, where, and how
- Gaps in custody — evidence left unattended or unaccounted for
- No hash verification — cannot prove the evidence was not altered
- Improper storage — evidence stored in unsecured locations
- Analysis on original evidence — always analyze a forensic copy, never the original
- No write protection — evidence modified during collection or analysis
The chain of custody is not bureaucracy — it is what separates forensic evidence from hearsay. Without it, the most compelling forensic findings are worthless in court.
Key Artifacts: What to Collect and Why
The Artifacts That Tell the Story
Different attack types leave different artifacts. A comprehensive collection covers the categories most relevant to the incident type.
Windows Artifacts
Event Logs
Windows event logs are the primary source of forensic evidence on Windows systems:
- Security.evtx — authentication (4624, 4625), privilege use (4672), process creation (4688), object access
- System.evtx — service installation, driver loading, system crashes
- Application.evtx — application errors and warnings
- PowerShell.evtx — PowerShell script block logging (4104), module logging
- Sysmon — process creation with full command line, network connections, file creation, registry modifications
# Export Windows event logs for analysis
wevtutil epl Security C:\evidence\Security.evtx
wevtutil epl System C:\evidence\System.evtx
wevtutil epl "Windows PowerShell" C\evidence\PowerShell.evtx
Registry Hives
The Windows registry contains evidence of:
- Persistence — Run keys, services, scheduled tasks, WMI subscriptions
- User activity — recent files, typed URLs, USB device history
- Configuration — security settings, installed software, network configuration
# Copy registry hives (from a live system or mounted image)
cp /mnt/forensic/analysis/Windows/System32/config/SYSTEM /mnt/evidence/SYSTEM
cp /mnt/forensic/analysis/Windows/System32/config/SOFTWARE /mnt/evidence/SOFTWARE
cp /mnt/forensic/analysis/Windows/System32/config/SAM /mnt/evidence/SAM
cp /mnt/forensic/analysis/Windows/System32/config/SECURITY /mnt/evidence/SECURITY
Prefetch and Amcache
Prefetch files show which programs were executed and when. Amcache shows program installation and execution history. Both are valuable for determining what ran on the system.
# Prefetch files
C:\Windows\Prefetch\*.pf
# Amcache
C:\Windows\AppCompat\Programs\Amcache.hve
MFT (Master File Table)
The NTFS MFT contains metadata for every file on the volume — creation time, modification time, access time, and file size. The MFT can reveal files that were deleted but not yet overwritten.
Linux Artifacts
Authentication Logs
# Copy authentication logs
cp /mnt/forensic/analysis/var/log/auth.log /mnt/evidence/
cp /mnt/forensic/analysis/var/log/secure /mnt/evidence/
cp /mnt/forensic/analysis/var/log/wtmp /mnt/evidence/ # login history
cp /mnt/forensic/analysis/var/log/btmp /mnt/evidence/ # failed logins
cp /mnt/forensic/analysis/var/log/lastlog /mnt/evidence/ # last login per user
Shell History
# Copy shell history for all users
for user_home in /mnt/forensic/analysis/home/*; do
cp "$user_home/.bash_history" /mnt/evidence/"$(basename $user_home)"_bash_history 2>/dev/null
cp "$user_home/.zsh_history" /mnt/evidence/"$(basename $user_home)"_zsh_history 2>/dev/null
done
cp /mnt/forensic/analysis/root/.bash_history /mnt/evidence/root_bash_history 2>/dev/null
Cron Jobs and Systemd Timers
# Copy cron jobs
cp -r /mnt/forensic/analysis/etc/cron* /mnt/evidence/
for user_home in /mnt/forensic/analysis/home/*; do
cp "$user_home/.crontab" /mnt/evidence/"$(basename $user_home)"_crontab 2>/dev/null
done
# Copy systemd timers
cp -r /mnt/forensic/analysis/etc/systemd /mnt/evidence/systemd
Journal Logs
# Export journald logs
journalctl --directory=/mnt/forensic/analysis/var/log/journal -o short-iso > /mnt/evidence/journald-export.txt
Network Artifacts
Firewall Logs
Firewall logs show allowed and denied connections, VPN sessions, and NAT translations. They reveal which external IPs the compromised system communicated with.
NetFlow/sFlow Data
NetFlow data provides metadata about network conversations — source/destination IP, ports, byte counts, and duration — without capturing full packet content. It is valuable for identifying C2 communication patterns and data exfiltration.
Packet Captures
Full packet captures provide the most detailed network evidence but are storage-intensive. Capture packets only when necessary — for example, when analyzing a specific C2 protocol or data exfiltration.
# Capture packets on a specific interface
tcpdump -i eth0 -w /mnt/evidence/capture.pcap -c 10000
Cloud Artifacts
CloudTrail / Activity Logs
Cloud audit logs show API calls made in the cloud environment — who did what, from where, and when. They are essential for investigating cloud compromises.
VPC Flow Logs
VPC flow logs capture network traffic metadata in cloud environments, equivalent to NetFlow on premises.
Snapshot and Image
Create snapshots of compromised cloud instances before terminating them. A snapshot preserves the entire instance state for forensic analysis.
# Create a snapshot of a compromised EC2 instance
aws ec2 create-snapshot --volume-id vol-1234567890abcdef0 --description "IR-2026-0930-001 forensic snapshot"
Practice Problems
Solution
Collection order following RFC 3227 volatility: (1) Memory capture first — the system is live and memory contains running processes, network connections, encryption keys, and injected code that will be lost on power-off. Use WinPmem or similar tool. (2) Live system artifacts — running processes (pslist), network connections (netstat), ARP cache, routing table, open files (lsof), mounted filesystems. These are volatile and will be lost on reboot. (3) Event logs — export Security.evtx, System.evtx, PowerShell.evtx before they rotate. (4) Registry hives — copy SYSTEM, SOFTWARE, SAM, SECURITY hives. (5) Prefetch, Amcache, and MFT — file execution evidence. (6) Disk image — after all volatile evidence is captured, use a write blocker to create a forensic disk image (E01 or dd). (7) Hash verification — calculate SHA-256 of all collected artifacts. (8) Chain of custody — document everything from the moment of collection. The principle: most volatile first. Memory is the most valuable and most fragile evidence — capture it before anything else. Solution
Chain of custody documentation: (1) Evidence ID — unique identifier (e.g., IR-2026-0930-001-E001). (2) Description — drive model, serial number, capacity. (3) Collection details — who collected, when, where, how (tool used, write blocker used). (4) Hash values — SHA-256 of the original drive and the forensic image, calculated at collection time. (5) Custody log — table tracking every handler, action, location, and timestamp. Steps for admissibility: (1) Use a hardware write blocker during imaging to prevent modification of the original. (2) Calculate and record SHA-256 hashes immediately. (3) Store the original drive in a locked evidence locker with access logging. (4) Perform all analysis on a forensic copy, never the original. (5) Verify hashes every time the evidence is accessed. (6) Document any analysis performed — tools used, actions taken, findings. (7) Maintain the custody log with no gaps — every transfer of the evidence is recorded. (8) Store evidence in a physically secure, access-controlled location with environmental controls. Quiz
1. According to RFC 3227, what is the correct order of evidence collection from most volatile to least volatile?
2. Why is a write blocker essential during forensic disk imaging?
3. What is the chain of custody and why is it important?
4. Why should forensic analysis be performed on a copy of the evidence rather than the original?
5. What is the E01 format and why is it preferred over raw dd images for forensic evidence?
Flashcards
Question
What is the order of volatility (RFC 3227)?
Click to reveal answer
Answer
CPU registers/cache → routing tables/ARP cache/process table → memory (RAM) → temporary file systems → disk → remote logs → physical configuration → backup media. Capture most volatile first.
Question
Why is memory the most important forensic artifact on a live system?
Click to reveal answer
Answer
Contains running processes (including hidden/rootkit), network connections (C2 channels), loaded drivers, encryption keys, credentials, injected code, and command history. All lost on power-off.
Question
What is a write blocker and why is it used?
Click to reveal answer
Answer
A hardware or software device that prevents any writes to the source drive during imaging. Ensures the original evidence is not modified and the image is a true copy. Essential for evidence admissibility.
Question
What is chain of custody?
Click to reveal answer
Answer
A chronological document tracking every person who handled evidence — who, what, when, where. Required for court admissibility. Any gap in custody can be used to challenge evidence.
Question
Why analyze a forensic copy instead of the original evidence?
Click to reveal answer
Answer
Analysis may modify the original (access times, temp files, registry entries). Analyzing a copy preserves the original in its collected state. Hash verification confirms the original is unchanged.
Question
What is the E01 format?
Click to reveal answer
Answer
Expert Witness Format — industry standard for forensic disk images. Includes compression, built-in SHA-256 hashing, and imaging metadata. Preferred over raw dd for legal proceedings.
Revision Notes
Key Takeaways
- 1. Capture most volatile evidence first — memory before disk (RFC 3227)
- 2. Memory contains processes, network connections, encryption keys, and injected code — all lost on power-off
- 3. Write blockers prevent modification of source drive during imaging — essential for admissibility
- 4. Chain of custody documents every handler — any gap challenges court admissibility
- 5. Always analyze a forensic copy, never the original — preserves evidence integrity
- 6. E01 format includes compression, hashing, and metadata — industry standard for forensic images
Interview Tips
- • Walk through the evidence collection order for a live compromised system, explaining why each step comes first
- • Explain what memory contains and why it is the most valuable forensic artifact
- • Describe the chain of custody process and why gaps are dangerous
- • Discuss write blockers — hardware vs software and why they are essential
- • Explain why analysis is performed on a copy rather than the original
- • Mention key Windows and Linux artifacts and what evidence each provides
Cheat Sheet
Forensic Artifact Collection Cheat Sheet
Phase: Detection Engineering and Incident Response | Level: advanced
Order of volatility (RFC 3227):
CPU cache → ARP/process table → memory → temp files → disk → remote logs → config → backups
Capture most volatile first.
Memory capture:
- Linux: LiME kernel module → lime.ko "path=/mnt/evidence/memdump.lime format=lime"
- Windows: WinPmem → winpmem_mini_x64.exe -o memdump.raw
- Contains: processes, network connections, encryption keys, credentials, injected code
Disk imaging:
- Use hardware write blocker
- Linux: dd if=/dev/sda of=/mnt/evidence/disk.dd bs=4M conv=noerror,sync
- Windows: FTK Imager → E01 format
- Verify: sha256sum
Chain of custody:
- Evidence ID, description, collection details (who/when/where/how)
- Hash values (SHA-256) at collection time
- Custody log: every handler, action, location, timestamp
- No gaps — any gap challenges admissibility
Evidence storage:
- Locked evidence locker with access logging
- Environmental controls (temperature, humidity)
- Write-protected storage
Key artifacts:
- Windows: Event logs (Security, System, PowerShell), registry hives, Prefetch, Amcache, MFT
- Linux: auth.log, shell history, cron jobs, systemd timers, journald
- Network: firewall logs, NetFlow, packet captures
- Cloud: CloudTrail, VPC flow logs, instance snapshots
Common mistakes:
- No documentation of collection
- Gaps in custody
- No hash verification
- Analysis on original evidence (always use a copy)
- No write protection
Tags: forensics, incident-response
Continue Learning
Before You Start
- No prerequisites listed.