# OffSet7: Deletion of Volume Shadow Copies via WMI with PowerShell

> Design for the QRadar Rule Wizard. Not an importable rule and not tested in QRadar.

- Rule type: Event rule (Local), create disabled
- Log source types: Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1

## Building blocks

### BB:OffSet7:Deletion of Volume Shadow Copies via WMI with Po:selection_get (match)
All test lines must match (AND).
- when **Command** contains: `Get-WmiObject`, `gwmi`, `Get-CimInstance`, `gcim`

### BB:OffSet7:Deletion of Volume Shadow Copies via WMI with Po:selection_shadowcopy (match)
All test lines must match (AND).
- when **Command** contains: `Win32_ShadowCopy`

### BB:OffSet7:Deletion of Volume Shadow Copies via WMI with Po:selection_delete (match)
All test lines must match (AND).
- when **Command** contains: `.Delete()`, `Remove-WmiObject`, `rwmi`, `Remove-CimInstance`, `rcim`

## Main rule — option A (building blocks)

1. when the event(s) were detected by one or more of these log source types: `Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1`
2. when an event matches the condition built from these building blocks: `(ALL of [BB:OffSet7:Deletion of Volume Shadow Copies via WMI with Po:selection_get, BB:OffSet7:Deletion of Volume Shadow Copies via WMI with Po:selection_shadowcopy, BB:OffSet7:Deletion of Volume Shadow Copies via WMI with Po:selection_delete])`

## Main rule — option B (AQL filter test)

1. when the event matches this AQL filter query: `devicetype=12 AND (LOWER(Command) LIKE '%get-wmiobject%' OR LOWER(Command) LIKE '%gwmi%' OR LOWER(Command) LIKE '%get-ciminstance%' OR LOWER(Command) LIKE '%gcim%') AND LOWER(Command) LIKE '%win32_shadowcopy%' AND (LOWER(Command) LIKE '%.delete()%' OR LOWER(Command) LIKE '%remove-wmiobject%' OR LOWER(Command) LIKE '%rwmi%' OR LOWER(Command) LIKE '%remove-ciminstance%' OR LOWER(Command) LIKE '%rcim%')`

## Rule response

- Severity 7, credibility 6, relevance 7
- Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
- Respond no more than once per 30 minutes per Log Source (tune per environment)

## Limitations

- QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.

Source rule: Deletion of Volume Shadow Copies via WMI with PowerShell (21ff4ca9-f13a-41ad-b828-0077b2af2e40). Author: Tim Rauch, Elastic (idea). Licence: DRL-1.1.
