Windows API reference
RegSaveKeyW
Saves the specified registry key and its subkeys to a new file in the standard registry hive format.
- Library
- Advapi32.dll
- Category
- Registry, Credential Access
- Suspicion
- high
- MITRE ATT&CK
- T1003 OS Credential Dumping
Detection summary
Hive export for credential dumping: save HKLM\SAM, HKLM\SECURITY or HKLM\SYSTEM to a file, then exfiltrate or parse offline; detect Sysmon 11 creation of .hiv/.save/.tmp files in temp or public paths, access to SAM/SECURITY registry keys, SeBackupPrivilege use, and reg.exe or rundll32 LOLBIN activity. Protected hives require backup privilege.
- Sysmon: Sysmon Event 11
- ETW: Microsoft-Windows-Kernel-File
- Notes: Sysmon 11 records output-file creation, not the API call; saving over an existing file may not generate Event 11. Correlate with registry access and backup-privilege use.
Sources and documentation
- Microsoft Learn documentation (direct documentation)
Not yet human-reviewed. Page metadata generated .
Legitimate use
Windows Backup, System Restore, registry migration, forensic acquisition and enterprise configuration tools.