Powershell WMI Persistence

 Original Source: [Sigma source]
Title: Powershell WMI Persistence
Status: test
Description:Adversaries may establish persistence and elevate privileges by executing malicious content triggered by a Windows Management Instrumentation (WMI) event subscription.
References:
  -https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1546.003/T1546.003.md
  -https://github.com/EmpireProject/Empire/blob/08cbd274bef78243d7a8ed6443b8364acd1fc48b/data/module_source/persistence/Persistence.psm1#L545
Author: frack113
Date: 2021-08-19
modified:2022-12-25
Tags:
  • -'attack.persistence'
  • -'attack.privilege-escalation'
  • -'attack.t1546.003'
Logsource:
  • product: windows
  • category: ps_script
  • definition: Requirements: Script Block Logging must be enabled
Detection:
  selection_ioc:
    - ScriptBlockText|contains|all:
      - 'New-CimInstance '
      - '-Namespace root/subscription '
      - '-ClassName __EventFilter '
      - '-Property '
    - ScriptBlockText|contains|all:
      - 'New-CimInstance '
      - '-Namespace root/subscription '
      - '-ClassName CommandLineEventConsumer '
      - '-Property '
  condition:selection_ioc
Falsepositives:
  -Unknown
Level: medium