Event ID 5140: A network share object was accessed

Event ID 5140, "A network share object was accessed", is written to the Security log of the computer hosting a share the first time an account touches that share in a logon session, with the account, its Logon ID, the source address and port, and the share name and local path.

Security logFiles and sharesChecked 2 December 2026

What event 5140 records

Every SMB connection to a share, whether a user opening a mapped drive, a script copying a file to \\server\C$, or a remote administration tool using ADMIN$, produces one 5140 on the computer that hosts the share. Microsoft documents that it is generated once per session, on the first access attempt, not for every file. That keeps it small enough to review: one row per account, per share, per logon session.

The Access Mask on a 5140 is always 0x1 (ReadData or ListDirectory), so the event says that the share was opened, not what was read or written. For the files themselves you need 5145 or NTFS object auditing (4663). Failure events are written when access is refused at the share level.

Which shares matter

ShareWhat it isInvestigation value
C$, D$ and other drive sharesHidden administrative share for a whole volumeWorkstation-to-workstation access is rare for normal users; copying tools in or data out
ADMIN$Hidden share for C:\WindowsRemote service execution: PsExec and similar tools copy their service binary here
IPC$Inter-process communication: named pipes, not filesRemote administration and enumeration (services, tasks, registry, accounts); details in 5145
SYSVOL, NETLOGONGroup Policy and logon scripts on domain controllersNormal for every domain computer; noise unless the account is unexpected
Business shares (Finance, HR, Projects)File server dataCollection before exfiltration; unusual accounts or volumes

The strongest single signal is an administrative share on a workstation being opened from another workstation. Help desk tools and management agents do this, so build a short list of the accounts and source hosts that legitimately do, and review everything else.

Joining 5140 to the rest of the evidence

  • The logon. The Logon ID matches a 4624 type 3 from the same source address. That logon tells you how the account authenticated (NTLM or Kerberos) and whether it was a local or domain account.
  • Admin rights. A 4672 with the same Logon ID shows the session was administrative, which C$ and ADMIN$ require.
  • The source host. On the computer the connection came from, look for a 4648 (explicit credentials), net use or copy command lines in 4688 or PowerShell 4104, and the mapped share in the user's NTUSER.DAT (MountPoints2).
  • What followed. A 7045 seconds after an ADMIN$ 5140 is remote service execution. New files in the USN Journal under the share path show what was copied in.

Event 5140 fields

The fields an investigator reads first, what they mean, and where Arcsentry stores them.

FieldMeaningArcsentry field
Subject: Security ID, Account Name, Account DomainThe account that opened the share.user_name, user_domain
Logon IDThe network logon session; matches its 4624.event_log_logon_id
Object TypeAlways File for shares.event data
Source Address, Source PortWhere the connection came from.source_ip
Share NameThe share, written as \\*\C$.event_log_share_name
Share PathThe local folder behind it, such as \??\C:\.$sharelocalpath
Access Mask, AccessesAlways 0x1, ReadData (or ListDirectory).event data

What event 5140 proves, and what it does not

It shows

  • That this account, from this address, connected to this share during this logon session.
  • With 4672, that the session had administrative rights.

It does not show

  • Which files were read or written. Use 5145, object access auditing or the USN Journal.
  • Each later access in the same session. Only the first is logged.
  • Anything at all when the auditing is off, which is the default on most Windows versions.

Attacker activity it reveals

Admin share lateral movement

An attacker with an administrator's password or hash connects to C$ or ADMIN$ on the next host to copy tools in, then runs them with a service, a scheduled task or WMI. MITRE ATT&CK T1021.002

Collecting data from file servers

Bursts of 5140s for many business shares from one account or host in a short time, especially outside working hours, fit staging before exfiltration or ransomware encryption. MITRE ATT&CK T1039

Share discovery

One host opening IPC$ on many computers in quick succession is share or session enumeration (net view, BloodHound, scanning tools). MITRE ATT&CK T1135

In a real investigation: Halden Freight office intrusion

From HF-WS02 the attacker ran net use \\HF-WS01\C$ at 22:12:18 UTC with the local account svc_backup they had created on HF-WS01 earlier. HF-WS01 recorded the connection as a 4624 type 3 for svc_backup from 10.211.55.7 the same second, and HF-WS02 recorded the matching 4648. No 5140 appears in the case findings, consistent with file share auditing being off, as it is by default. The share name came from the command line on the source host, which is why the source host's logs matter as much as the target's.

Finding event 5140 in Arcsentry

Arcsentry parses every channel in Windows\System32\winevt\Logs, whether it comes from an Arcsentry Collector archive, a KAPE or Velociraptor collection, or a disk image. Security log records are the event type evtx_security. In Hunt, with that event type selected:

filter event_code == "5140"
derive {share = event_log_share_name, acct = user_name}
filter share ~= "(?i)\\$$"
select {timestamp, acct, source_ip, share}
sort {timestamp}

Connections to hidden shares (names ending in $: C$, ADMIN$, IPC$) in time order. Group by source_ip to see which hosts reach into this one.

Or ask in plain English, for example "show event 5140 on every host, oldest first", and Arcsentry shows the AQL it wrote before it runs. The AQL reference lists the operators used here, and the AI investigator reads the same events, citing each one by its event ID when it reports a finding.

Related event IDs

All events by investigation question: Windows security event IDs for incident response. Logon types in full: Windows logon types. The log files themselves: Windows event logs.

Frequently asked

What does event ID 5140 mean?

An account connected to a network share on this computer. It records the account, the Logon ID, the source address and port, and the share name and path, once per logon session per share.

What is the difference between event ID 5140 and 5145?

5140 is written once when a session first opens a share. 5145 is written for each file, folder or named pipe access check inside the share, with the relative path. 5145 is far more detailed and far noisier.

How do I enable event ID 5140?

Enable "Audit File Share" under Advanced Audit Policy Configuration › Object Access, for success and failure, through Group Policy or with auditpol. It is off by default.

Does 5140 show which files were copied?

No. Its access mask is always ReadData. Use 5145, NTFS object auditing (4663), or file system artifacts such as the USN Journal and $MFT on the host.

Sources

  • Microsoft Learn: 5140(S, F) A network share object was accessed; Audit File Share
  • MITRE ATT&CK: T1021.002 SMB/Windows Admin Shares; T1039 Data from Network Shared Drive; T1135 Network Share Discovery
  • Venema Labs lab case: Halden Freight office intrusion, HF-WS01 and HF-WS02 Security logs

Checked 2 December 2026 by Venema Labs against Microsoft's audit documentation and, where an example is shown, the named lab case. Field availability varies by Windows version.

Find event 5140 across every host in minutes.

Load your collections, ask what happened, and check every finding against the event behind it. Free for 7 days.

Request a trial