Detectionmediumtest
PowerShell Deleted Mounted Share
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
oscd.community, Zach StanfordCreated 2020-10-08Updated 2025-10-0766a4d409-451b-4151-94f4-a55d559c49b0windows
Log Source
WindowsPowerShell Script
ProductWindows← raw: windows
CategoryPowerShell Script← raw: ps_script
Definition
Requirements: Script Block Logging must be enabled
Detection Logic
Detection Logic2 selectors
detection:
selection:
ScriptBlockText|contains:
- 'Remove-SmbShare'
- 'Remove-FileShare'
filter_main_module_load:
ScriptBlockText|contains|all:
- 'FileShare.cdxml'
- 'Microsoft.PowerShell.Core\Export-ModuleMember'
- 'ROOT/Microsoft/Windows/Storage/MSFT_FileShare'
- 'ObjectModelWrapper'
- 'Cmdletization.MethodParameter'
condition: selection and not 1 of filter_main_*False Positives
Administrators or Power users may remove their shares via cmd line
References
MITRE ATT&CK
Tactics
Sub-techniques
Rule Metadata
Rule ID
66a4d409-451b-4151-94f4-a55d559c49b0
Status
test
Level
medium
Type
Detection
Created
2020-10-08
Modified
2025-10-07
Author
Path
rules/windows/powershell/powershell_script/posh_ps_susp_mounted_share_deletion.yml
Raw Tags
attack.stealthattack.t1070.005