Skip to content
SOC Analyst Role
  • Loading index…

↑↓ navigate · ↵ open · Esc close

en

Security · Object access

5140 · A network share object was accessed

Logged on the server hosting a share when a client first connects to that share in an SMB session. It records who connected, from which IP and to which share, so it is the go-to event for spotting admin-share (C$, ADMIN$) access used in lateral movement and for scoping data access on file servers.

low prioritySecurity logObject accessMITRE T1021.002

Where it is logged

Security log on the target machine hosting the share (file server, or any endpoint for admin shares). Requires Audit File Share (Object Access) success auditing. Logged once per session per share, so it is far less noisy than 5145.

Key fields to read

FieldWhat it tells you
ShareNameShare accessed, e.g. \\*\C$, \\*\ADMIN$, \\*\IPC$ or \\*\Finance.
ShareLocalPathLocal folder behind the share, e.g. \??\C:\Windows for ADMIN$.
IpAddressSource IP of the SMB client.
SubjectUserNameAccount that connected.
SubjectLogonIdLinks to the 4624 type 3 logon on the same server.
AccessMaskRequested access (e.g. 0x1 read); useful but not always decisive at the session level.

Sample event

5140 — synthetic example
Log Name: Security
EventID: 5140
TimeCreated: 2026-11-20T23:11:46.902Z
Computer: NW-FIN-WS07.northwind.local
SubjectUserName: adm.jkim
SubjectDomainName: NORTHWIND
SubjectLogonId: 0x5F0B11A
ObjectType: File
IpAddress: 10.20.30.57
IpPort: 52211
ShareName: \\*\ADMIN$
ShareLocalPath: \??\C:\Windows
AccessMask: 0x1

How to triage it

  1. 1Classify the share: admin shares (C$, ADMIN$) on workstations are higher risk than normal departmental shares.
  2. 2Identify the source from IpAddress and the account from SubjectUserName; is this an expected admin or management server?
  3. 3Pivot on SubjectLogonId to the 4624 type 3 logon and check the authentication package (NTLM vs Kerberos).
  4. 4Look for follow-on activity on the target within minutes: 7045/4697 service installs, 4698 tasks, or new processes from services.exe.
  5. 5Check how many hosts the same source/account touched; one source hitting admin shares on many hosts suggests lateral movement or ransomware staging.

Benign vs suspicious

Usually benign

  • Software deployment, patching and inventory tools (SCCM/Intune agents, backup servers) using admin shares.
  • IT staff browsing \\host\C$ for troubleshooting from a jump host.
  • Group Policy and logon script access to SYSVOL/NETLOGON on DCs (very common).

Red flags

  • Workstation-to-workstation access to ADMIN$ or C$.
  • One account connecting to admin shares on many hosts in a short time.
  • Admin share access followed by 7045 service creation (PsExec-style) on the same target.
  • Unusual accounts (service accounts, newly created users) accessing sensitive data shares off-hours.

Hunt for it: Splunk & KQL

Splunk SPL
index=wineventlog EventCode=5140 ShareName IN ("\\*\ADMIN$", "\\*\C$")
| stats dc(host) AS targets values(host) AS hosts count BY SubjectUserName, IpAddress
| where targets >= 3
| sort - targets
Sentinel KQL
// Sentinel SecurityEvent: admin share access fan-out per source
SecurityEvent
| where TimeGenerated > ago(1d)
| where EventID == 5140
| where ShareName endswith @"\ADMIN$" or ShareName endswith @"\C$"
| summarize Targets = dcount(Computer), Hosts = make_set(Computer, 50) by SubjectUserName, IpAddress
| where Targets >= 3
| order by Targets desc

Field names depend on your add-on and table. More translations in the Splunk vs KQL cheat sheet.

Interview question

“What is the difference between Event 5140 and 5145?”

✓ Strong answer sketch

5140 is logged once when a client first connects to a share in a session, so it tells me who connected to which share from where. 5145 is the detailed file share audit, logged for each file or pipe access check inside the share with the RelativeTargetName, so it tells me exactly what was touched. 5140 needs Audit File Share and is manageable volume; 5145 needs Audit Detailed File Share and is very noisy, so many teams enable it only on sensitive servers. For PsExec detection, 5140 shows the ADMIN$ connection and 5145 shows the svcctl pipe and the dropped service binary.

More SOC interview questions

Frequently asked questions

Where is Event 5140 logged, on the client or the server?

On the server hosting the share (the target), not on the client that connected.

Why do I see so many 5140 events for IPC$?

IPC$ is used for named-pipe communication such as RPC, so it is accessed constantly by legitimate management traffic. It becomes interesting when combined with suspicious pipes in 5145.