Latest alertCVE-2018-11776 in Apache Struts Confirmed Exploited in the WildRead
Search all news in the platform

Detection rule

Shadow Copies Deletion Using Operating Systems Utilities

HighTest-data validatedSigmaHQ (community)T1070T1490

Overview

Shadow Copies deletion using operating systems utilities

Rule id
c947b146-0abc-4c87-9c64-b17e9d7274a2
ATT&CK techniques
T1070 Indicator Removal, T1490 Inhibit System Recovery
Severity
High
Confidence
Medium
Origin
SigmaHQ (community)
SigmaHQ status
stable
Used in defense packs
n0n, The Gentlemen, qilin, Akira, safepay, Play, everest, nightspire, majinahanashi

Validation

  1. ExperimentalSyntax checked only. Not yet tested on events.
  2. Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
  3. SIEM-validatedRun in a real SIEM, with a recorded result.

4 of 4 positive test events matched; 2 of 2 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.

Detection logic and queries

Queries are shown exactly as generated. Test them in your environment before you deploy them.

Sigma

Sigma (YAML) · c947b146-0abc-4c87-9c64-b17e9d7274a2

Download
title: Shadow Copies Deletion Using Operating Systems Utilities
id: c947b146-0abc-4c87-9c64-b17e9d7274a2
status: stable
description: Shadow Copies deletion using operating systems utilities
references:
    - https://www.slideshare.net/heirhabarov/hunting-for-credentials-dumping-in-windows-environment
    - https://blog.talosintelligence.com/2017/05/wannacry.html
    - https://securingtomorrow.mcafee.com/other-blogs/mcafee-labs/new-teslacrypt-ransomware-arrives-via-spam/
    - https://www.bleepingcomputer.com/news/security/why-everyone-should-disable-vssadmin-exe-now/
    - https://www.hybrid-analysis.com/sample/ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa?environmentId=100
    - https://github.com/Neo23x0/Raccine#the-process
    - https://github.com/Neo23x0/Raccine/blob/20a569fa21625086433dcce8bb2765d0ea08dcb6/yara/gen_ransomware_command_lines.yar
    - https://redcanary.com/blog/intelligence-insights-october-2021/
    - https://symantec-enterprise-blogs.security.com/blogs/threat-intelligence/blackbyte-exbyte-ransomware
author: Florian Roth (Nextron Systems), Michael Haag, Teymur Kheirkhabarov, Daniil Yugoslavskiy, oscd.community, Andreas Hunkeler (@Karneades)
date: 2019-10-22
modified: 2022-11-03
tags:
    - attack.impact
    - attack.stealth
    - attack.t1070
    - attack.t1490
logsource:
    category: process_creation
    product: windows
detection:
    selection1_img:
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
              - '\wmic.exe'
              - '\vssadmin.exe'
              - '\diskshadow.exe'
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
              - 'wmic.exe'
              - 'VSSADMIN.EXE'
              - 'diskshadow.exe'
    selection1_cli:
        CommandLine|contains|all:
            - 'shadow'  # will match "delete shadows" and "shadowcopy delete" and "shadowstorage"
            - 'delete'
    selection2_img:
        - Image|endswith: '\wbadmin.exe'
        - OriginalFileName: 'WBADMIN.EXE'
    selection2_cli:
        CommandLine|contains|all:
            - 'delete'
            - 'catalog'
            - 'quiet' # will match -quiet or /quiet
    selection3_img:
        - Image|endswith: '\vssadmin.exe'
        - OriginalFileName: 'VSSADMIN.EXE'
    selection3_cli:
        CommandLine|contains|all:
            - 'resize'
            - 'shadowstorage'
        CommandLine|contains:
            - 'unbounded'
            - '/MaxSize='
    condition: (all of selection1*) or (all of selection2*) or (all of selection3*)
falsepositives:
    - Legitimate Administrator deletes Shadow Copies using operating systems utilities for legitimate reason
    - LANDesk LDClient Ivanti-PSModule (PS EncodedCommand)
level: high

QRadar AQL

IBM QRadar AQL (hunting query)Hunting query

Hunting search for the Log Activity tab or the API. It is not a QRadar rule.

AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).

SELECT * FROM events WHERE 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=%'))))

QRadar CRE

Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.

Rule name
OffSet7: Shadow Copies Deletion Using Operating Systems Utilities
Rule type
Event rule (Local)
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.
    • Process Path / Process Name ends with: \powershell.exe, \pwsh.exe, \wmic.exe, \vssadmin.exe, \diskshadow.exe
    • 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).
    • 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.
    • Process Path / Process Name ends with: \wbadmin.exe
    • 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).
    • 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.
    • Process Path / Process Name ends with: \vssadmin.exe
    • 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).
    • Command contains: resize, shadowstorage
    • 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.

Splunk

Splunk SPLSearch

Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.

((Image IN ("*\\powershell.exe", "*\\pwsh.exe", "*\\wmic.exe", "*\\vssadmin.exe", "*\\diskshadow.exe") OR OriginalFileName IN ("PowerShell.EXE", "pwsh.dll", "wmic.exe", "VSSADMIN.EXE", "diskshadow.exe")) CommandLine="*shadow*" CommandLine="*delete*") OR ((Image="*\\wbadmin.exe" OR OriginalFileName="WBADMIN.EXE") CommandLine="*delete*" CommandLine="*catalog*" CommandLine="*quiet*") OR ((Image="*\\vssadmin.exe" OR OriginalFileName="VSSADMIN.EXE") CommandLine="*resize*" CommandLine="*shadowstorage*" (CommandLine IN ("*unbounded*", "*/MaxSize=*")))

Splunk savedsearches.conf stanzaScheduled search template

Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.

[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now

[Shadow Copies Deletion Using Operating Systems Utilities]
description = Shadow Copies deletion using operating systems utilities
search = ((Image IN ("*\\powershell.exe", "*\\pwsh.exe", "*\\wmic.exe", "*\\vssadmin.exe", "*\\diskshadow.exe") OR OriginalFileName IN ("PowerShell.EXE", "pwsh.dll", "wmic.exe", "VSSADMIN.EXE", "diskshadow.exe")) CommandLine="*shadow*" CommandLine="*delete*") OR ((Image="*\\wbadmin.exe" OR OriginalFileName="WBADMIN.EXE") CommandLine="*delete*" CommandLine="*catalog*" CommandLine="*quiet*") OR ((Image="*\\vssadmin.exe" OR OriginalFileName="VSSADMIN.EXE") CommandLine="*resize*" CommandLine="*shadowstorage*" (CommandLine IN ("*unbounded*", "*/MaxSize=*")))

Microsoft Sentinel

Microsoft Sentinel KQL (ASIM)Hunting query

Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.

imProcessCreate
| where (((TargetProcessName endswith "\\powershell.exe" or TargetProcessName endswith "\\pwsh.exe" or TargetProcessName endswith "\\wmic.exe" or TargetProcessName endswith "\\vssadmin.exe" or TargetProcessName endswith "\\diskshadow.exe") or (TargetProcessFileOriginalName in~ ("PowerShell.EXE", "pwsh.dll", "wmic.exe", "VSSADMIN.EXE", "diskshadow.exe"))) and (TargetProcessCommandLine contains "shadow" and TargetProcessCommandLine contains "delete")) or ((TargetProcessName endswith "\\wbadmin.exe" or TargetProcessFileOriginalName =~ "WBADMIN.EXE") and (TargetProcessCommandLine contains "delete" and TargetProcessCommandLine contains "catalog" and TargetProcessCommandLine contains "quiet")) or ((TargetProcessName endswith "\\vssadmin.exe" or TargetProcessFileOriginalName =~ "VSSADMIN.EXE") and ((TargetProcessCommandLine contains "resize" and TargetProcessCommandLine contains "shadowstorage") and (TargetProcessCommandLine contains "unbounded" or TargetProcessCommandLine contains "/MaxSize=")))

Defender XDR

Microsoft Defender XDR KQLHunting query

Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.

DeviceProcessEvents
| where (((FolderPath endswith "\\powershell.exe" or FolderPath endswith "\\pwsh.exe" or FolderPath endswith "\\wmic.exe" or FolderPath endswith "\\vssadmin.exe" or FolderPath endswith "\\diskshadow.exe") or (ProcessVersionInfoOriginalFileName in~ ("PowerShell.EXE", "pwsh.dll", "wmic.exe", "VSSADMIN.EXE", "diskshadow.exe"))) and (ProcessCommandLine contains "shadow" and ProcessCommandLine contains "delete")) or ((FolderPath endswith "\\wbadmin.exe" or ProcessVersionInfoOriginalFileName =~ "WBADMIN.EXE") and (ProcessCommandLine contains "delete" and ProcessCommandLine contains "catalog" and ProcessCommandLine contains "quiet")) or ((FolderPath endswith "\\vssadmin.exe" or ProcessVersionInfoOriginalFileName =~ "VSSADMIN.EXE") and ((ProcessCommandLine contains "resize" and ProcessCommandLine contains "shadowstorage") and (ProcessCommandLine contains "unbounded" or ProcessCommandLine contains "/MaxSize=")))

Elastic

Elastic Lucene (ECS)Hunting query

Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.

(((process.executable:(*\\powershell.exe OR *\\pwsh.exe OR *\\wmic.exe OR *\\vssadmin.exe OR *\\diskshadow.exe)) OR (process.pe.original_file_name:(PowerShell.EXE OR pwsh.dll OR wmic.exe OR VSSADMIN.EXE OR diskshadow.exe))) AND (process.command_line:*shadow* AND process.command_line:*delete*)) OR ((process.executable:*\\wbadmin.exe OR process.pe.original_file_name:WBADMIN.EXE) AND (process.command_line:*delete* AND process.command_line:*catalog* AND process.command_line:*quiet*)) OR ((process.executable:*\\vssadmin.exe OR process.pe.original_file_name:VSSADMIN.EXE) AND ((process.command_line:*resize* AND process.command_line:*shadowstorage*) AND (process.command_line:(*unbounded* OR *\/MaxSize\=*))))

Elastic EQL (ECS)Hunting query

EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.

any where (((process.executable like~ ("*\\powershell.exe", "*\\pwsh.exe", "*\\wmic.exe", "*\\vssadmin.exe", "*\\diskshadow.exe")) or (process.pe.original_file_name like~ ("PowerShell.EXE", "pwsh.dll", "wmic.exe", "VSSADMIN.EXE", "diskshadow.exe"))) and (process.command_line:"*shadow*" and process.command_line:"*delete*")) or ((process.executable:"*\\wbadmin.exe" or process.pe.original_file_name:"WBADMIN.EXE") and (process.command_line:"*delete*" and process.command_line:"*catalog*" and process.command_line:"*quiet*")) or ((process.executable:"*\\vssadmin.exe" or process.pe.original_file_name:"VSSADMIN.EXE") and ((process.command_line:"*resize*" and process.command_line:"*shadowstorage*") and (process.command_line like~ ("*unbounded*", "*/MaxSize=*"))))

Elastic ES|QL (ECS)Hunting query

ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.

from * metadata _id, _index, _version | where (ends_with(process.executable, "\\powershell.exe") or ends_with(process.executable, "\\pwsh.exe") or ends_with(process.executable, "\\wmic.exe") or ends_with(process.executable, "\\vssadmin.exe") or ends_with(process.executable, "\\diskshadow.exe") or process.pe.original_file_name in ("PowerShell.EXE", "pwsh.dll", "wmic.exe", "VSSADMIN.EXE", "diskshadow.exe")) and process.command_line like "*shadow*" and process.command_line like "*delete*" or (ends_with(process.executable, "\\wbadmin.exe") or process.pe.original_file_name=="WBADMIN.EXE") and process.command_line like "*delete*" and process.command_line like "*catalog*" and process.command_line like "*quiet*" or (ends_with(process.executable, "\\vssadmin.exe") or process.pe.original_file_name=="VSSADMIN.EXE") and process.command_line like "*resize*" and process.command_line like "*shadowstorage*" and (process.command_line like "*unbounded*" or process.command_line like "*/MaxSize=*")

Required telemetry

Log source
product: windows · category: process_creation
Fields used
CommandLine Image OriginalFileName

False positives

  • Legitimate Administrator deletes Shadow Copies using operating systems utilities for legitimate reason
  • LANDesk LDClient Ivanti-PSModule (PS EncodedCommand)

Investigation and response

No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.

References

Author and attribution

Author
Florian Roth (Nextron Systems), Michael Haag, Teymur Kheirkhabarov, Daniil Yugoslavskiy, oscd.community, Andreas Hunkeler (@Karneades)
Source
SigmaHQ · rules/windows/process_creation/proc_creation_win_susp_shadow_copies_deletion.yml
Upstream commit
9688134317a2
Licence
Detection Rule License (DRL) 1.1

Version history

  1. Version 1Imported from SigmaHQ
  2. OffSet7 build · SigmaHQ 9688134317a2

Related rules