LoFP LoFP / false positives are expected from legitimate applications generating events that are similar to those generated by malicious activity. for example, event id 5007 is generated when a process attempts to modify a registry key that is related to asr rules. this can be triggered by legitimate applications that attempt to modify registry keys that are not blocked by asr rules.

Techniques

Sample rules

Windows Defender ASR Registry Modification

Description

The following analytic detects modifications to Windows Defender Attack Surface Reduction (ASR) registry settings. It leverages Windows Defender Operational logs, specifically EventCode 5007, to identify changes in ASR rules. This activity is significant because ASR rules are designed to block actions commonly used by malware to exploit systems. Unauthorized modifications to these settings could indicate an attempt to weaken system defenses. If confirmed malicious, this could allow an attacker to bypass security measures, leading to potential system compromise and data breaches.

Detection logic

`ms_defender` EventCode IN (5007) 
| rex field=New_Value "0x(?<New_Registry_Value>\\d+)$" 
| rex field=Old_Value "0x(?<Old_Registry_Value>\\d+)$" 
| rex field=New_Value "Rules\\\\(?<ASR_ID>[A-Fa-f0-9\\-]+)\\s*=" 
| eval New_Registry_Value=case(New_Registry_Value=="0", "Disabled", New_Registry_Value=="1", "Block", New_Registry_Value=="2", "Audit", New_Registry_Value=="6", "Warn") 
| eval Old_Registry_Value=case(Old_Registry_Value=="0", "Disabled", Old_Registry_Value=="1", "Block", Old_Registry_Value=="2", "Audit", Old_Registry_Value=="6", "Warn") 
| stats count min(_time) as firstTime max(_time) as lastTime by host, New_Value, Old_Value, Old_Registry_Value, New_Registry_Value, ASR_ID 
| lookup local=t asr_rules ID AS ASR_ID OUTPUT ASR_Rule 
| `security_content_ctime(firstTime)`
| rename host as dest 
| `security_content_ctime(lastTime)` 
| `windows_defender_asr_registry_modification_filter`