Windows PowerShell: Query SMB Shares via Get-SmbShare
Alerts on PowerShell script blocks running Get-SmbShare to discover SMB shares.
- Product
- windows
- Category
- ps_script
- Author
- frack113 (SigmaHQ), DRL 1.1
- Published
- 2021-12-15
- Updated
- 2026-07-31
ATT&CK techniques
DiscoveryRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags PowerShell script block content that includes the Get-SmbShare cmdlet, indicating discovery of SMB shares on remote systems. Attackers commonly use SMB share enumeration to identify accessible file locations and systems of interest before further collection or lateral movement. The detection relies on Script Block Logging telemetry capturing the cmdlet text within PowerShell execution.
Reporting behind it
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No 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.
title: "Windows PowerShell: Query SMB Shares via Get-SmbShare"
id: 43af32be-da09-4c65-92cf-6385e9f01641
status: test
description: This rule flags PowerShell script block content that includes the Get-SmbShare cmdlet, indicating discovery of SMB shares on remote systems. Attackers commonly use SMB share enumeration to identify accessible file locations and systems of interest before further collection or lateral movement. The detection relies on Script Block Logging telemetry capturing the cmdlet text within PowerShell execution.
references:
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1069.002/T1069.002.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_susp_smb_share_reco.yml
author: frack113, Huntrule Team
date: 2021-12-15
modified: 2022-12-25
tags:
- attack.discovery
- attack.t1069.001
logsource:
product: windows
category: ps_script
definition: "Requirements: Script Block Logging must be enabled"
detection:
selection:
ScriptBlockText|contains: get-smbshare
condition: selection
falsepositives:
- Unknown
level: low
license: DRL-1.1
related:
- id: 95f0643a-ed40-467c-806b-aac9542ec5ab
type: derived