Event ID 4657 — A registry value was modified.
Description
A registry value was modified.
Message #
Fields #
| Name | Description |
|---|---|
SubjectUserSid SID | [Subject] Security ID. |
SubjectUserName UnicodeString | [Subject] Account Name. |
SubjectDomainName UnicodeString | [Subject] Account Domain. |
SubjectLogonId HexInt64 | [Subject] Logon ID. |
ObjectName UnicodeString | [Object] Object Name. |
ObjectValueName UnicodeString | [Object] Object Value Name. |
HandleId Pointer | [Object] Handle ID. |
OperationType UnicodeString | [Object] Operation Type. Known values
|
OldValueType UnicodeString | [Change Information] Old Value Type. Known values
|
OldValue UnicodeString | [Change Information] Old Value. |
NewValueType UnicodeString | [Change Information] New Value Type. Known values
|
NewValue UnicodeString | [Change Information] New Value. |
ProcessId Pointer | [Process Information] Process ID. |
ProcessName UnicodeString | [Process Information] Process Name. |
Example Event #
{
"system": {
"provider": "Microsoft-Windows-Security-Auditing",
"guid": "54849625-5478-4994-A5BA-3E3B0328C30D",
"event_source_name": "",
"event_id": 4657,
"version": 0,
"level": 0,
"task": 12801,
"opcode": 0,
"keywords": 9232379236109516800,
"time_created": "2023-11-06T01:45:45.086232+00:00",
"event_record_id": 292511,
"correlation": {},
"execution": {
"process_id": 4,
"thread_id": 12116
},
"channel": "Security",
"computer": "WinDev2310Eval",
"security": {
"user_id": ""
}
},
"event_data": {
"SubjectUserSid": "S-1-5-18",
"SubjectUserName": "WINDEV2310EVAL$",
"SubjectDomainName": "WORKGROUP",
"SubjectLogonId": "0x3e7",
"ObjectName": "\\REGISTRY\\MACHINE\\SOFTWARE\\Microsoft\\SystemCertificates\\ROOT\\Certificates\\B51C067CEE2B0C3DF855AB2D92F4FE39D4E70F0E",
"ObjectValueName": "Blob",
"HandleId": "0x1994",
"OperationType": "%%1905",
"OldValueType": "%%1875",
"OldValue": "%%1800",
"NewValueType": "%%1875",
"NewValue": "%%1800",
"ProcessId": "0x328",
"ProcessName": "C:\\Windows\\System32\\lsass.exe"
},
"message": ""
}
Detection Patterns #
Uac Bypass
Defender-DeviceRegistryEvents Event ID 9005000: Registry activity→Event ID 9005002: Registry key deleted→Event ID 9005003: Registry value set→Event ID 9005004: Registry value deleted→Security-Auditing Event ID 4657: A registry value was modified.→Event ID 4660: An object was deleted.→Event ID 4663: An attempt was made to access an object.→Sysmon Event ID 12: RegistryEvent→Event ID 13: RegistryEvent→Event ID 14: RegistryEvent
5 rules
Kusto Query Language
Privilege Escalation: Bypass User Account Control
Security-Auditing Event ID 4657: A registry value was modified.→Event ID 4688: A new process has been created.
1 rule
Kusto Query Language
Defense Evasion: Modify Registry
Security-Auditing Event ID 4657: A registry value was modified.OREvent ID 4663: An attempt was made to access an object.
1 rule
Defense Evasion: Impair Defenses
Defender-DeviceRegistryEvents Event ID 9005003: Registry value setORSecurity-Auditing Event ID 4657: A registry value was modified.ORSysmon Event ID 13: RegistryEvent
1 rule
Kusto Query Language
Community Notes #
Requires AuditRegistry/SetValue SACL.
Detection Rules #
View all rules referencing this event →
Sigma # view in reference
- ETW Logging Disabled In .NET Processes - Registry source high: Potential adversaries stopping ETW providers recording loaded .NET assemblies.
- NetNTLM Downgrade Attack source high: Detects NetNTLM downgrade attack
- Windows Defender Exclusion List Modified source medium: Detects modifications to the Windows Defender exclusion registry key. This could indicate a potentially suspicious or even malicious activity by an attacker trying to add a new exclusion in order to bypass security.
Kusto Query Language # view in reference
- Scheduled Task Hide source high: 'This query detects attempts by malware to hide the scheduled task by deleting the SD (Security Descriptor) value. Removal of SD value results in the scheduled task disappearing from schtasks /query and Task Scheduler. The query requires auditing to be turned on for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree registry hive as well as audit policy for registry auditing to be turned on. Reference: https://www.microsoft.com/security/blog/2022/04/12/tarrask-malware-uses-scheduled-tasks-for-defense-evasion/ Reference: https://4sysops.com/archives/audit-changes-in-the-windows-registry/'
References #
- Microsoft Learn https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4657
- Microsoft Learn Audit Policy https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/audit-registry
- Ultimate Windows Security https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=4657
- Example event sourced from https://github.com/NextronSystems/evtx-baseline