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.

FreeReviewedSigma · High · v2
Product
windows
Service
security
Author
Jose Rodriguez (@Cyb3rPandaH), OTR (Open Threat Research) (SigmaHQ), DRL 1.1
Published
2020-08-06
Updated
2026-07-31
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