Memory and operating system artifacts

Unit 4 of 5 in Digital forensics basics.

You will be able to read what a memory image and common operating system records show, and say how far each can be trusted.

Lesson

Why memory is worth capturing

SP 800-86 says operating systems run in RAM, whose contents change constantly, and that RAM often holds recently used data such as data files, password hashes and recent commands. Like a disk, memory also holds residual data in slack and free space: pages released by one program may still contain what it left. The guide says volatile data can be collected only from a live system that has not been rebooted, and that the contents of memory come third in its collection order, after network connections and login sessions.

It also says collecting from a running machine carries risk: files may change, and a malicious party might have installed rootkits designed to return false information. A memory image is a snapshot you can study without touching the live machine again, which is one reason people capture it first and analyze it later.

How to capture memory depends on the operating system and the tool, and this class does not teach a capture tool. The labs analyze an image you capture from your own machine or virtual machine, or a documented public sample, and say which you are using.

Reading a memory image

The Volatility 3 documentation explains that memory analysis splits into memory layers, templates and objects, and symbol tables, all held in a context. A layer is data that can be accessed by address. Because processors use paged memory, a program's virtual addresses map to physical addresses, and each process usually has its own map, so the tool has to find the maps first. Symbol tables describe the structure of the operating system's internal data so that the tool can interpret raw bytes.

In practice you start by identifying the image, then ask the same question several ways. The listing of running processes, a scan for process structures and the process tree can disagree, and the lab teaches why the disagreement is informative: a process that appears in a scan but not in the linked list may have been hidden, or may simply have exited, and the exit-time column tells you which. Check that system process names have the right parent and path, read a chain of processes as a story, and corroborate with network connections and command lines before you conclude anything.

What the operating system leaves behind

Operating systems keep records for their own reasons that happen to be evidence. On Linux, the utmp(5) manual page says the utmp file lets you discover who is currently using the system, and warns that not every program uses utmp logging and that the file must not be writable by other users because system programs depend on its integrity. The last(1) manual page says last looks through the wtmp file, which records logins and logouts, and prints connect times, most recent first. The Linux lab combines these login records, shell history and the text authentication log to rebuild an intrusion on a virtual machine you stage yourself, then cross-checks them so that one wiped artifact does not blind you.

On Windows, the prefetch lab has you generate your own ground truth by running known programs a known number of times, then parse the prefetch files with a free tool, PECmd (the name stands for Prefetch Explorer Command Line), and compare the numbers. The lab, not a vendor document, explains what prefetch is and what it can and cannot prove, and it ends with the honest negative: prefetch cannot tell you everything. The browser lab does the same for browser history: find the profile, copy it, read the database and decode the timestamps.

The rule behind all of these: an artifact is a clue about what a program or person did, not a verdict. Different artifacts record different things, last for different times and can be cleared or forged.

Time you can trust, and absence of evidence

SP 800-86 lists three reasons file times can be wrong: the computer's clock was never synchronized with a good time source, the time may not be recorded to the detail you expected, and an attacker may have altered it. It adds that when file times matter, bit stream imaging should be used to collect, because some copy methods change creation times.

That is why the strongest forensic claims rest on agreement between independent sources, and why an empty log is weak evidence. Absence of evidence is not evidence of absence: logs rotate, history is lost when a shell is killed, and attackers delete records. Write down what you checked and what you could not check.

Key points

Sources

Practice in the labs

Read a memory image you captured or a documented sample, learn to read process tables, then reconstruct activity from Windows prefetch, Linux login records and browser history on your own machine.

Knowledge check

  1. Why might a memory image hold evidence a disk image does not? Answer: RAM holds recent commands, password hashes and running state that vanish at power-down. SP 800-86 says RAM often holds recently used data such as files, password hashes and recent commands, and that volatile data can only be collected from a live system that has not been shut down.
  2. A process appears in a scan of memory but not in the normal process list. What should you check first? Answer: Its exit time, to tell a hidden process from one that has simply ended. The lab teaches that a scan finds process structures the list no longer shows. A terminated process also lingers there, so the exit-time column separates the merely ended from the possibly hidden.
  3. According to the last(1) manual page, which file does last read? Answer: wtmp, which records logins and logouts. The manual says last looks through the wtmp file, which records all logins and logouts, and prints connect times with the most recent first.
  4. Why is an empty log weak evidence that nothing happened? Answer: Logs can rotate, be cleared or never have been enabled, so absence is not proof. A record that is missing may be missing because it was never kept, was rotated away, or was deleted. The labs repeat this, and SP 800-86 warns that file times too can be altered.

Back to the syllabus or see all classes.

Related