Detection rules › Sigma

PowerShell Deleted Mounted Share

Severity
medium
Author
oscd.community, @redcanary, Zach Stanford @svch0st
Source
upstream

Detects when when a mounted share is removed. Adversaries may remove share connections that are no longer useful in order to clean up traces of their operation

MITRE ATT&CK coverage

TacticTechniques
Defense EvasionT1070.005 Indicator Removal: Network Share Connection Removal

Event coverage

ProviderEvent IDTitle
PowerShell4104Creating Scriptblock text (MessageNumber of MessageTotal).

Stages and Predicates

Stage 1: selection

or:
ScriptBlockText|contains: Remove-FileShare
ScriptBlockText|contains: Remove-SmbShare

Stage 2: not 1 of filter_main_module_load

ScriptBlockText|contains: Cmdletization.MethodParameter
ScriptBlockText|contains: FileShare.cdxml
ScriptBlockText|contains: 'Microsoft.PowerShell.Core\Export-ModuleMember'
ScriptBlockText|contains: ObjectModelWrapper
ScriptBlockText|contains: 'ROOT/Microsoft/Windows/Storage/MSFT_FileShare'

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
  • Cmdletization.MethodParameter
  • FileShare.cdxml
  • Microsoft.PowerShell.Core\Export-ModuleMember corpus 2 (sigma 2)
  • ObjectModelWrapper
  • ROOT/Microsoft/Windows/Storage/MSFT_FileShare
  • Remove-FileShare
  • Remove-SmbShare

Neighbors

Broader alternatives (more inclusive than this rule)

These rules match a superset of what this rule catches. They cover the same events plus more. Use them if you want wider coverage and can absorb more false positives.