Week 7: Memory Forensics

Week-7: Memory Forensics

Ali Jaddoa

Ali.Jaddoa@Roehampton.ac.uk


25/26
Week 7: Memory Forensics

Today's

  • Fundamentals of memory and random-access memory
  • Role of RAM in cyber security
  • Different sources of memory
  • RAM acquisition
  • Methods and tools that can process volatile memory
  • RAM memory forensics limitations

25/26
Week 7: Memory Forensics

What is random access memory (RAM)?

What it does?


25/26
Week 7: Memory Forensics

RAM

  • It is used to temporarily store working data/code on an active computer system.
  • It is type of computer memory and data can be read/written on RAM at extremely fast speeds.
  • It is a vital source of digital evidence that contains information about the current running state of the system before you shut it down.

For example, it contains information about any running programs, information related to network connections the host has with other peers. This could be a legitimate use of peer-to-peer file sharing, or it could show a link to the attacker’s host.


25/26
Week 7: Memory Forensics

RAM's Features

  • Temporary (YET primary), unlike long-term storage.
  • Exists as physical & virtual memory.
  • Volatile - loses data without power.

25/26
Week 7: Memory Forensics

Volatile data

  • Data constantly changes.
  • Lost if power is removed.
  • Stored in RAM:
    • Static RAM (SRAM) chips
    • Dynamic RAM (DRAM) chips

25/26
Week 7: Memory Forensics

Type of RAM

Static RAM (SRAM)

  • Faster and more energy-efficient.
  • Used as CPU cache memory.
  • Stores BIOS settings in CMOS SRAM.
  • Requires power (‘CMOS battery’) to retain data.

Dynamic RAM (DRAM)

  • Cheaper to produce than SRAM.
  • Commonly used for main system memory.
  • Data must be periodically refreshed.

25/26
Week 7: Memory Forensics

25/26
Week 7: Memory Forensics

Type of SDRAM

Synchronous DRAM (SDRAM)

  • Syncs with the system bus.
  • Faster than standard DRAM.
  • Reads/writes one WORD (16 bits/2 bytes) at a time.

Double Data Rate SDRAM (DDR SDRAM)

  • Reads/writes two WORDs (16 bits/2 bytes) at a time.
  • DDR1 has 2× the bandwidth of SDRAM.

25/26
Week 7: Memory Forensics

Activity: Identifying Artefacts in RAM (5 mins)

List some the potential artefacts stored in RAM. What can you find?


25/26
Week 7: Memory Forensics

RAM

RAM holds volatile data that reflects the system's current state. Common artefacts include:

  • Running Processes - Active applications and background services.
  • Open Network Connections - IP addresses, ports, and active sessions.
  • Decryption Keys & Passwords - Sensitive credentials stored temporarily.
  • Clipboard Data - Copied text, images, and files.
  • Unwritten Files & Cached Data - Documents, browser history, and system logs.
  • Malware & Attack Traces - Indicators of compromise, injected code, or exploits.

RAM analysis is crucial in digital forensics for extracting volatile evidence before it disappears.


25/26
Week 7: Memory Forensics

Activity: The Role of Memory Forensics in Cybersecurity

Please, and in pairs, take 5 minutes to consider:

  1. Malware Detection
  2. Memory Exploits
  3. Encryption & RAM
  4. Authentication & Security

Please make some notes for discussion


25/26
Week 7: Memory Forensics

RAM Acquisition


25/26
Week 7: Memory Forensics

Order of volatility

1 Registers, cache
2 Routing table, ARP cache, processes, memory
3 Temporary file systems
4 Disk
5 Remote logging/monitoring data
6 Physical configuration, network topology
7 Archived data

25/26
Week 7: Memory Forensics

RAM Acquisition: Avoid Destroying Evidence

DON’T

  • Don’t Shutdown before collecting live evidence.
  • Don’t Trust system tools: If possible use your own

DO

  • Do Use tools with the smallest and known footprint.
  • Do Prefer the terminal whenever practical.
  • Do Use scripts to minimise, control, and audit actions (and automate your work).

25/26
Week 7: Memory Forensics

RAM lives in physical chips only, right?

  • A system’s RAM consists of two key components when live:
    • Physical RAM
    • Pagefile
  • Both are needed for the full picture of memory analysis.
  • Now, wha about hibernates?

25/26
Week 7: Memory Forensics

Risks of RAM acquisition

  • Volatility - Data life expectancy is short.
  • Accuracy - Are results reliable?
  • Intrusiveness - Can tools alter evidence?
  • Repeatability - Analysis is repeatable, acquisition is not.

25/26
Week 7: Memory Forensics

RAM Acquisition Methodology

The ACPO Guide advises:

  1. Risk Assessment
    • Ensure acquisition is necessary and safe.
  2. Insert Data Carrier & Start Acquisition
    • Use trusted forensic tools with minimal system impact.
  3. Stop & Remove Data Carrier
    • Prevent tampering or modifications.
  4. Verify Data on a Separate Machine
    • Check integrity using hashes (MD5, SHA-256).
  5. Follow Standard Procedures
    • Maintain chain of custody, document findings, ensure repeatability.

25/26
Week 7: Memory Forensics

Tools

1. RAM Acquisition Tools

2. Memory Analysis Tools

3. Live Forensics & Monitoring


25/26
Week 7: Memory Forensics

1. RAM Acquisition Tools


25/26
Week 7: Memory Forensics

2. Memory Analysis Tools


25/26
Week 7: Memory Forensics

3. Live Forensics & Monitoring


25/26
Week 7: Memory Forensics

Exmaple: Locally on the Suspect Machine

  • Modern Linux systems restrict access to kernel memory to prevent attacks.
  • fmem: Linux Kernel Module
    • Creates /dev/fmem to provide direct RAM access.
  • Using dd cmd
  • Reads & writes data bit-by-bit from a media device or file.

25/26
Week 7: Memory Forensics

Exmaple: Remotly


25/26
Week 7: Memory Forensics

Identifying Sources of Memory

  • What if Volatile Data Cannot Be Collected?
    • Direct RAM analysis may not always be possible.

      Aternative Memory Sources
      Source Description
      Hibernation File (hiberfil.sys) Stores RAM contents when the system hibernates.
      Pagefile (pagefile.sys) Virtual memory file used for paging active RAM data.
      Swapfile (swapfile.sys) Stores suspended Windows app data to free RAM.
      Crash Dump (memory.dmp) Captures RAM state when a system crashes (BSOD).
      Kernel Memory Dump Contains critical kernel-mode memory post-crash.
      Small Dump Files Logs running processes & loaded drivers at crash time.

25/26
Week 7: Memory Forensics

Lab

  1. Please review you lab from here.
  2. Extra
    1. Infosec: Memory Forensics
    2. Volatility Workbench
    3. TryHackMe: Memory Forensics

25/26

## SRAM vs DRAM

- **Not quite…**

1. **Risk Assessment** - Determine if RAM acquisition is necessary and safe. - Assess potential impact on the system and data integrity. 2. **Insert Data Carrier & Start Acquisition** - Use a trusted external device (Data Carrier) with preloaded forensic tools. - Ensure minimal system interaction to prevent contamination. 3. **Stop & Remove the Data Carrier** - Once acquisition is complete, safely eject the device. - Prevent accidental overwrites or system modifications. 4. **Verify Data on a Separate Machine** - Analyse the acquired RAM image on a **forensically sound** system. - Use checksum/hash verification to confirm data integrity. 5. **Commence Standard Acquisition Process** - Follow forensic procedures for further analysis. - Document findings, maintain chain of custody, and ensure repeatability.

- **Rekall** - Advanced memory analysis and incident response.

- **NetworkMiner** - Network packet analysis with memory inspection features.