Skip to content
WETNav
SecurityObject AccessIn-depth analysis

Event ID 4657: A registry value was modified

Event 4657 is generated when a registry value is modified, created, or deleted, providing critical visibility into registry changes often used for persistence, privilege escalation, and configuration tampering. This event is essential for detecting malware establishing autorun persistence, attackers disabling security controls, and unauthorized system configuration modifications.

Channel
Security
Logged by default
No
Written on
Any host
Volume
Moderate
Audit subcategory
Registry
Needs a SACL
Yes

To have this event

  • Enable Registry: auditpol /set /subcategory:"Registry" /success:enable /failure:enable
  • A SACL on the registry key.

Key fields

Exact XML field names, as they appear in <Data Name="…"> and in SIEM field extractions.

SubjectUserNameAccount that modified the registry
SubjectDomainNameDomain of the account
SubjectLogonIdLogon ID for correlation
ObjectNameFull registry key path
ObjectValueNameName of the modified registry value
OperationTypeType of operation (New value written, Existing value modified, Value deleted)
OldValueTypePrevious value type (REG_SZ, REG_DWORD, etc.)
OldValuePrevious registry value data
NewValueTypeNew value type
NewValueNew registry value data
ProcessNameProcess that modified the registry
ProcessIdProcess ID
Have one of these events? Paste it into the decoder

In an investigation

Event 4657 provides detailed visibility into Windows registry modifications, which is critical for detecting various attack techniques. The Windows registry stores system configuration, application settings, and security policies, making it a primary target for attackers establishing persistence and evading defenses. Common malicious registry modifications include adding entries to Run/RunOnce keys for startup persistence, modifying Windows Defender settings to disable real-time protection, changing UAC settings to weaken privilege controls, and altering network configuration for command and control communication. This event captures the registry path modified, the value name, the old and new data, and the process that performed the modification. Security teams should focus monitoring on high-value registry keys related to startup, security software, and privilege controls.

What it can reveal

  • Persistence establishment through modifications to HKLM\Software\Microsoft\Windows\CurrentVersion\Run and similar autorun keys
  • Security control tampering by disabling Windows Defender, UAC, or firewall through registry value changes
  • Privilege escalation through modification of service configurations or elevation policies in registry
  • Credential access by modifying WDigest UseLogonCredential setting to enable plaintext password storage in memory
  • Nearly all malware families modify registry for persistence - Emotet, TrickBot, Qakbot all use Run key modifications

How to detect with it

Enable Event 4657 auditing on critical registry paths including all Run/RunOnce keys, Windows Defender configuration keys, service definitions, and UAC settings. Alert on any modifications to autorun registry keys from non-installer processes. Monitor changes to Windows Defender registry values, particularly DisableRealtimeMonitoring and DisableAntiSpyware. Track WDigest UseLogonCredential modifications which enable credential theft. Correlate Event 4657 with Event 4688 to identify which processes are modifying registry values - legitimate system installers vs suspicious user-mode processes. Alert on registry modifications during off-hours or from unusual user accounts. Monitor service-related registry changes under HKLM\SYSTEM\CurrentControlSet\Services for malicious service creation.

Attack patterns

  • Run-key persistence attack pattern: malware adds a value with a benign-sounding name under HKCU\Software\Microsoft\Windows\CurrentVersion\Run (or the HKLM equivalent) pointing to an executable in AppData; 4657 records it when the key has an auditing SACL
  • WDigest downgrade attack pattern: attackers set HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest\UseLogonCredential to 1 so LSASS keeps plaintext passwords for users who log on afterwards, then dump them from memory
  • Ransomware defense evasion: Before encryption, ransomware modified HKLM\Software\Policies\Microsoft\Windows Defender\Real-Time Protection\DisableRealtimeMonitoring to 1 to disable real-time protection
  • APT privilege escalation: Attackers modified UAC registry key HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA to '0' to disable User Account Control prompts

Compared withEvent 4657 specifically tracks registry value modifications, while Event 7045 (Service Control Manager Event) monitors service installation. Event 4663 provides broader object access auditing. Monitor registry-specific Event 4657 for detailed registry change visibility.

Pull this event

Retrieval queries for a live host, a collected .evtx file and common SIEMs. Filter further on the key fields above.

Get-WinEvent -LogName 'Security' -FilterXPath "*[System[(EventID=4657)]]" -MaxEvents 50 |
  Select-Object TimeCreated, Id, MachineName, Message

-FilterXPath supports exact matches only. For substring matching, filter in Where-Object.

Where it shows up

Investigations, attack signals and lateral movement techniques that rely on this event.

ATT&CK mapping

Techniques this event can help detect. Most of these depend on specific field values; the event alone does not mean the technique happened.

Common questions

What does Windows event ID 4657 mean?
Event 4657 is generated when a registry value is modified, created, or deleted, providing critical visibility into registry changes often used for persistence, privilege escalation, and configuration tampering. This event is essential for detecting malware establishing autorun persistence, attackers disabling security controls, and unauthorized system configuration modifications.
Is event 4657 logged by default?
No. It must be enabled before it is recorded. It is controlled by the "Registry" Advanced Audit Policy subcategory (Object Access). It also requires a SACL on the audited object.
Where is event 4657 recorded?
In the Security channel on the any host.

Event 4657 is generated when a registry value is modified, created, or deleted, providing critical visibility into registry changes often used for persistence, privilege escalation, and configuration tampering.