5140 Security log · Object Access medium severity very-high volume

Windows Event ID 5140 — A network share object was accessed

Network share accessed. ShareName, ShareLocalPath, SubjectUserName, IpAddress are key.

Why event 5140 matters

Lateral movement via SMB admin shares (C$, ADMIN$, IPC$). Tools: PsExec, WMI, Impacket smbclient. Ransomware accesses shares to encrypt files across network. IPC$ = null session / named pipe access required by many attack tools.

How to detect it

Alert: access to C$ or ADMIN$ from non-management systems. Alert: IPC$ from external or unexpected IPs. Baseline share access patterns — anomalous times or sources are high signal.

Log source
Security
Advanced Audit Policy — enable the 'Object Access' subcategory (Success and/or Failure).
Fields to pivot on
ShareNameIpAddressSubjectUserNameAccessMask

MITRE ATT&CK mapping

Tactic Technique
Lateral Movement SMB/Windows Admin Shares (T1021.002)

Detection queries

Starting points — adapt the log source, projected fields and thresholds for your environment.

Sigma rule
title: Admin Share Access
status: experimental
description: Access to administrative shares from potentially unexpected hosts
author: theadminstack.com
date: 2026/05/16
logsource:
    product: windows
    service: security
detection:
    selection:
        EventID: 5140
        ShareName|contains:
            - 'C$'
            - 'ADMIN$'
    condition: selection
falsepositives:
    - Legitimate remote administration
    - IT management tools
level: medium
tags:
    - attack.lateral_movement
    - attack.t1021.002
Sentinel / Defender KQL
SecurityEvent
| where EventID == 5140   // A network share object was accessed
| project TimeGenerated, Computer, ShareName, IpAddress, SubjectUserName, AccessMask
| sort by TimeGenerated desc
Splunk SPL
index=* sourcetype="WinEventLog:Security" EventCode=5140
| stats count earliest(_time) as first_seen latest(_time) as last_seen by ComputerName
| sort - count   `# A network share object was accessed — add EventData fields: ShareName, IpAddress, SubjectUserName, AccessMask`
Hunt event 5140 in Sentinel/Defender →
Build a KQL query for this event in the KQL Query Builder.
Search all event IDs →
Open the interactive Windows Event ID lookup.

Related Object Access events

4656 A handle to an object was requested 4657 A registry value was modified 4658 The handle to an object was closed 4660 An object was deleted 4663 An attempt was made to access an object 4665 An attempt was made to create an application client context 4670 Permissions on an object were changed 4690 An attempt was made to duplicate a handle to an object 4985 The state of a transaction has changed 5142 A network share object was added 5143 A network share object was modified 5144 A network share object was deleted

Frequently asked questions

What is Windows Event ID 5140?

A network share object was accessed. Network share accessed. ShareName, ShareLocalPath, SubjectUserName, IpAddress are key.

Which log records event 5140?

Event 5140 is written to the Security channel by Microsoft-Windows-Security-Auditing. Advanced Audit Policy — enable the 'Object Access' subcategory (Success and/or Failure).

What MITRE ATT&CK techniques map to event 5140?

Event 5140 is associated with: SMB/Windows Admin Shares (T1021.002).

How do you detect activity around event 5140?

Alert: access to C$ or ADMIN$ from non-management systems. Alert: IPC$ from external or unexpected IPs. Baseline share access patterns — anomalous times or sources are high signal.