Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 36 ยท Memory Forensics

Memory Forensics Fundamentals

Learn what memory forensics is, what lives in RAM (processes, connections, keys), how memory is acquired and verified, memory image formats and the workflow of a tool like Volatility 3.

A computer's disk records what was saved. Its RAM records what is happening right now: running programs, open network connections, decrypted data, typed commands and sometimes passwords or encryption keys. Memory forensics analyses a copy of RAM (a memory dump or memory image) to recover that live state. It is essential for incident response, because malware that never touches the disk, or hides from normal tools, still has to live in memory to run.

What lives in memory

  • Processes and threads, their command lines, loaded libraries (DLLs, shared objects) and environment variables.
  • Network state: open sockets, listening ports, connections with remote addresses.
  • Kernel objects: loaded drivers, handles, services, registry hives cached in memory.
  • Decrypted content: documents being edited, web pages, chat messages, clipboard text.
  • Credentials and keys: hashes, tickets, disk-encryption keys while a volume is unlocked.
  • Remnants of terminated processes and old network buffers, until the memory pages are reused.

Memory is organised in pages (typically 4 KiB). The operating system gives each process its own virtual address space and maps pages to physical memory through page tables. A memory image contains physical memory; tools translate virtual addresses to physical ones to find a process's view of its data.

Why capture RAM at all?

As the order of volatility says, RAM disappears on shutdown. Reasons to capture it:

  1. See what was running, including hidden or injected code.
  2. Get encryption keys or passwords that exist only in memory.
  3. Reconstruct network activity that was never logged.
  4. Find fileless malware or scripts that ran only in memory.
  5. Detect anti-forensic manipulation of the operating system, because memory shows the system's true state.

Acquisition

Acquisition runs a small tool on the live system and writes RAM to external storage. Principles:

  • Run from external media (a USB drive with trusted tools), not from the suspect disk, and write the image to the external drive. Every action changes memory a little, so you keep your footprint small and record what you did and when.
  • Capture before shutdown and before any cleanup.
  • Hash the image immediately; see hashing. Unlike a disk, a live memory capture changes while it runs (a "smear"), so two captures never match; the hash proves the image is unchanged after acquisition.
  • Record the context: system time, time zone, who was logged in, tool and version, and the order of actions.

Common acquisition tools (listed for orientation, outputs here are samples): WinPmem, Belkasoft Live RAM Capturer, Magnet RAM Capture, DumpIt on Windows; AVML and LiME on Linux; OSXPmem on macOS. Virtual machines are easier: suspend the VM and copy the .vmem file, or take a snapshot.

Other memory sources: the hibernation file hiberfil.sys, the page file pagefile.sys and swap, and crash dumps (MEMORY.DMP). They give partial memory when a live capture is impossible.

flowchart TD
    A["Live system<br/>(in scope, authorised)"] --> B["Run trusted tool<br/>from external media"]
    B --> C["Write memory image<br/>to external storage"]
    C --> D["Hash + log in custody record"]
    D --> E["Analyse a COPY<br/>with Volatility 3 or similar"]
    A --> F["Then collect disk image,<br/>logs, network state"]

Memory image formats

Format Notes
Raw (.raw, .mem, .bin) Exact physical memory, simplest
Crash dump (.dmp) Windows format with headers
LiME (.lime) Linux, adds range headers
VMware (.vmem + .vmss/.vmsn) Virtual machine memory plus metadata
Hibernation (hiberfil.sys) Compressed, convertible

Analysis frameworks need to know the operating system version and layout to interpret structures. Volatility 3 uses symbol tables (ISF files) matched to the exact kernel build; Volatility 2 used profiles. If the symbols do not match, plugins print nothing useful, which is why "which OS build was this?" is the first question.

The analysis workflow

  1. Identify the image: OS, version, architecture, image time.
  2. List processes (and compare lists to find hidden ones, see next lesson).
  3. Examine network connections and listening ports.
  4. Check loaded modules, drivers and services.
  5. Look for anomalies: injected code, suspicious parents, odd paths (injection indicators).
  6. Search memory for strings, URLs, keys and commands (strings).
  7. Extract processes, files and DLLs for further analysis in a lab.
  8. Correlate with disk, log and network evidence.

Sample Volatility 3 commands (read-only; shortened example output, not produced here):

TEXT
$ vol -f mem.raw windows.info
Kernel Base   0xf8000c800000
Is64Bit       True
NtMajorVersion 10
SystemTime    2025-04-02 21:30:11

$ vol -f mem.raw windows.pslist
PID  PPID ImageFileName  CreateTime
4    0    System          2025-04-02 08:00:03
612  4    smss.exe        2025-04-02 08:00:03

A page-based model of memory

To build intuition for how an image is read, the stand-in below pretends memory is a list of 16-byte "pages" and translates a virtual address to the physical one through a tiny page table.

Python Translate a virtual address to physical memory

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Real analysers do the same with multi-level page tables, which is why they need the exact kernel layout.

What a memory image cannot tell you

  • When things happened before the capture, beyond timestamps stored in structures.
  • Anything already overwritten or paged out (page files may hold some).
  • A clean image proves little: a process can have run and exited with no remains.
  • The capture itself alters memory slightly, so document your steps.

A small stand-in shows how an analyst counts what is present in an image, by scanning it for readable runs of text. It is the first step toward the string searches of a later lesson.

Python Estimate how much of an image is non-empty

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is memory forensics valuable for fileless malware?

    Code that never touches the disk can still be found in RAM while it runs.
  2. 2. Why can't two live memory captures of the same system have identical hashes?

    RAM changes during acquisition, so the hash only proves the image is unchanged after capture.
  3. 3. What does Volatility 3 need to interpret a Windows image correctly?

    Symbols describe kernel structures; without a match plugins cannot parse the data.
  4. 4. Where should the memory image be written?

    Writing to the suspect disk could overwrite deleted data; use external media.

Summary

  • RAM holds processes, connections, decrypted data and keys that never reach the disk.
  • Capture memory first, from external media, hash it and log everything you did.
  • Hibernation, page and crash files are partial alternatives.
  • Analysis needs matching symbols or profiles, then follows a fixed workflow: identify, processes, network, modules, anomalies, search, extract, correlate.
  • A memory image shows a moment in time and is changed slightly by the act of capturing it.

Next: Process listing and hidden processes