Digital Forensics Fundamentals: Evidence, Imaging and Analysis

Digital forensics is the discipline of identifying, preserving, analysing and presenting digital evidence in a way that is accurate, repeatable and, where needed, admissible in court. It supports incident response (what did the attacker do?), internal investigations (policy violations, fraud) and legal cases. This lesson teaches the core principles, the evidence habits that matter most and hands-on exercises on your own lab machines and sample disk images, with no real victims involved.

Core Principles

  1. Preserve first. Do not change the original evidence. Work on forensic copies.
  2. Document everything. Who, what, when, where, how and why, for every action.
  3. Maintain chain of custody. A record of everyone who handled the evidence, with dates and reasons.
  4. Verify integrity with hashes. Compute a cryptographic hash (SHA-256) of evidence at acquisition and re-check it later.
  5. Be repeatable. Another examiner using the same method should reach the same result.
  6. Stay objective and within authority. Examine only what you are legally permitted to, and report facts rather than assumptions.

Types of Forensics

AreaEvidence examples
Disk (computer) forensicsFile systems, deleted files, browser history, documents, registry, logs
Memory forensicsRunning processes, network connections, injected code, encryption keys in RAM
Network forensicsPacket captures, flow records, firewall and proxy logs
Mobile forensicsMessages, call logs, application data, location history
Cloud and SaaS forensicsAudit logs, access records, snapshots, API history
Email and document forensicsHeaders, metadata, authorship, timestamps
Malware analysisBehaviour, indicators of compromise; see Malware Types and Analysis Basics

The Forensic Process

  1. Identification: decide what may hold evidence and the legal basis for collecting it.
  2. Preservation and collection: secure devices, collect data in the right order, create forensic images.
  3. Examination: extract and filter relevant data.
  4. Analysis: build a timeline, correlate artefacts and test hypotheses.
  5. Reporting: document findings, methods, limitations and conclusions clearly.
  6. Presentation and retention: explain results to non-experts and store evidence securely.

Order of volatility

Collect the most fleeting data first, because it disappears quickest:

OrderEvidence
1CPU registers and cache (rarely collected in practice)
2Memory (RAM), running processes, network connections
3Temporary files and swap space
4Disk contents
5Remote logging and monitoring data
6Physical configuration, network topology
7Archival media and backups

Evidence Handling: Practical Habits

  • Photograph the scene and the screen before touching anything.
  • Label every item with a unique ID, date, time and handler.
  • Use a write blocker (hardware or software) when connecting storage so that the operating system cannot alter it.
  • Create a bit-for-bit image, hash the original and the image, and work from the image.
  • Store evidence in tamper-evident bags or encrypted containers, in a restricted location.
  • Record every transfer on a chain-of-custody form.

Sample chain-of-custody record

Item IDDescriptionDate and timeFromToReasonSHA-256 (first 16)
E-001Laptop, 512 GB SSD, serial XXXXXXXX2026-10-19 10:15 ISTR. Mehta (owner)A. Kapoor (examiner)Seizure for analysisn/a (device)
E-001-IMGForensic image of E-0012026-10-19 12:40 ISTA. KapoorEvidence safeStorage3f5a9c0d11b7e2a4…

The names and values above are fictional, for training.

Practice Lab 1: Create and Verify an Image (Lab VM)

Create a small test disk image so you never touch real evidence.

# Make a 50 MB file and format it as a test file system
dd if=/dev/zero of=case1.img bs=1M count=50
mkfs.ext4 -q case1.img
mkdir -p mnt1 && sudo mount -o loop case1.img mnt1

# Put some sample files in it
echo "Quarterly budget draft" | sudo tee mnt1/budget.txt
echo "Meeting notes: project Falcon" | sudo tee mnt1/notes.txt
sudo umount mnt1

# Hash the image, then make a working copy and verify it matches
sha256sum case1.img | tee case1.sha256
cp case1.img case1_work.img
sha256sum case1_work.img          # must match the original hash

Explain in your notes why the hash matching proves the copy is identical, and what would happen to the hash if a single bit changed.

Practice Lab 2: Examine the Image and Recover a Deleted File

Install The Sleuth Kit (sudo apt install sleuthkit) and optionally the Autopsy graphical front end.

# Remove a file inside the image, then look for it
sudo mount -o loop case1_work.img mnt1
sudo rm mnt1/notes.txt
sudo umount mnt1

fls -r case1_work.img              # list files, deleted ones are marked with *
# Note the inode number of the deleted file, for example 13
icat case1_work.img 13             # print the file's contents by inode

Observe that “deleted” usually means the file system entry was marked free, and data may remain until overwritten. Write a short note on why this matters to privacy and to secure disposal (see Personal Cyber Hygiene Guide).

Practice Lab 3: Build a Timeline

  1. On your Linux lab VM, perform a series of actions: create files, edit one, delete one, log in via SSH from the analyst VM.
  2. Collect evidence: file modification times (ls -l --time-style=full-iso), authentication logs and shell history.
  3. Combine them into a table sorted by time with columns for time, source, event and significance.
  4. Check your timeline against what you actually did. Where are the gaps or time-zone inconsistencies?
find /home/analyst -type f -printf '%TY-%Tm-%Td %TH:%TM:%TS %p\n' | sort | tail -20

Practice Lab 4: Memory Forensics Basics

  1. Download a publicly available sample memory image from a training resource (for example, the datasets offered with educational forensic courses), or capture memory from your own lab VM using a tool such as LiME on Linux or WinPmem on Windows.
  2. Install the Volatility 3 framework and run its process-listing plugins (for example windows.pslist or linux.pslist) against the image.
  3. Compare the process list with the expected normal processes for that operating system. Note any unusual names, parents or paths.
  4. Write a paragraph: what questions can memory answer that disk cannot?

Practice Lab 5: Email and File Metadata

  1. Open the raw headers of an email you received in your own mailbox. Trace the Received lines from bottom to top and note each hop.
  2. Check SPF, DKIM and DMARC results in the headers.
  3. Run exiftool on a photo you took and on a document you created. List the metadata revealed (device model, software, author, timestamps, sometimes location).
  4. Decide what you would remove before publishing these files; see Reconnaissance and OSINT.

Legal and Ethical Considerations

  • Obtain authority before collecting: ownership, consent, warrant or policy-based authorisation.
  • Respect privacy and data protection laws; in India, consider the Information Technology Act, 2000, the Digital Personal Data Protection Act, 2023 and rules of evidence, including Section 65B of the Indian Evidence Act (now reflected in the Bharatiya Sakshya Adhiniyam, 2023) on electronic records and certificates.
  • Separate roles: the person who collects evidence should not tamper with, or influence, analysis outcomes.
  • State limitations and uncertainty honestly in your report.
  • Keep client or employee data confidential and handle it only as needed.

Common Mistakes

  • Powering off or browsing a suspect machine and altering timestamps.
  • Working on the original rather than a verified copy.
  • Missing documentation, which weakens the evidence even if the analysis is right.
  • Time-zone confusion in timelines.
  • Reporting conclusions the evidence does not support.

Practice Exercises

  1. Explain chain of custody and why gaps damage evidence.
  2. Put these in order of volatility: disk image, running processes, backup tapes, network connections.
  3. Why is a hash used when imaging a drive? What does it prove?
  4. List five artefacts on a Windows computer that show recent user activity.
  5. Draft the outline of a forensic report for an HR investigation into data copied to a USB drive.

Mentor tip: Treat every investigation as though you will have to defend it in front of a sceptical stranger. If your notes would convince them, your work is probably sound.

Educational use only: collect and examine evidence only with proper legal authority, and practise on your own systems or published training datasets.

Key takeaways
  • Preserve evidence, verify it with hashes, and work on copies.
  • Document everything and maintain chain of custody.
  • Collect volatile data first, following the order of volatility.
  • Build timelines from multiple sources and state limitations honestly.
  • Always act within legal authority and respect privacy.

Related Lessons