PowerShell share removal via Remove-SmbShare or Remove-FileShare on Windows

Flags PowerShell commands that remove SMB or file shares through Remove-SmbShare/Remove-FileShare.

FreeReviewedSigma · Medium · v2
Product
windows
Category
ps_script
Author
oscd.community, @redcanary, Zach Stanford @svch0st (SigmaHQ), DRL 1.1
Published
2020-10-08
Updated
2026-07-31

ATT&CK techniques

Defense Evasion
  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Execution

  5. Persistence

  6. Priv Esc

  7. Cred Access

  8. Discovery

  9. Lateral Movement

  10. Collection

  11. C2

  12. Exfiltration

  13. Impact

What it detects

This rule flags PowerShell activity where scripts attempt to remove mounted network shares using Remove-SmbShare or Remove-FileShare. Attackers can use share removal to clean up connections and reduce evidence of access. It relies on Script Block Logging telemetry to match specific cmdlets within PowerShell script blocks and on additional script-block module-loading context to reduce noise.

Related detections3 linkedT1070.005 — drag to rearrange
Windows Registry: MaxMpxCt Value Changed (LanmanServer Parameters)
Windows Registry: Disable Administrative Share Creation via LanmanServer Parameters
Windows net.exe Unmount Share (/delete) Execution
PowerShell share removal via Remove-SmbShare or Remove-FileShare on Windows
Pivot detection · T1070.005 · 3 related

Changelog

v2
  1. v2
    Candidate ingested via manual entry.2026-07-31
  2. v1
    No changelog recorded for this version.2026-07-30

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.