Detection rules › Sigma

Deletion of Volume Shadow Copies via WMI with PowerShell - PS Script

Status
test
Severity
high
Log source
product windows, category ps_script
Author
Tim Rauch, frack113
Source
github.com/SigmaHQ/sigma

Detects deletion of Windows Volume Shadow Copies with PowerShell code and Get-WMIObject. This technique is used by numerous ransomware families such as Sodinokibi/REvil

MITRE ATT&CK coverage

TacticTechniques
ImpactT1490 Inhibit System Recovery

Event coverage

Rule body yaml

title: Deletion of Volume Shadow Copies via WMI with PowerShell - PS Script
id: c1337eb8-921a-4b59-855b-4ba188ddcc42
related:
    - id: e17121b4-ef2a-4418-8a59-12fb1631fa9e
      type: derived
    - id: 21ff4ca9-f13a-41ad-b828-0077b2af2e40
      type: similar
status: test
description: Detects deletion of Windows Volume Shadow Copies with PowerShell code and Get-WMIObject. This technique is used by numerous ransomware families such as Sodinokibi/REvil
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1490/T1490.md#atomic-test-5---windows---delete-volume-shadow-copies-via-wmi-with-powershell
    - https://www.elastic.co/guide/en/security/current/volume-shadow-copy-deletion-via-powershell.html
author: Tim Rauch, frack113
date: 2022-09-20
modified: 2022-12-02
tags:
    - attack.impact
    - attack.t1490
logsource:
    category: ps_script
    product: windows
detection:
    selection_get:
        ScriptBlockText|contains:
            - 'Get-WmiObject'
            - 'gwmi'
            - 'Get-CimInstance'
            - 'gcim'
    selection_shadowcopy:
        ScriptBlockText|contains: 'Win32_ShadowCopy'
    selection_delete:
        ScriptBlockText|contains:
            - '.Delete()'
            - 'Remove-WmiObject'
            - 'rwmi'
            - 'Remove-CimInstance'
            - 'rcim'
    condition: all of selection*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection*

Stage 1: selection_get

selection_get:
    ScriptBlockText|contains:
        - 'Get-WmiObject'
        - 'gwmi'
        - 'Get-CimInstance'
        - 'gcim'

Stage 2: selection_shadowcopy

selection_shadowcopy:
    ScriptBlockText|contains: 'Win32_ShadowCopy'

Stage 3: selection_delete

selection_delete:
    ScriptBlockText|contains:
        - '.Delete()'
        - 'Remove-WmiObject'
        - 'rwmi'
        - 'Remove-CimInstance'
        - 'rcim'

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
  • .Delete()
  • Get-CimInstance corpus 2 (sigma 1, splunk 1)
  • Get-WmiObject corpus 7 (splunk 5, sigma 2)
  • Remove-CimInstance corpus 2 (sigma 2)
  • Remove-WmiObject corpus 2 (sigma 2)
  • Win32_ShadowCopy corpus 2 (sigma 2)
  • gcim
  • gwmi corpus 2 (sigma 2)
  • rcim corpus 2 (sigma 2)
  • rwmi corpus 2 (sigma 2)