Lesson 5 of 5 · 30 min read

Worked Example: Redesigning a Noisy wmic shadowcopy Rule

This lesson walks through a complete detection redesign: from an existing noisy rule to a precision-improved, higher-robustness alternative. We apply the precision/recall/robustness framework from Lesson 1, the robustness design principles from Lesson 2, the evasion awareness from Lesson 3, and the alert context requirements from Lesson 4.


Step 1: Understand the Technique

ATT&CK T1490 — Inhibit System Recovery

Volume Shadow Copies (VSS) are Windows’s built-in point-in-time backup mechanism. Ransomware deletes them to prevent file recovery without paying the ransom. The canonical commands:

# vssadmin variant:
vssadmin.exe delete shadows /all /quiet

# wmic variant:
wmic.exe shadowcopy delete

# PowerShell variant:
Get-WmiObject Win32_ShadowCopy | Remove-WmiObject

# Direct WMI API (no external binary):
$shadow = [wmiclass]"Win32_ShadowCopy"
$shadow.Delete()

All four accomplish the same goal. A rule that only covers one misses three.


Step 2: Score the Original Rule

detection:
  selection:
    Image|endswith: '\wmic.exe'
    CommandLine|contains: 'shadowcopy'
  condition: selection

Precision analysis:

What legitimate tools use wmic.exe ... shadowcopy?

The word “shadowcopy” alone triggers on all VSS read operations, not just deletions. Precision: Low.

Recall analysis:

Misses:

Recall: Low (covers 1 of 4+ common attack variants)

Robustness analysis:

Evaded by: using any tool other than wmic.exe for the same operation. Robustness: L1 (tool-specific, same implementation, single binary)

Alert context:

CommandLine is present (the keyword that triggered). No parent process, no user context, no asset tier. Alert context: Poor.


Step 3: Define the Target State

Before redesigning, define what “good” looks like:

DimensionTarget
Precision> 90% — fire only when actual deletion occurs
RecallCover all 4+ common T1490 attack variants
RobustnessL3 — fire on any VSS deletion regardless of tool
Alert contextInclude: user, host tier, parent process, full CommandLine

Step 4: Redesign the Detection

Layer 1: Precise wmic detection (fix precision first)

The original rule fires on any VSS query. Add the delete keyword to require deletion:

detection:
  selection_wmic:
    Image|endswith: '\wmic.exe'
    CommandLine|contains:
      - 'shadowcopy delete'
      - 'delete shadows'    # catches alternate syntax
  condition: selection_wmic

Precision improvement: Now only fires on deletion commands, not VSS queries.

Layer 2: Add vssadmin coverage (fix recall)

  selection_vssadmin:
    Image|endswith: '\vssadmin.exe'
    CommandLine|contains:
      - 'delete shadows'
      - 'resize shadowstorage'   # setting to low/0 also prevents new snapshots

Layer 3: Add PowerShell WMI coverage (fix recall further)

  selection_ps:
    Image|endswith:
      - '\powershell.exe'
      - '\pwsh.exe'
    CommandLine|contains:
      - 'Win32_ShadowCopy'
      - 'Remove-WmiObject'
      - 'Win32_Volume'

Note: Script Block Logging (Event 4104) is a better source for PowerShell detection — the command line may be obfuscated.

Layer 4: L3 — Win32_ShadowCopy deletion via WMI (any tool)

Sysmon Event 20 (WMI Activity — Operation) fires when a WMI query or method is executed. We can detect the WMI method call regardless of what process invoked it:

logsource:
  product: windows
  category: wmi_event

detection:
  selection_wmi:
    EventType: 'Operation'
    OperationName|contains: 'Win32_ShadowCopy'

This fires for direct WMI API calls from C# malware, PowerShell, or wmic.exe — any WMI consumer.

Final Combined Rule

title: Inhibit System Recovery — Shadow Copy Deletion (T1490)
id: 7f5d3c4a-1e2b-4f8a-9d6c-5a3b7e8f2d1c
status: test
description: >
  Detects deletion of Volume Shadow Copies via multiple mechanisms. VSS deletion
  is a common ransomware pre-encryption step. Covers wmic, vssadmin, PowerShell,
  and direct WMI invocation.
references:
  - https://attack.mitre.org/techniques/T1490/
author: TDL Detection Team
date: 2026/05/20
tags:
  - attack.impact
  - attack.t1490
  - attack.defense_evasion
  - attack.t1047
logsource:
  product: windows
  category: process_creation
detection:
  selection_wmic:
    Image|endswith: '\wmic.exe'
    CommandLine|contains:
      - 'shadowcopy delete'
      - 'delete shadows'

  selection_vssadmin:
    Image|endswith: '\vssadmin.exe'
    CommandLine|contains:
      - 'delete shadows'
      - 'resize shadowstorage'

  selection_ps:
    Image|endswith:
      - '\powershell.exe'
      - '\pwsh.exe'
    CommandLine|contains|all:
      - 'Win32_ShadowCopy'
      - 'Delete'

  selection_wbadmin:
    Image|endswith: '\wbadmin.exe'
    CommandLine|contains: 'delete catalog'

  condition: 1 of selection_*

falsepositives:
  - Legitimate backup software deletion of old snapshots (rare — filter by parent process)
  - IT disaster recovery testing (coordinate with infra team on test windows)

level: high

fields:
  - Image
  - CommandLine
  - ParentImage
  - ParentCommandLine
  - User
  - ComputerName

Step 5: Score the Redesigned Rule

DimensionOriginalRedesignedDelta
PrecisionLowHighImproved — delete keyword required, no VSS read-only matches
RecallLow (1 variant)Medium-High (4 variants)Improved — covers wmic/vssadmin/PowerShell/wbadmin
RobustnessL1L2-L3Improved — multiple tools covered; WMI layer in separate rule
Alert contextPoorGoodfields section covers all triage-relevant data

Remaining gaps (blind spots):

Document these in the ADS blind spots section and create separate rules for each.


Step 6: Deploy and Baseline

Before pushing to production:

  1. Run the rule against 30 days of historical logs — count fires per day
  2. Sample 20 alerts — classify as TP or FP
  3. Calculate precision: TP / (TP + FP)
  4. If precision < 80%, identify the FP sources and add targeted exclusions
  5. Run the true-positive test: wmic shadowcopy delete in a test VM, verify alert fires
  6. Run false-positive test: wmic shadowcopy list brief in a test VM, verify no alert
T1490: Inhibit System Recovery— MITRE ATT&CK SigmaHQ: VSSAdmin Delete Shadows— SigmaHQ GitHub