analysis of the windows...

22
Mississippi State University Digital Forensics 1 Analysis of the Windows Registry Alex Applegate

Upload: others

Post on 05-Feb-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 1

Analysis of the Windows Registry

Alex Applegate

Page 2: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 2

Overview

•  The Windows Registry •  Registry Hives •  Registry File Layout •  Important Registry Keys •  Shellbags

Page 3: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 3

The Windows Registry

Not this kind of registry…

Page 4: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 4

The Windows Registry

•  Tree-style database used by almost every part of the Windows operating system –  Hive

•  Keys – Key Value or Subkey

» Subkey Value –  Each hive may have its own file in the file

system –  Some hives only exist in system memory

Page 5: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 5

Registry Hives

•  Not this kind of hive…

Page 6: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 6

Registry Hives

•  %SystemRoot%\System32\Config –  System registry area –  Is a directory that contains multiple files

•  %UserProfile%\NTUSER.dat –  User registry file

•  Most Common Hives –  HKEY_CLASSES_ROOT –  HKEY_CURRENT_USER –  HKEY_LOCAL_MACHINE

Page 7: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 7

System Hive Files in Windows Explorer

Page 8: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 8

User Hive in Windows Explorer

Page 9: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 9

Hives in Regedit

Page 10: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 10

Registry File Layout

•  Official format never released by Microsoft •  Each hive is broken into 4096-byte blocks •  First block in a hive is always a “base

block” •  Data is represented in “cells”

–  A field at the beginning of the cell describes whether it is a key, value, subkey list, or subkey

•  A “cell index” is the offset of a particular cell inside the hive relative to the first bin

Page 11: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 11

Registry File Hive Block

Source: http://www.codeproject.com/Articles/24415/How-to-read-dump-compare-registry-hives

Page 12: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 12

Registry File Layout (cont’d)

•  The first bin always begins immediately after the base block

•  Each hive contains a root cell at the beginning that holds the lists of keys and key values of the top level

•  Each key in the registry maintains a list of any subkeys subordinate to it in a subkey list

•  All the values for a particular key are maintained in an associated value list

Page 13: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 13

Registry Keys

•  Not these kinds of keys (is this getting old yet?)

Page 14: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 14

Important Registry Keys

•  HKCU = HKEY_Current_User, HKLM = HKEY_Local_Machine

•  Recently run programs via the Run command –  HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU

•  Typed URLs in Internet Explorer –  HKCU\Software\Microsoft\Windows\Internet Explorer\TypedURLs

•  Programs That Run at Startup –  HKLM\Software\Microsoft\Windows\CurrentVersion\Runonce –  HKLM\Software\Microsoft\Windows\CurrentVersion\policies\Explorer

\Run –  HKLM\Software\Microsoft\Windows\CurrentVersion\Run –  HKCU\Software\Microsoft\WindowsNT\CurrentVersion\Windows\Run –  HKCU\Software\Microsoft\Windows\CurrentVersion\Run –  HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce

Page 15: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 15

Registry Subkeys and Key Values

Page 16: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 16

Shellbags

•  Not this kind of shellbag (I don’t think I like this game any more…)

Page 17: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 17

Shellbags

•  What in the world is a “shellbag”? –  SANS describes shellbags this way:

•  “Windows uses the Shellbag keys to store user preferences for GUI folder display within Windows Explorer. Everything from visible columns to display mode (icons, details, list, etc.) to sort order are tracked. If you have ever made changes to a folder and returned to that folder to find your new preferences intact, then you have seen Shellbags in action. In the paper Using shellbag information to reconstruct user activities, the authors write that "Shellbag information is available only for folders that have been opened and closed in Windows Explorer at least once" [1]. In other words, the simple existence of a Shellbag sub-key for a given directory indicates that the specific user account once visited that folder. Thanks to the wonders of Windows Registry last write timestamps, we can also identify when that folder was first visited or last updated (and correlate with the embedded folder MAC times also stored by the key). In some cases, historical file listings are available. Given much of this information can only be found within Shellbag keys, it is little wonder why it has become a fan favorite.”

Page 18: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 18

What’s in a Shellbag?

•  Filtering through the mess above: –  GUI folder display within Windows Explorer –  Visible columns –  Display mode (icons, details, list, etc.) –  Sort order –  Saved changes to a folder –  An indication that a specific user account once visited a folder –  When a folder was first visited or last updated (and correlate

with the embedded folder MAC times also stored by the key). –  Historical file listings (sometimes)

Page 19: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 19

Common Shellbags

•  Pre-Windows 7 –  HKEY_USERS\<USERID>\Software\Microsoft\Windows\Shell –  HKEY_USERS\<USERID>\Software\Microsoft\Windows\ShellNoRoam –  HKEY_USERS\<USERID>\Software\Microsoft\Windows\StreamsMRU

•  Windows 7 (and presumably later) –  USRCLASS.DAT\Local Settings\Software\Microsoft

\Windows\Shell\BagMRU –  USRCLASS.DAT\Local Settings\Software\Microsoft

\Windows\Shell\Bags –  NTUSER.DAT\Software\Microsoft\Windows\Shell\BagMRU –  NTUSER.DAT\Software\Microsoft\Windows\Shell\Bags

Page 20: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 20

Summary

Page 21: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 21

Summary

•  The Windows Registry •  Registry Hives •  Registry File Layout •  Important Registry Keys •  Shellbags

Page 22: Analysis of the Windows Registryweb.cse.msstate.edu/~hamilton/Forensics/Basic/Registry_Analysis.pdf · Mississippi State University Digital Forensics 10 Registry File Layout • Official

Mississippi State University Digital Forensics 22

Analysis of the Windows Registry

QUESTIONS?