Digital Forensics

How digital evidence is identified, acquired, preserved and analysed, covering order of volatility, chain of custody, imaging, key artefacts, timelines and common tools.

Digital forensics is the process of collecting, preserving and analysing digital evidence in a way that is repeatable and defensible. It answers questions after or during an incident: what happened, how, when, who, and what was affected. It supports incident response and, where needed, legal cases (see Investigation Types).


Types

TypeEvidence
Disk / file systemHard drives, SSDs, USB media, deleted files, file system metadata
MemoryRAM contents: running processes, network connections, keys, injected code
NetworkPacket captures, flow data, firewall and proxy logs
LogSystem, application and security logs
MobilePhones and tablets: messages, app data, location
CloudProvider audit logs, snapshots of virtual machines, SaaS records (limited physical access)

Methodology

text
Identify --> Preserve --> Collect --> Examine --> Analyse --> Report

Always get proper authorisation first; examining data without it can be illegal. Work on copies, never on original evidence, and document every action.

Order of volatility

Collect the most short-lived data first (RFC 3227 style):

  1. CPU registers and cache
  2. RAM, running processes, network connections, ARP/routing tables
  3. Temporary files and swap
  4. Disk contents
  5. Remote logs and monitoring data
  6. Backups and archives

Live vs dead acquisition

LiveDead
System stateRunningPowered off
GetsMemory, connections, encrypted volumes unlockedClean disk image
RiskTool footprint alters the systemLoses volatile data; full-disk encryption may lock you out

Common compromise: capture memory live, then image the disk.


Preservation and Integrity

Chain of custody

A record of who held the evidence, when, where, and why - from collection to court. A broken chain can make evidence inadmissible. Record: item description, serial numbers, date/time, person, transfers, storage location, and hash values. Store evidence in sealed, access-controlled storage.

Imaging and write blockers

A forensic image is a bit-for-bit copy of the media, including unallocated space. A write blocker (hardware, or software mode) sits between the evidence drive and your workstation so nothing can be written to the original.

Hashing

Hash the original and the image (for example SHA-256); matching values prove the copy is exact, and re-hashing later shows nothing changed. Concepts are in Hashing Basics; avoid MD5/SHA-1 alone where collisions matter, or compute two hashes.


Key Artefacts

Windows

ArtefactReveals
Registry (NTUSER.DAT, SYSTEM, SOFTWARE, SAM)Installed software, USB history, recently run programs, autoruns, user activity
Event logs (.evtx)Logons, process creation, service installs, log clearing
PrefetchEvidence that programs executed, run counts, last run times
Browser historyVisited sites, downloads, searches
$MFT (Master File Table)File names, timestamps, sizes, including deleted entries
Recycle Bin, LNK files, jump listsDeleted and recently accessed files

Linux

ArtefactReveals
/var/log/auth.log or secure, syslogLogins, sudo use, services
~/.bash_historyCommands typed by a user (can be cleared or disabled)
Cron jobs, systemd units, ~/.ssh/authorized_keysPersistence
/tmp, /var/tmp, web rootsDropped files, web shells

Timeline analysis

Merge timestamps from file systems, logs, registry and browsers into one ordered timeline to reconstruct the attack sequence. Normalise time zones (use UTC) and note clock skew; compare MACB timestamps (modified, accessed, changed, born). See time-sync notes in SIEM and Log Management.


Tools

ToolUse
FTK ImagerCreate and verify disk images, preview evidence, capture memory
Autopsy / Sleuth KitOpen-source disk analysis, file recovery, timelines
VolatilityMemory forensics: process lists, network connections, injected code
WiresharkPacket analysis, see Wireshark
Registry viewers, event log toolsOffline analysis of registry hives and .evtx
Log/SIEM platformsLarge-scale log analysis, see SIEM and Log Management

Documentation and Admissibility

Evidence is more likely to be accepted when it was lawfully obtained, the process is documented and repeatable, integrity is shown by hashes, custody is unbroken, and the examiner is qualified. Keep contemporaneous notes, record tool names and versions, and keep originals untouched. Rules differ by jurisdiction; involve legal counsel. Privacy and data-handling laws also apply (see GDPR).


Anti-Forensics Awareness

Attackers may try to hinder analysis, so analysts should expect:

  • Clearing or disabling logs and shell history
  • Timestamp manipulation (timestomping)
  • File wiping, encryption and data hiding (steganography, hidden partitions)
  • In-memory-only malware that never touches disk
  • Use of legitimate tools to blend in

Mitigations: forward logs off-host, capture memory early, corroborate across independent sources (an altered file timestamp may contradict MFT or log entries).


Key Points

  • Preserve first: authorise, image with a write blocker, hash, document.
  • Collect volatile data before non-volatile.
  • Chain of custody and integrity hashes make evidence defensible.
  • Correlate artefacts into a UTC timeline.

Hands-on