Detection rules › Sigma

Tamper Windows Defender Remove-MpPreference - ScriptBlockLogging

Status
test
Severity
high
Log source
product windows, category ps_script
Author
Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects attempts to remove Windows Defender configuration using the 'MpPreference' cmdlet

MITRE ATT&CK coverage

TacticTechniques
Defense ImpairmentT1685 Disable or Modify Tools

Event coverage

Rule body yaml

title: Tamper Windows Defender Remove-MpPreference - ScriptBlockLogging
id: ae2bdd58-0681-48ac-be7f-58ab4e593458
related:
    - id: 07e3cb2c-0608-410d-be4b-1511cb1a0448
      type: similar
status: test
description: Detects attempts to remove Windows Defender configuration using the 'MpPreference' cmdlet
references:
    - https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/windows-10-controlled-folder-access-event-search/ba-p/2326088
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-08-05
tags:
    - attack.defense-impairment
    - attack.t1685
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection_remove:
        ScriptBlockText|contains: 'Remove-MpPreference'
    selection_tamper:
        ScriptBlockText|contains:
            - '-ControlledFolderAccessProtectedFolders '
            - '-AttackSurfaceReductionRules_Ids '
            - '-AttackSurfaceReductionRules_Actions '
            - '-CheckForSignaturesBeforeRunningScan '
    condition: all of selection_*
falsepositives:
    - Legitimate PowerShell scripts
level: high

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_remove

selection_remove:
    ScriptBlockText|contains: 'Remove-MpPreference'

Stage 2: selection_tamper

selection_tamper:
    ScriptBlockText|contains:
        - '-ControlledFolderAccessProtectedFolders '
        - '-AttackSurfaceReductionRules_Ids '
        - '-AttackSurfaceReductionRules_Actions '
        - '-CheckForSignaturesBeforeRunningScan '

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
ScriptBlockTextmatch
  • -AttackSurfaceReductionRules_Actions
  • -AttackSurfaceReductionRules_Ids
  • -CheckForSignaturesBeforeRunningScan
  • -ControlledFolderAccessProtectedFolders
  • Remove-MpPreference