# OffSet7: Shadow Copies Deletion Using Operating Systems Utilities

> 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:Shadow Copies Deletion Using Operating Systems U:selection1_img (match)
Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.
- when **Process Path / Process Name** ends with: `\powershell.exe`, `\pwsh.exe`, `\wmic.exe`, `\vssadmin.exe`, `\diskshadow.exe`
- when **Filename** is equal to (case-insensitive): `PowerShell.EXE`, `pwsh.dll`, `wmic.exe`, `VSSADMIN.EXE`, `diskshadow.exe`

### BB:OffSet7:Shadow Copies Deletion Using Operating Systems U:selection1_cli (match)
All test lines must match (AND).
- when **Command** contains: `shadow`, `delete`

### BB:OffSet7:Shadow Copies Deletion Using Operating Systems U:selection2_img (match)
Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.
- when **Process Path / Process Name** ends with: `\wbadmin.exe`
- when **Filename** is equal to (case-insensitive): `WBADMIN.EXE`

### BB:OffSet7:Shadow Copies Deletion Using Operating Systems U:selection2_cli (match)
All test lines must match (AND).
- when **Command** contains: `delete`, `catalog`, `quiet`

### BB:OffSet7:Shadow Copies Deletion Using Operating Systems U:selection3_img (match)
Any of the groups matches (OR): build one BB per group and a parent BB "when an event matches any of" them.
- when **Process Path / Process Name** ends with: `\vssadmin.exe`
- when **Filename** is equal to (case-insensitive): `VSSADMIN.EXE`

### BB:OffSet7:Shadow Copies Deletion Using Operating Systems U:selection3_cli (match)
All test lines must match (AND).
- when **Command** contains: `resize`, `shadowstorage`
- when **Command** contains: `unbounded`, `/MaxSize=`

## 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 []) OR ((ALL of []) OR ((ALL of [])`

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

1. when the event matches this AQL filter query: `devicetype=12 AND (((((LOWER("Process Path") LIKE '%\powershell.exe' OR LOWER("Process Path") LIKE '%\pwsh.exe' OR LOWER("Process Path") LIKE '%\wmic.exe' OR LOWER("Process Path") LIKE '%\vssadmin.exe' OR LOWER("Process Path") LIKE '%\diskshadow.exe') OR (LOWER("Process Name") LIKE '%\powershell.exe' OR LOWER("Process Name") LIKE '%\pwsh.exe' OR LOWER("Process Name") LIKE '%\wmic.exe' OR LOWER("Process Name") LIKE '%\vssadmin.exe' OR LOWER("Process Name") LIKE '%\diskshadow.exe')) OR (Filename IN('PowerShell.EXE', 'pwsh.dll', 'wmic.exe', 'VSSADMIN.EXE', 'diskshadow.exe'))) AND (LOWER(Command) LIKE '%shadow%' AND LOWER(Command) LIKE '%delete%')) OR (((LOWER("Process Path") LIKE '%\wbadmin.exe' OR LOWER("Process Name") LIKE '%\wbadmin.exe') OR Filename='WBADMIN.EXE') AND (LOWER(Command) LIKE '%delete%' AND LOWER(Command) LIKE '%catalog%' AND LOWER(Command) LIKE '%quiet%')) OR (((LOWER("Process Path") LIKE '%\vssadmin.exe' OR LOWER("Process Name") LIKE '%\vssadmin.exe') OR Filename='VSSADMIN.EXE') AND ((LOWER(Command) LIKE '%resize%' AND LOWER(Command) LIKE '%shadowstorage%') AND (LOWER(Command) LIKE '%unbounded%' OR LOWER(Command) LIKE '%/maxsize=%'))))`

## Rule response

- Severity 7, credibility 8, 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: Shadow Copies Deletion Using Operating Systems Utilities (c947b146-0abc-4c87-9c64-b17e9d7274a2). Author: Florian Roth (Nextron Systems), Michael Haag, Teymur Kheirkhabarov, Daniil Yugoslavskiy, oscd.community, Andreas Hunkeler (@Karneades). Licence: DRL-1.1.
