Windows Security Event 5145: SMB Write Access to Admin Share (C$)
Flags non-machine accounts writing via SMB to the C$ administrative share using Security EventID 5145.
- Product
- windows
- Service
- security
- Author
- Jose Rodriguez (@Cyb3rPandaH), OTR (Open Threat Research) (SigmaHQ), DRL 1.1
- Published
- 2020-08-06
- Updated
- 2026-07-31
ATT&CK techniques
Lateral MovementRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule identifies Windows SMB file access attempts that write to an administrative share by matching Security Event 5145 with a ShareName ending in C$ and an AccessMask of 0x2. It focuses on non-computer accounts by excluding SubjectUserName values that end with $. Such write access to admin shares is significant because it can indicate remote file creation or preparation for lateral movement, and it relies on detailed SMB auditing events from Windows Security logs (EventID 5145) including ShareName, AccessMask, and SubjectUserName.
Reporting behind it
- github.comhttps://github.com/OTRF/ThreatHunter-Playbook/blob/f7a58156dbfc9b019f17f638b8c62d22e557d350/playbooks/WIN-201012004336.yaml
- securitydatasets.comhttps://securitydatasets.com/notebooks/atomic/windows/lateral_movement/SDWIN-200806015757.html?highlight=create%20file
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/security/win_security_smb_file_creation_admin_shares.yml
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 Security Event 5145: SMB Write Access to Admin Share (C$)"
id: b743adce-e241-428e-aeaa-a0a71d3b7f97
status: test
description: This rule identifies Windows SMB file access attempts that write to an administrative share by matching Security Event 5145 with a ShareName ending in C$ and an AccessMask of 0x2. It focuses on non-computer accounts by excluding SubjectUserName values that end with $. Such write access to admin shares is significant because it can indicate remote file creation or preparation for lateral movement, and it relies on detailed SMB auditing events from Windows Security logs (EventID 5145) including ShareName, AccessMask, and SubjectUserName.
references:
- https://github.com/OTRF/ThreatHunter-Playbook/blob/f7a58156dbfc9b019f17f638b8c62d22e557d350/playbooks/WIN-201012004336.yaml
- https://securitydatasets.com/notebooks/atomic/windows/lateral_movement/SDWIN-200806015757.html?highlight=create%20file
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/security/win_security_smb_file_creation_admin_shares.yml
author: Jose Rodriguez (@Cyb3rPandaH), OTR (Open Threat Research), Huntrule Team
date: 2020-08-06
modified: 2025-10-17
tags:
- attack.lateral-movement
- attack.t1021.002
logsource:
product: windows
service: security
detection:
selection:
EventID: 5145
ShareName|endswith: C$
AccessMask: "0x2"
filter_main_subjectusername:
SubjectUserName|endswith: $
filter_optional_local_ip:
IpAddress: ::1
condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
- Unknown
level: high
license: DRL-1.1
related:
- id: b210394c-ba12-4f89-9117-44a2464b9511
type: derived