Forensic ArtifactWindows: Registry

SYSTEM Registry Hive

The SYSTEM hive is the backbone of Windows hardware and service configuration. It stores CurrentControlSet data, service definitions, USBSTOR device history, Shimcache execution traces, BAM/DAM timestamps, network interface settings, and MountedDevices volume mappings.

The SYSTEM registry hive is the most densely packed forensic artifact in the Windows registry. It records every service installed, every USB device connected, every network adapter configured, and — through Shimcache and BAM/DAM — evidence of program execution that persists long after the executable has been deleted. For incident responders, the SYSTEM hive is the first artifact opened after the $MFT.

What Is the SYSTEM Hive?

The SYSTEM hive is one of five core registry hive files loaded at boot by the Windows kernel. It resides at C:\Windows\System32\config\SYSTEM and is mapped to HKEY_LOCAL_MACHINE\SYSTEM in the live registry. Unlike the SOFTWARE hive (which stores application and OS settings) or the SAM hive (which stores user account data), the SYSTEM hive is dedicated to hardware abstraction, driver configuration, and service management.

The hive is organized around ControlSets — numbered configuration profiles (ControlSet001, ControlSet002, etc.) that represent complete system configurations. The Select key at the root of the SYSTEM hive contains four DWORD values (Current, Default, Failed, LastKnownGood) that indicate which ControlSet is active. The CurrentControlSet symbolic link redirects to whichever ControlSet the Select\Current value points to — on a live system this is transparent, but on a forensic image you must check the Select key to determine which ControlSet was in use.

The forensic value of the SYSTEM hive is extraordinary: it contains execution evidence (Shimcache, BAM/DAM), device connection history (USBSTOR, MountedDevices), network configuration (TCP/IP parameters, interface names), service persistence mechanisms (malicious services), computer identity (ComputerName, TimeZoneInformation), and boot configuration data. Many of these artifacts persist across reboots and survive application uninstall.

Key Insight

The Select\Current value tells you which ControlSet was active at the time the system was last running. On a forensic image, always check this value first. If Current = 1, then ControlSet001 was the active configuration. Analyzing the wrong ControlSet means analyzing a potentially outdated or never-used configuration.

Location & Format

File Paths

FilePathNotes
SYSTEMC:\Windows\System32\config\SYSTEMPrimary hive file; locked by OS on live system
SYSTEM.LOG1/LOG2C:\Windows\System32\config\SYSTEM.LOG1Transaction logs; contain uncommitted changes (dirty hive recovery)
RegBack copiesC:\Windows\System32\config\RegBack\SYSTEMPeriodic backup (disabled by default in Windows 10 1803+)

Hive Format

The SYSTEM hive uses the Windows NT Registry Hive format — a binary file structure with a 4 KB header (containing the regf signature), followed by bins (hbin containers) that hold key nodes (nk records), value nodes (vk records), and data cells. Transaction logs use the same format with a write-ahead logging model. If the hive was not cleanly unmounted (e.g., sudden power loss), replaying the transaction logs recovers uncommitted changes. Tools like Registry Explorer and RegRipper handle dirty hive recovery automatically.

CurrentControlSet & the Select Key

The Select key is the first thing to examine in any SYSTEM hive analysis. It sits at SYSTEM\Select and contains four values:

ValueTypeMeaning
CurrentREG_DWORDControlSet number that was active when the system was last running
DefaultREG_DWORDControlSet that will be used on next normal boot
FailedREG_DWORDControlSet that failed during the last boot attempt (0 if none)
LastKnownGoodREG_DWORDControlSet saved after the last successful user login
REGISTRY / SELECT KEY
; Example: SYSTEM\Select
Current       = 0x00000001  ; ControlSet001 was active
Default       = 0x00000001
Failed        = 0x00000000  ; No failed boot
LastKnownGood = 0x00000002  ; ControlSet002 is LKG

What It Reveals

The SYSTEM hive answers a wide range of investigative questions through its subkeys:

Forensic Use Cases

1. Malicious Service Persistence

A ransomware operator installs a service named WindowsUpdateSvc with ImagePath pointing to C:\ProgramData\svc.exe and Start set to 2 (auto-start). The SYSTEM hive preserves this service entry even after the executable is deleted. The ObjectName value reveals the service ran under LocalSystem. Cross-referencing the service creation timestamp with Security.evtx Event ID 7045 provides the exact installation time.

2. USB Device Timeline

An insider threat investigation requires proving that a specific USB drive was connected during the data exfiltration window. The USBSTOR key under ControlSet001\Enum\USBSTOR\Disk&Ven_SanDisk&Prod_Ultra&Rev_1.00\4C530001280812116284 provides the device serial number. The subkey timestamps (first connection) combined with MountedDevices (drive letter assignment) and SYSTEM\MountPoints2 in the user’s NTUSER.DAT (user-level mount) create a complete USB connection timeline.

3. Shimcache Execution Evidence

The attacker deleted their tools from C:\Windows\Temp\ after the operation. Shimcache in the SYSTEM hive retains entries showing C:\Windows\Temp\mimikatz.exe with a last-modified timestamp, proving the file existed on disk. While Shimcache does not definitively prove execution (only that the OS evaluated the file for compatibility), the combination of Shimcache presence + Prefetch entry + Amcache hash creates a dispositive execution proof.

4. BAM/DAM Execution Timestamps

BAM (Background Activity Moderator) data provides per-user execution timestamps with second-level precision. When an investigator finds SYSTEM\ControlSet001\Services\bam\State\UserSettings\S-1-5-21-...-1001 containing an entry for \Device\HarddiskVolume3\Users\jdoe\Downloads\nc.exe with a FILETIME value, this proves user jdoe executed nc.exe at that exact timestamp. BAM data is particularly valuable because it survives Prefetch deletion.

5. Network Configuration and DHCP Attribution

The network interface keys store DHCP lease information including DhcpIPAddress, DhcpServer, LeaseObtainedTime, and LeaseTerminatesTime. This proves which IP address the machine held at a specific time — critical for correlating network flow data and firewall logs with endpoint activity. The NameServer value reveals configured DNS servers, which may indicate VPN usage or DNS hijacking.

Acquisition Methods

Collection Warning

The SYSTEM hive is locked by the OS kernel on a live system. Direct file copy will fail. Use Volume Shadow Copy, KAPE, reg save, or a forensic imaging tool. Always collect the transaction logs (SYSTEM.LOG1, SYSTEM.LOG2) alongside the hive for dirty-shutdown recovery.

CMD / ADMIN
:: Save SYSTEM hive from live system using reg.exe
reg save HKLM\SYSTEM C:\Evidence\SYSTEM /y

:: Using KAPE
kape.exe --tsource C: --tdest C:\Evidence --target RegistryHives

:: Using Volume Shadow Copy
vssadmin create shadow /for=C:
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy3\Windows\System32\config\SYSTEM C:\Evidence\
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy3\Windows\System32\config\SYSTEM.LOG1 C:\Evidence\
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy3\Windows\System32\config\SYSTEM.LOG2 C:\Evidence\
BASH / FORENSICS
# Mount forensic image read-only
mount -o ro,noexec,nodev /dev/sdb1 /mnt/evidence

# Copy SYSTEM hive and transaction logs
cp /mnt/evidence/Windows/System32/config/SYSTEM /analysis/registry/
cp /mnt/evidence/Windows/System32/config/SYSTEM.LOG* /analysis/registry/

Parsing Tools & Analysis

ToolAuthorLicenseOutputNotes
Registry ExplorerEric ZimmermanFreeGUI + exportBest GUI tool; handles dirty hive recovery; bookmark support for forensic keys
RegRipperHarlan CarveyOpen source (Perl)Text/TLNPlugin-based; rip.pl -r SYSTEM -p compname extracts ComputerName instantly
AppCompatCacheParserEric ZimmermanFreeCSVDedicated Shimcache parser; extracts all entries with timestamps and positions
RECmdEric ZimmermanFreeCSVCommand-line registry parser; batch processing with batch files
python-registryWilli BallenthinOpen source (Python)ProgrammaticPython library for custom registry parsing scripts

RegRipper Quick Extractions

BASH / FORENSICS
# Extract computer name
rip.pl -r /analysis/registry/SYSTEM -p compname

# Extract timezone information
rip.pl -r /analysis/registry/SYSTEM -p timezone

# Extract all services
rip.pl -r /analysis/registry/SYSTEM -p services

# Extract USBSTOR entries
rip.pl -r /analysis/registry/SYSTEM -p usbstor

# Extract Shimcache
AppCompatCacheParser.exe -f /analysis/registry/SYSTEM --csv /analysis/output/

# Extract BAM data
rip.pl -r /analysis/registry/SYSTEM -p bam

Retention & Persistence

Sub-ArtifactRetentionNotes
ServicesPermanent until manually deletedService entries persist even after the service binary is removed
USBSTORPermanentDevice entries are never automatically purged; persist for the life of the OS install
Shimcache~1,024 entries (FIFO)Rolling buffer; oldest entries evicted when new entries are added. Written to registry on clean shutdown only.
BAM/DAM~7 days rollingEntries older than 7 days are automatically purged by the BAM service
MountedDevicesPermanentDrive letter mappings persist until explicitly removed
Network InterfacesPermanent per adapterDHCP lease data updated on each lease renewal; historical data overwritten
ComputerNamePermanentChanged only by explicit rename operation
TimeZonePermanentChanged only by explicit user or GPO modification
Shimcache Write Behavior

Shimcache data is maintained in memory and only written to the registry during a clean shutdown (or hibernate). On a system that crashed or was forcibly powered off, the on-disk Shimcache may be stale. Always check whether the system was cleanly shut down (Event ID 1074 in System.evtx) to assess Shimcache currency.

Anti-Forensics Resilience

Tool / TechniqueAffects SYSTEM Hive?Details
CCleanerNoDoes not modify SYSTEM hive; only targets user-level artifacts
Registry cleanersMinimalMay remove orphaned keys but do not target forensic artifacts like Shimcache or USBSTOR
Manual key deletionPossibleRequires admin privileges; detectable via transaction log analysis showing deletion operations
Shimcache clearingPossibleDeleting the AppCompatCache value requires admin; detectable via last-write timestamp on the parent key
Service deletionYessc delete <name> removes the service key, but transaction logs may retain the deleted data
USBSTOR clearingRareRequires targeted registry editing; most adversaries do not know to clear this artifact
Transaction Log Recovery

Even when an adversary deletes a registry key, the transaction logs (SYSTEM.LOG1, SYSTEM.LOG2) may still contain the deleted data if they have not been overwritten. Tools like Registry Explorer can replay transaction logs to recover deleted keys. Additionally, the deleted key space in the hive file itself may contain recoverable data until the space is reallocated — yarp and Registry Explorer can carve deleted entries.

MITRE ATT&CK Detection Mapping

TechniqueNameSYSTEM Hive Evidence
T1543.003 T1543.003Create or Modify System Process: Windows ServiceMalicious service entries under ControlSet001\Services\ with suspicious ImagePath values
T1547.001 T1547.001Boot or Logon Autostart ExecutionService Start value set to 2 (auto) or 0 (boot) for persistence
T1025 T1025Data from Removable MediaUSBSTOR entries documenting USB device connections during the incident timeframe
T1059 T1059Command and Scripting InterpreterShimcache entries for cmd.exe, powershell.exe, wscript.exe from unusual paths
T1070.004 T1070.004Indicator Removal: File DeletionShimcache proves a deleted file existed; BAM/DAM proves it was executed by a specific user
T1014 T1014RootkitSuspicious kernel-mode driver entries under Services with Type = 1 (kernel driver)

Related Artifacts & Cross-References

ArtifactRelationship to SYSTEM HiveCross-Correlation Value
SOFTWARE HiveStores application settings, NetworkList profiles, Amcache, uninstall entriesNetworkList SSIDs + SYSTEM interface data = complete network history
SAM HiveUser account data; requires SYSTEM hive boot key (SYSKEY) for decryptionSAM passwords cannot be extracted without the SYSTEM hive boot key
NTUSER.DATPer-user settings; MountPoints2 shows user-level USB mount eventsUSBSTOR (system) + MountPoints2 (user) = device-to-user attribution
Amcache.hveSHA1 hashes and full paths for executed binariesShimcache shows the file existed; Amcache provides its hash for malware identification
PrefetchExecution count and timestamps for .pf filesShimcache + Prefetch + BAM = three independent execution proofs
Security.evtxEvent IDs 7045 (service install), 4697 (service install audit)Service creation timestamp from event log confirms SYSTEM hive service entry

References

  1. Eric Zimmerman, “Registry Explorer / RECmd” — https://ericzimmerman.github.io/
  2. Harlan Carvey, “RegRipper — Registry Analysis Tool” — https://github.com/keydet89/RegRipper3.0
  3. SANS Institute, “Windows Forensic Analysis Poster” — https://www.sans.org/posters/
  4. Microsoft, “Registry Hive Structure” — https://learn.microsoft.com
  5. Andrea Fortuna, “Shimcache Analysis in Forensic Investigations” — https://andreafortuna.org
  6. 13Cubed, “BAM — Background Activity Moderator” — https://www.13cubed.com
  7. Willi Ballenthin, “python-registry” — https://github.com/williballenthin/python-registry

Mjolnir Security — Digital Forensics & Incident Response

Mjolnir Security provides 24/7 incident response, digital forensics, and expert witness testimony. Our DFIR team specializes in registry analysis, Shimcache reconstruction, and service persistence investigation.

Digital ForensicsIncident ResponseExpert WitnessRegistry AnalysisShimcacheUSB Forensics

mjolnirsecurity.com — 24/7: +1 833 403 5875