RegistryHivesUser
Windowsv1
Author: Eric Zimmerman / Mark Hallman
description
User Related Registry hives
paths
9 paths
RegistryNTUSER.DAT registry hive XP
C:\Documents and Settings\%user%\NTUSER.DAT*RegistryNTUSER.DAT registry hive
C:\Users\%user%\NTUSER.DAT*RegistryNTUSER.DAT registry transaction files
C:\Users\%user%\NTUSER.DAT.LOG*RegistryNTUSER.DAT DEFAULT registry hive
C:\Windows\System32\config\DEFAULTRegistryNTUSER.DAT DEFAULT registry hive
C:\Windows.old\Windows\System32\config\DEFAULTRegistryNTUSER.DAT DEFAULT transaction files
C:\Windows\System32\config\DEFAULT.LOG*RegistryNTUSER.DAT DEFAULT transaction files
C:\Windows.old\Windows\System32\config\DEFAULT.LOG*RegistryUsrClass.dat registry hive
C:\Users\%user%\AppData\Local\Microsoft\Windows\UsrClass.dat*RegistryUsrClass.dat registry transaction files
C:\Users\%user%\AppData\Local\Microsoft\Windows\UsrClass.dat.LOG*› paths use Windows environment syntax
collection commands
# PowerShell Artifact Collection Script
# Target: RegistryHivesUser
# Run as Administrator
#Requires -RunAsAdministrator
$ErrorActionPreference = "SilentlyContinue"
$DestBase = "D:\Evidence"
# Function to handle directory creation and copying
function Collect-Artifact {
param (
[string]$SourcePath,
[string]$FolderName
)
$FullDest = Join-Path -Path $DestBase -ChildPath $FolderName
if (-not (Test-Path -Path $FullDest)) {
New-Item -ItemType Directory -Path $FullDest -Force | Out-Null
}
Copy-Item -Path $SourcePath -Destination $FullDest -Recurse -Force
}
# 1. NTUSER.DAT registry hive XP
$UserPath = Join-Path $env:USERPROFILE ""
Collect-Artifact -SourcePath "$UserPath\NTUSER.DAT*" -FolderName "NTUSER_DAT_registry_hive_XP"
# 2. NTUSER.DAT registry hive
$UserPath = Join-Path $env:USERPROFILE ""
Collect-Artifact -SourcePath "$UserPath\NTUSER.DAT*" -FolderName "NTUSER_DAT_registry_hive"
# 3. NTUSER.DAT registry transaction files
$UserPath = Join-Path $env:USERPROFILE ""
Collect-Artifact -SourcePath "$UserPath\NTUSER.DAT.LOG*" -FolderName "NTUSER_DAT_registry_transaction_files"
# 4. NTUSER.DAT DEFAULT registry hive
Collect-Artifact -SourcePath "C:\Windows\System32\config\\DEFAULT" -FolderName "NTUSER_DAT_DEFAULT_registry_hive"
# 5. NTUSER.DAT DEFAULT registry hive
Collect-Artifact -SourcePath "C:\Windows.old\Windows\System32\config\\DEFAULT" -FolderName "NTUSER_DAT_DEFAULT_registry_hive"
# 6. NTUSER.DAT DEFAULT transaction files
Collect-Artifact -SourcePath "C:\Windows\System32\config\\DEFAULT.LOG*" -FolderName "NTUSER_DAT_DEFAULT_transaction_files"
# 7. NTUSER.DAT DEFAULT transaction files
Collect-Artifact -SourcePath "C:\Windows.old\Windows\System32\config\\DEFAULT.LOG*" -FolderName "NTUSER_DAT_DEFAULT_transaction_files"
# 8. UsrClass.dat registry hive
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Microsoft\Windows\"
Collect-Artifact -SourcePath "$UserPath\UsrClass.dat*" -FolderName "UsrClass_dat_registry_hive"
# 9. UsrClass.dat registry transaction files
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Microsoft\Windows\"
Collect-Artifact -SourcePath "$UserPath\UsrClass.dat.LOG*" -FolderName "UsrClass_dat_registry_transaction_files"
Write-Host "Collection complete!" -ForegroundColor Green› Save as .ps1 and run as Administrator. Use: powershell -ExecutionPolicy Bypass -File script.ps1
› cyberchef recipes
Open in CyberChef to decode values extracted from this artifact.