Skip to content

Latest commit

 

History

History
243 lines (133 loc) · 11 KB

4- Registry Analysis.md

File metadata and controls

243 lines (133 loc) · 11 KB

Windows Forensic Investigation (4- Registry Analysis) 🧊

Prerequisites

We reached the fourth step of Windows forensics process, needless to mention the importance of the previous phases:

1- Gathering Volatile Information: link

2- Collecting Non-volatile Information: link

3- Memory Analysis: link

Definition

The Windows registry is an organized database with low-level settings for Microsoft Windows OS and applications that use it. Analyzing the data in the registry can assist forensic investigators in gathering information on software installation, hardware driver configuration, user activity, and connected devices. This information is useful for creating a timeline analysis of an incident during a forensic investigation.

1/ Get Informed

The first step is to get informed about the Windows registry. It can take forever to understand it fully as it is a complex subject, but you don’t need to be an expert in registry to get the information you’re looking for.

Windows Registry is composed of 5 hives that contain everything:

Registry Editor

HKEY_USERS (HKU):

Contains information about all currently active users (SID) profiles. keys and values under each SID control the user specific mapped drives, installed printers, environmental variables, and so on.

HKEY_LOCAL_MACHINE (HKLM):

Contains software configuration information and information about the physical state of the computer. It’s data is stored in

“%SystemRoot%\Users\<UserName>”\NTUSER.DAT

HKEY_CLASSES_ROOT (HKCR):

Subkey of HKLM\Software. Contains the information that ensure that the correct program opens when the user opens a file through Windows Explorer.

HKEY_CURRENT_USER (HKCU):

Contains the configuration information related to the user currently logged-on (wallpaper, display settings)

HKEY_CURRENT_CONFIG (HKCC):

Stores information about the current hardware profile of the system. explains the differences between the current and standard hardware configuration. A pointer to HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\Current

· Non-volatile Hives are: HKEY_LOCAL_MACHINE, HKEY_USERS

· Volatile Hives: HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_CURRENT_CONFIG

Identify which hives are relevant to your investigation

2/ Types of Forensic Analysis

The Windows registry is a valuable resource for digital forensic investigations as it allows investigators to extract various types of forensic artifacts, including user accounts, recently accessed files, USB activity, last run programs, and installed applications.

There are two methods of analyzing Windows Registry:

A- Static Analysis

Check the registry files inside C:\Windows\System32\config folder stored on the captured evidence file

C:\Windows\System32\config

C:\Windows\System32\config

1- DEFAULT: includes default user settings

2- SAM (Security Account Manager): includes local user account and local group membership information like passwords.

3- SECURITY: stores information on the current user security policy

4- SOFTWARE: holds information about installed applications and their configuration on the system

5- SYSTEM: holds configuration settings of hardware drivers and services

after gathering needed files use tools like Hex Workshop to retrieve artifacts related to cyber-crimes (SSH installed the day of the attack !!)

Hex Workshop

SOFTWARE Subkey Analysis

we can also export registry to a text file

The registry can be considered as a log file as it has some action or event associated with a time like Last Write Time which provides a timeframe reference for certain user activities on the system.

B- Live Analysis

Investigators can access the registry using the built-in registry editor, as well as capture registry files from a live system using tools such as FTK Imager for further analysis.

Open FTK Imager > Add Evidence Item > Logical Drive > Next

browse to C:\Windows\System32\config > choose the registry file you want to investigate.

3/ Valuable Information Locations

1. System Information

  • Computer Name
    HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName

  • ProductName, CurrentBuildNumber, RegisteredOwner, etc.
    HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion

2. Last Shutdown Time and Time Zone

  • Last Shutdown Time
    HKLM\SYSTEM\ControlSet001\Control\Windows
  • Timezone Settings
    HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

Use DCode to convert found data to human-readable format.

3. Shares

HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Shares

By default, Windows Vista, 7, 8.1, and 10 create hidden administrative shares on a system. If a user creates an additional share, it’llappear here.

4. Wireless SSIDs

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles\{GUID}

This key will give you information about any accessed wireless networks: their names, first time of connection, last time of connection, etc.

5. Startup Locations

[HKCU|HKLM]\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Search for any unusual programs that appears in the auto startup list.

in the case of live analysis you can use: Task Manager > Startup apps,

you can use Autoruns or Slient Runners to enumerate autostart locations (use VirusTotal to analyze files and URLs for viruses, worms, trojans and other kinds of malicious content).

Autoruns utility

6. User Login

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

When a user logs into a system, these keys are accessed and parsed so that the startup apps can be executed, so it gives an idea about when the user logged-in. they’re not accessed if the system is started in Safe Mode.

7. Microsoft Security ID

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

a unique identification number (acts as a token) that Microsoft assigns to a Windows user account for granting user access to a specific resource.

8. User Activity

HKLM\SOFTWARE\Classes\exefile\shell\open\command
HKCR\exefile\shell\open\command

Autostart registry locations are accessed when the user performs any action like opening an application, so search them for malicious code.

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify

Windows sends alerts when certain events occurs (logged-on/off), based on Last Write times check entries close to the date of the suspected incident.

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Userinit HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell

these are also commonly abused Winlogon registry keys and value for persistence like Notify,

check (in the previous 3 keys) for entries that list DLLs in the DLLName value that have suspicious file version information or no file version information at all.

9. USB Removable Storage Devices

After a USB device is plugged into a Windows system, the PnP (Plug and Play) manager searches for the required driver to recognize the device, and evidence of its use, such as artifacts or footprints, can be found in the registry.

HKLM\SYSTEM\CurrentControlSet\Enum\USBSTOR
HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses

export these two keys to text files and use both unique instance identifier (GUID) and the ParentIdPrefix to determine the last time when the USB device was connected to the system. You can also use USBDeview to view the contents of the device descriptor.

10. Mounted Devices

When a device is mounted on an NTFS system, it’s assigned a driver letter

HKLM\System\MountedDevices

11. The User Assist Keys

When a user access a file, control panel applets, and programs:

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{GUID}\Count

values are encoded in ROT-13 encryption algorithm (Caesar cipher), use rot13 to decode it.

registry keys that track user activities can be found in the NTUSER.DAT file.

12. MRU Lists

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32

The RunMRU key is added when a user execute a program from Start > Run.

HKCU\Software\Microsoft\Internet Explorer\TypedURLs

contains the typed URLs into the address bar of Internet Explorer (Edge)

13. Connecting to Other Systems

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU

when the system connects to a remote drive or share using Map Network Drive Wizard, an MRU List is added.

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2

contains the remote drives added using either Map Network Drive Wizard or the net use command.