🎉 75% of content is free forever — Unlock Premium from $10/mo →
CW
NEWSLIVESearch All Content
💼 Servicesℹ️ About✉️ ContactView Pricing Plansfrom $10

Digital Forensics: Evidence, Imaging and Analysis

Forensics🟢 Free Lesson

Digital Forensics

Digital forensics is the disciplined recovery and interpretation of evidence from electronic systems, under rules that assume the result will be challenged in court. The discipline's hard-won insight is that how you collected determines whether what you found is admissible: a brilliant analysis built on an undocumented copy of a disk proves nothing about the original machine. This lesson covers the procedures first and the tooling second, because procedure is what separates an investigation from browsing.

The process and why its order is fixed

Standard models — identification, preservation, collection, examination, analysis, reporting — exist because evidence degrades and because hasty actions destroy what they were meant to reveal. Identification scopes what exists and where. Preservation stops change: isolate the system, or at minimum snapshot it. Collection takes a defensible copy. Examination extracts artifacts without altering the copy. Analysis interprets them in context. Reporting states findings with the confidence the evidence supports.

The order is not bureaucratic. Every step is chosen to minimize changes to the original evidence, and steps taken out of sequence routinely destroy the most valuable data — powering off a machine to "keep it safe" discards memory contents that cannot be recovered from the disk.

Order of volatility: collect the perishable first

Volatile evidence disappears first, so it is collected first. Memory holds decrypted keys, injected code, running implants, network connections and command histories that never touch disk. Network state shows active connections and open ports. Login sessions reveal who is present right now. Only then come disk contents, then backups and archived logs, which persist for weeks or months.

Evidence typeVolatilityExamplesCollection priority
CPU registers, cacheExtremeKeys in memory, in-flight dataCapture with RAM dump if possible
RAMHighProcesses, implants, injected codeBefore shutdown, always
Network stateHighEstablished connections, ARP tableSnapshot before isolation
Running tablesMedium-highScheduled tasks, loaded driversRecord while host is live
DiskLowFiles, registry, event logsImage after volatile capture
Remote logs, backupsLowestCentral syslog, cloud trailsPreserve early; attacker may delete local
# Live capture sequence for a suspect Linux host, in the right order
# 1) Volatile: connections, processes, open files, logged-in users
ss -tunap | tee /evidence/live/ss.txt
ps auxwf | tee /evidence/live/ps.txt
lsof -n | tee /evidence/live/lsof.txt
who -a | tee /evidence/live/who.txt
cat /proc/*/cmdline 2>/dev/null | tr '\0' ' ' | tee /evidence/live/cmdlines.txt

# 2) Memory image before any reboot (LiME-style acquisition on Linux)
sudo insmod lime.ko "path=/evidence/live/memory.lime format=lime"

# 3) Integrity: hash every artifact at the moment of collection
sha256sum /evidence/live/* | tee /evidence/live/HASHES.txt

# 4) Preserve logs before an attacker can rotate or wipe them
cp -a /var/log /evidence/logs
journalctl --since "30 days ago" --no-pager | gzip > /evidence/logs/journal.gz

Each capture step records who ran it and when, and hashes are computed immediately rather than at the end of a long day — hash-at-collection is what proves later that nothing changed in between.

Disk imaging and verification

A forensic image is a bit-for-bit copy of storage, taken through a write blocker or an equivalent software process that guarantees the source is not modified by the act of copying. The image, not the original, is what analysts work on; the original is sealed and stored. Common formats include raw dd images, E01 with embedded compression and per-block hashes, and AFF4.

# Image a physical disk and verify the copy immediately
sudo dc3md /dev/sda /evidence/case204-disk.E01

# Raw alternative when tooling is limited: stream, hash and compress in one pass
sudo dd if=/dev/sda bs=4M status=progress conv=noerror,sync | tee >(sha256sum > /evidence/sda.sha256) | zstd -T0 > /evidence/sda.img.zst

# Mount the image read-only; never work on the original
mkdir -p /mnt/evidence
sudo mount -o ro,loop,offset=204800 /evidence/case204-disk.E01 /mnt/evidence

# File recovery and carved artifacts from the working copy
fls -r -d /evidence/case204-disk.E01 | head -30
mactime -b /evidence/bodyfile.txt -d | head -30

# Verify the image still hashes the same after every transfer of custody
sha256sum -c /evidence/case204-disk.sha256

Verification is the step that survives cross-examination: if the image hash at collection matches the hash at analysis, opposing counsel has no evidence-handling argument to make.

Memory forensics: where modern intrusions live

With fileless techniques and in-memory implants, RAM analysis often carries more investigative weight than the disk. A memory image exposes process hollowing, reflective DLL injection, credentials in clear text, injected threads pointing into heap allocations, and the command history of tools that never wrote a file.

python
# Using the volatility 3 framework to triage a memory image
from volatility3.framework import contexts, automappers
from volatility3.framework.automagic import linux, windows
import volatility3.plugins.windows.pslist as pslist
import volatility3.plugins.windows.netscan as netscan

# Renderers are resolved by the framework; the pattern below is the standard CLI flow:
# vol -f memory.lime windows.pslist --dump
# vol -f memory.lime windows.netscan
# vol -f memory.lime windows.malfind
# vol -f memory.lime windows.cmdline
# vol -f memory.lime windows.handles --pid 1234

def triage_suspicious_processes(pslist_rows):
    """Flag processes whose parent is missing or whose image path is unusual."""
    pids = {row[0] for row in pslist_rows}
    findings = []
    for pid, ppid, name, path, started in pslist_rows:
        if ppid not in pids and ppid != 0:
            findings.append((pid, name, "parent process not present (hidden or exited)"))
        if path and ("\\temp\\" in path.lower() or "\\appdata\\local\\temp" in path.lower()):
            findings.append((pid, name, f"executable running from temp: {path}"))
    return findings


rows = [
    (4, 0, "System", "System", "08:00"),
    (880, 4, "svchost.exe", "C:\\Windows\\System32\\svchost.exe", "08:01"),
    (4412, 9999, "invoice.pdf.exe", "C:\\Users\\Public\\invoice.pdf.exe", "03:14"),
]
for finding in triage_suspicious_processes(rows):
    print(finding)

Paired with disk artifacts — prefetch files, amcache entries, registry hives, browser history — memory findings build the timeline that establishes what ran, when, under which account and with what network destination.

Timeline and artifact analysis

Timelines turn scattered artifacts into a narrative. A super-timeline merges filesystem timestamps, registry key activity, event logs, browser artifacts and shellbags, then orders them so sequences become visible: a document opened, macros enabled, a script dropped, a remote connection made, logs cleared.

# Build a super-timeline from a disk image with the sleuth kit and plaso
fls -r -m / -o 204800 /evidence/case204-disk.E01 > /evidence/bodyfile.txt
log2timeline.py --storage-file /evidence/case204.plaso /evidence/bodyfile.txt
psort.py -o dynamic -w /evidence/timeline.csv --filter "date_final > '2026-03-01'" /evidence/case204.plaso

# Registry artifacts that survive file deletion
regipy-cli hives --hive-path /evidence/registry/SYSTEM --output /evidence/system.json
# Key questions: Run keys for persistence, Shimcache for executed programs,
# USBSTOR for devices attached, and SAM for account creation times.

Two interpretation habits matter. First, remember timestamp semantics: many filesystems store creation, modification, access and change times, tools rewrite access times, and clock skew between machines distorts sequences. Second, corroborate: a single artifact is a clue, two independent artifacts are a finding, and a timeline with three corroborating sources is a conclusion you can defend.

Chain of custody and legal boundaries

Chain of custody documents the life of each evidence item from collection to presentation: unique identifier, source system, collector, date and time, collection method, hash, storage location and every transfer with signatures. Gaps give opposing experts room to argue contamination.

Architecture Diagram
Evidence item record — INC-2026-024 item 007
  Description:      laptop drive, 512GB NVMe, serial SN-88421
  Source:           desk of J. Doe, floor 3, seized 2026-03-14 11:20 UTC
  Collected by:     M. Okafor (examiner, cert GCFE)
  Method:           write-blocked hardware imager; E01; 4GB segments
  Original hash:    sha256 3b91...7fc2  recorded 11:58 UTC
  Working copy:     hash verified identical 12:10 UTC before analysis
  Transfers:        11:58 Okafor -> safe 04; 14:30 safe 04 -> lab rack 2
  Storage:          tamper-evident bag, access-logged evidence room
  Legal status:     under counsel hold, retain until matter closed

Legal boundaries run alongside the technical work. Collection needs authority — a warrant, a consent form, or corporate policy that employees have been told about; private searches still have to respect privacy law and works agreements. Seize what the scope covers, not what is merely interesting. Data about third parties encountered along the way is still regulated data. And remember that your report may be read by judges, juries and journalists, so conclusions must state confidence honestly and avoid speculation the evidence does not support.

When the evidence is not on a disk you can seize

Cloud, container and remote-work environments break the classic model of walking to a rack with a write blocker. Evidence may live in provider object storage and object-versioning histories, in ephemeral container filesystems that vanish on rescheduling, or on a laptop in an employee's home that you must image remotely. The principles survive; the collection method changes.

For cloud systems, prefer provider-native evidence paths: snapshot APIs, instance-termination protection so the system stays available for collection, audit trails that record who accessed what, and object-lock or retention settings that prevent deletion while you collect. For containers, capture the image digest, the runtime filesystem layer, orchestrator events and logs before the pod is recreated, and remember that the node's kernel and logs are evidence too. For remote laptops, ship a sealed hardware write-blocker or use an approved remote-collection tool that produces a hashed image, and record who was present during collection — the examiner's observation of the collection environment may itself need to be defensible.

Each of these contexts adds custodians you do not control, so chain-of-custody records must include the provider's role, the account or subscription identity used, and any provider-side assurances such as integrity checksums or access logs. Assume opposing counsel will ask who else could have touched the data; your documentation should answer before they ask.

Choosing tools and building a lab

Common tools by function: write blockers and imagers for acquisition; the Sleuth Kit, Autopsy and FTK for disk work; Volatility for memory; plaso for timelines; KAPE or forensic connectors for rapid endpoint collection; Wireshark for captured traffic. Most labs run on isolated analysis workstations with no route to production networks, encrypted evidence storage with capacity planning, and versioned tooling so results are reproducible.

Reproducibility is the quiet goal of the whole discipline: given the same image and the same documented steps, another examiner should reach the same findings. When they cannot, either the procedure or the report is incomplete — and that is exactly what an opposing expert will test.

Common Mistakes

Shutting down a suspect machine to preserve it

Fix: Capture volatile memory first and isolate at the network layer; power-off discards the most valuable evidence.

Analyzing the original disk instead of a verified image

Fix: Image with a write blocker, hash at collection, and work only on the verified copy.

Recording chain of custody notes after the fact

Fix: Log each collection and transfer at the time it happens, with hashes and signatures.

Drawing conclusions from a single timestamp

Fix: Corroborate with at least one independent artifact and account for clock skew and timestamp semantics.

Collecting everything that looks interesting

Fix: Stay within authorized scope; over-collection creates privacy liability without improving the case.

Best Practices

  • Maintain a written evidence-handling procedure and rehearse it before an incident.
  • Use a standard collection order: volatile state, memory, network state, then disk.
  • Hash every artifact at collection and re-verify after each transfer.
  • Build timelines early; they organize interviews, scope and reporting.
  • Document tool versions and commands so another examiner can reproduce the work.

Key Takeaways

  • Procedure establishes admissibility; brilliant analysis on undocumented evidence proves nothing.
  • Order of volatility dictates collection order — memory first, disk last, and never power off before imaging.
  • Analysts work on hashed, verified copies; originals are sealed and stored.
  • Memory forensics catches fileless techniques that leave little or nothing on disk.
  • Corroborated timelines turn artifacts into defensible narrative.
  • Chain of custody and lawful scope protect both the case and the examiner.
CW

ChatWhole Learn Editorial Team

Written by experienced data scientists, software engineers, and educators. All content is reviewed by industry professionals to ensure accuracy and relevance.

Last reviewed: 2026-10-12

—
☆☆☆☆☆
0 ratings

Rate & Feedback

Need Expert Cybersecurity Help?

Get personalized tutoring, project support, or professional consulting.

Advertisement