Skip to main content
5145SecurityObject AccessSecurity tier 1

Event ID 5145: A network share object was checked to see whether client can be granted desired access

Event ID 5145 records one access check on a network share: a client asked for specific rights on a file or folder, and the share granted or denied them. It comes from the Detailed File Share subcategory and logs the account, source IP, share, relative path, requested rights and the access control entry that decided.

What Triggers Event 5145: One Access Check per File or Folder

Event 5145 comes from the Detailed File Share subcategory, and its title describes it exactly: a network share object was checked to see whether the client can be granted the access it asked for. The object is a single file or folder, so each path a client opens through a share produces its own record, carrying the rights it requested and the verdict the share gave. Where 5140 marks the session, 5145 is the per-path detail.

Start with the limit, because it decides how to read every record. Failure events are generated only when access is denied at the share level. If the share permission says yes and the NTFS permission says no, no 5145 failure is written. A 5145 success therefore means the share let the request through, not that the file was opened, and the file system's final answer lives in 4663. That event comes from the file system and carries no client address; Microsoft calls out the missing IP address as the difference between the two.

RelativeTargetName is the field that makes this event worth collecting. It holds the path of the file or folder relative to the share, or a lone backslash when the client asked for the share itself. Join it to ShareLocalPath, the NTFS path behind the share in the form \??\PATH, and you have the location on disk: PSEXESVC.exe under \\*\ADMIN$ with a local path of C:\Windows is a file landing in the Windows directory. On IPC$ the local path is empty and RelativeTargetName holds the name of the named pipe being opened. svcctl is the service control pipe used by remote service creation, and srvsvc is the pipe behind share and session enumeration, which is why sweeps across IPC$ line up with network share discovery (T1135). Both are normal for administration tools, so read them as context for the source and the account rather than as alerts.

AccessMask is the sum of the rights requested for that one object, using the same table as 4663: 0x1 ReadData, 0x2 WriteData, 0x4 AppendData, 0x100000 SYNCHRONIZE and so on, and AccessList names them. The sample's 0x100002 is SYNCHRONIZE plus WriteData, shown as %%1541 %%4417. Splitting reads from writes is the most useful cut you can make on this event, because reads are the bulk of the volume and writes are where staging and tampering show up. Microsoft's monitoring guidance names the rights to watch, especially on failures: WriteData (or AddFile), AppendData (or AddSubdirectory or CreatePipeInstance), WriteEA, DeleteChild, WriteAttributes, DELETE, WRITE_DAC and WRITE_OWNER.

The same bit means different things depending on the object, so read the mask together with RelativeTargetName. On a file, 0x2 is WriteData and 0x4 is AppendData. On a folder, 0x2 is AddFile and 0x4 is AddSubdirectory, so a folder path with 0x2 is a request to create a file inside it. On a named pipe, 0x4 is CreatePipeInstance. Further up the table, 0x10000 is DELETE, 0x40000 is WRITE_DAC, the right to change the object's permissions, and 0x80000 is WRITE_OWNER, the right to change the owner.

AccessReason is the access check result, and most guides skip it. For each requested right it records whether access was granted or denied and the SDDL of the access control entry that decided. In the form D:(A;;FA;;;BA), A means allow, FA is file all access and BA is built-in administrators. Microsoft's own sample shows D:(A;;FA;;;WD), which is Everyone with full access, and finding an entry like that behind a share you thought was restricted is a free audit finding. On a failure, the same field tells you which entry refused the request.

The sample on this page is the write pattern defenders hunt. Account adm.lopez writes PSEXESVC.exe into \\*\ADMIN$ from 198.51.100.42 with a write right, and the share's local path points at C:\Windows. That is how PsExec-style tools stage their service binary. MITRE describes the technique as using valid accounts to reach a remote share over SMB, transfer files and run binaries, with Service Execution, Scheduled Task and WMI as the usual follow-ups, and notes that NTLM hashes can open administrator shares through Pass the Hash. The write is only the first step: look for a 7045 or 4697 service installation on the target within seconds, then a 4688 for whatever the service launched.

Per-object logging has a price. Shares have no system access control lists, so enabling the subcategory audits every file and folder check on every share of the machine. Microsoft's guidance follows from that: Failure only on domain controllers, where Group Policy clients read SYSVOL constantly, and Success on member servers only if you need to track every access. Pick hosts by value: file servers that hold regulated data, jump servers and machines only a known set of administrators should touch justify Success auditing with short hot retention. Everywhere else, Failure auditing alone is cheap and still records share-level denials, which is what network share discovery looks like when it half works.

Event 5145 Fields

FieldWhat it tells youSimulated value
SubjectUserSidSID of the account that requested access to the share object.S-1-5-21-424242-1050
SubjectUserNameName of the account that requested access.adm.lopez
SubjectDomainNameDomain or computer name of the account.CORP
SubjectLogonIdLogon session ID; correlates to the 4624 network logon on the server.0x5d21b8
ObjectTypeAlways File for this event.File
IpAddressSource address of the client; IPv6 or a ::ffff: mapped IPv4 address.198.51.100.42
IpPortSource port used by the client; 0 for local access.49821
ShareNameName of the accessed network share, in the form \\*\SHARE.\\*\ADMIN$
ShareLocalPathNTFS path behind the share, in the form \??\PATH; can be empty, for example on IPC$.\??\C:\Windows
RelativeTargetNameFile or folder relative to the share; a lone backslash when the share itself was the target.PSEXESVC.exe
AccessMaskSum of the requested access rights.0x100002
AccessListRequested rights as message codes that mirror AccessMask.%%1541 %%4417
AccessReasonPer-right access check result with the SDDL of the entry that granted or denied it.%%1541: %%1801 D:(A;;FA;;;BA) %%4417: %%1801 D:(A;;FA;;;BA)

Inspect Event 5145 Values

Click a field to inspect the full simulated value, the way you would expand it in a SIEM event view.

Example Event 5145 Log

A representative Security entry for Event 5145, generated deterministically by our telemetry engine so every field holds a realistic, internally consistent value.

Simulated example generated by SOCSimulator Research
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-Security-Auditing" />
    <EventID>5145</EventID>
    <Version>0</Version>
    <Level>0</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x8020000000000000</Keywords>
    <TimeCreated SystemTime="2025-09-17T23:02:37.000Z" />
    <EventRecordID>632352</EventRecordID>
    <Channel>Security</Channel>
    <Computer>WS-SIM-001.corp.socsimulator.example</Computer>
    <Security />
  </System>
  <EventData>
    <Data Name="SubjectUserSid">S-1-5-21-424242-1050</Data>
    <Data Name="SubjectUserName">adm.lopez</Data>
    <Data Name="SubjectDomainName">CORP</Data>
    <Data Name="SubjectLogonId">0x5d21b8</Data>
    <Data Name="ObjectType">File</Data>
    <Data Name="IpAddress">198.51.100.42</Data>
    <Data Name="IpPort">49821</Data>
    <Data Name="ShareName">\\*\ADMIN$</Data>
    <Data Name="ShareLocalPath">\??\C:\Windows</Data>
    <Data Name="RelativeTargetName">PSEXESVC.exe</Data>
    <Data Name="AccessMask">0x100002</Data>
    <Data Name="AccessList">%%1541 %%4417</Data>
    <Data Name="AccessReason">%%1541: %%1801 D:(A;;FA;;;BA) %%4417: %%1801 D:(A;;FA;;;BA)</Data>
  </EventData>
</Event>

Detecting Event 5145

Executable, DLL or script written to ADMIN$ or C$ (PsExec-style staging)

SPL assumes sourcetype XmlWinEventLog:Security. The KQL pulls AccessList out of EventData because the SecurityEvent table has no AccessList column. Exclude your software-deployment servers by IpAddress.

index=wineventlog sourcetype=XmlWinEventLog:Security EventCode=5145 ObjectType=File
| where match(ShareName, "(?i)\\\\(ADMIN\\$|C\\$)$")
| where match(AccessList, "4417|4418")
| where match(RelativeTargetName, "(?i)\\.(exe|dll|bat|ps1|cmd|msi)$")
| table _time, host, SubjectUserName, IpAddress, ShareName, RelativeTargetName, AccessList

One source address collecting many distinct files from shares in a short window (bulk read)

The threshold of 100 files in five minutes is a starting point. Exclude backup and scanner sources by IpAddress, and exclude SYSVOL and NETLOGON on domain controllers.

index=wineventlog sourcetype=XmlWinEventLog:Security EventCode=5145 ObjectType=File
| where NOT match(ShareName, "(?i)SYSVOL|NETLOGON|IPC\\$")
| bin _time span=5m
| stats dc(RelativeTargetName) as files, values(ShareName) as shares by _time, host, IpAddress, SubjectUserName
| where files >= 100

Share access from an address outside the private ranges

Microsoft recommends watching for source addresses outside your internal ranges. The ::ffff: prefix is stripped first; IPv6 clients need their own prefix list.

index=wineventlog sourcetype=XmlWinEventLog:Security EventCode=5145
| eval src=replace(IpAddress, "^::ffff:", "")
| where NOT (cidrmatch("10.0.0.0/8", src) OR cidrmatch("172.16.0.0/12", src) OR cidrmatch("192.168.0.0/16", src)) AND src!="::1" AND src!="127.0.0.1"
| stats count by src, SubjectUserName, ShareName, host

Sensitive share opened by an account outside its allowed list

Replace HR$ with the share you protect and maintain the allowlist as a lookup or watchlist.

index=wineventlog sourcetype=XmlWinEventLog:Security EventCode=5145
| where like(ShareName, "%\\HR$")
| lookup hr_share_accounts.csv SubjectUserName OUTPUT allowed
| where isnull(allowed)
| table _time, host, SubjectUserName, IpAddress, RelativeTargetName, AccessList

True Positive vs False Positive

Most 5145 records on a file server are users opening documents with read rights, so baseline the object and the rights, not just the connection: which accounts read which folders under each ShareName, and who normally holds write rights there. Domain controllers add the SYSVOL and NETLOGON reads of every machine applying Group Policy, and backup, antivirus and indexing services read everything. Exclude those by source address or account before setting any threshold, or every count fires for the wrong reasons.

The detections that hold up are keyed on the path and the rights. The first is a write right on ADMIN$ or C$ with a RelativeTargetName ending in .exe, .dll or a script extension, especially from a workstation address, because administrators who push software normally do it from a management host. The second is bulk reading: one source collecting hundreds of distinct files from a share in minutes, which maps to data from a network shared drive (T1039). Count distinct RelativeTargetName values per source rather than raw events, so repeated checks on one file do not inflate the number. The third is an account opening paths on a sensitive share it is not listed for; Microsoft suggests watching specific ShareName and RelativeTargetName values for critical folders, in both Success and Failure, and flagging accounts that reach files outside their allowed list. The fourth is a failure on a destructive or permission-changing right, such as DELETE, WRITE_DAC or WRITE_OWNER, which Microsoft lists among the rights to watch on failures. When you compare IpAddress with your internal ranges, strip the ::ffff: prefix first.

For the PsExec-style chain, correlate on the target host and the file name. The 5145 write of an executable to ADMIN$, a 7045 or 4697 service installation, and a 4688 for the launched process sit seconds apart, and in this pattern the file written through the share is the binary the new service starts. That chain on one host inside a minute is far more convincing than any single event in it, and it is the pattern worth turning into a correlation rule.

Triage starts from the object. Read RelativeTargetName and AccessList to see what was touched and with which rights, then AccessReason for the entry that allowed it. SubjectLogonId groups every check made in the same session, so pull them all in time order to see what else the session touched; it also leads to the 4624 network logon when you need the authentication details. On the target, check whether the file is still there and whether service, scheduled task or WMI activity followed. The share log never names a process, so the source machine is where you find out what opened the connection.

Keep the limit in mind before closing a case. A 5145 success does not prove the file was read or written, only that the share level allowed the check, and silence after an NTFS deny proves nothing.

MITRE ATT&CK® Techniques

Event 5145 telemetry feeds detections for these ATT&CK® techniques:

Practice Investigating Event 5145

Reading about a network share object was checked to see whether client can be granted desired access is one thing. Working the detection inside a live console is another. These free SOCSimulator operations cover the attack techniques Event 5145 helps you detect:

FortiOS Bypass to Hunters International Ransomware

FortiOS Bypass to Hunters International Ransomware

Operators consistent with the Hunters International ransomware group abuse a FortiOS super-admin authentication bypass on an internet-facing FortiGate, plant rogue accounts, pivot over the SSL-VPN tunnel by RDP, sweep the network with Advanced IP and Port Scanner, and push roughly 6.8 GB of share data to a single external host over SFTP before running the encrypter. Work the FortiGate edge, the directory records, the perimeter egress, and the endpoint process tree to reconstruct the intrusion from entry to encryption.

30m·256 tasks
View Operation
MFA Fatigue: The Notification Flood

MFA Fatigue: The Notification Flood

In this guided walkthrough, you will step into the shoes of a SOC analyst investigating a modern identity-based attack. The threat landscape in 2026 has shifted: adversaries are no longer just 'breaking in'; they are logging in. You will analyze real-time identity signals, correlate disparate log sources across a hybrid cloud environment, and identify the markers of an MFA fatigue attack used by the FlowerStorm phishing kit. This scenario highlights the critical importance of behavioral analysis over simple IOC matching in an era of malware-free intrusions and compromised human identities.

30m·256 tasks
View Operation
Edge Device Exploitation: VPN Zero-Day

Edge Device Exploitation: VPN Zero-Day

Investigate a breach targeting exposed edge security appliances. In this scenario, an attacker exploits Ivanti Connect Secure CVE-2025-22457 to obtain unauthenticated code execution, spawns a shell from the gateway web process, retrieves a Linux payload, and attempts to preserve access using edge-device service abuse patterns similar to FortiGate SSL-VPN post-exploitation tradecraft. Analyze SIEM, XDR, and firewall evidence to identify the spawned shell, suspicious domain, local sync script, and defensive block policy.

55m·508 tasks
View Operation
Start investigating free

Frequently Asked Questions

What is event ID 5145?
It records that a network share object, a file or folder, was checked to see whether the client could be granted the access it asked for. It is generated by the Detailed File Share subcategory and includes the account, source IP and port, share name, relative target name, requested rights and the access check result.
Why does event 5145 flood the Security log?
Because Detailed File Share logs every file and folder access on every share, and shares have no SACL to narrow it. Domain controllers add SYSVOL reads from all Group Policy clients. Keep Success auditing for file servers or high-value hosts, use Failure on domain controllers, and filter known backup and scanner sources at collection.
What is the difference between event 5140 and event 5145?
5145 is the per-object record: one event for each file or folder access check, with RelativeTargetName, the rights actually requested and the granted or denied result in AccessReason. 5140 is written once per session, when the first access to a share is made, and always shows ReadData, so it shows that a share was opened but not which paths were asked for or with which rights.
How can event 5145 reveal PsExec or admin share lateral movement?
Filter for ShareName ADMIN$ or C$ with a write right (WriteData or AppendData in AccessList) and a RelativeTargetName ending in .exe, .dll or a script. Add the source IpAddress and check the target for a 7045 or 4697 service installation seconds later. The pair is the signature of tooling that copies a service binary and starts it remotely.

Sources

“5145 field schema, share-level-only failure behavior, AccessReason format and SDDL values, address formats, and monitoring recommendations”

“No SACLs for shares, volume high on file servers and domain controllers (SYSVOL), Failure-only recommendation for domain controllers”

“SMB/Windows Admin Shares: valid accounts over SMB to transfer files and run binaries, Pass the Hash against administrator shares”

“T1135 Network Share Discovery, the enumeration behavior visible through IPC$ pipe access”

“T1039 Data from Network Shared Drive, the bulk-read behavior the fan-out query targets”

Event ID

Event ID 4663: File Access, AccessMask and Detection Queries

Event ID 4663 shows an access right being used on a file or key. Decode AccessMask, fix 'not logging', and detect stagin…

Read more
Glossary

What is Data Exfiltration? SOC Glossary

Data exfiltration in cyber security is the unauthorized transfer of data from an organization's systems to infrastructur…

Read more
Glossary

What is Persistence? SOC Glossary

Persistence is the set of techniques an adversary uses to keep access to a compromised system after whatever gave them t…

Read more
Glossary

What is Threat Hunting? SOC Glossary

Threat hunting is the proactive search through security telemetry for attackers that existing controls missed. The hunte…

Read more
Career Path

SOC Analyst (Tier 2) Career Guide: Salary & Skills

Tier 2 SOC Analysts handle the investigations that Tier 1 escalates. You dig into multi-stage attacks, coordinate contai…

Read more
Career Path

Threat Hunter Career Guide: Salary & Skills

Threat Hunters do not wait for alerts. You develop hypotheses based on threat intelligence and adversary behavior models…

Read more
Technique

Remote Services (T1021): Detection Training

Remote Services lateral movement reuses valid credentials against services built to accept remote sessions, RDP, SSH, VN…

Read more
Technique

Lateral Tool Transfer (T1570): Detection Training

Once inside, adversaries copy their tooling from host to host to support lateral movement, commonly over SMB admin share…

Read more
Comparison

SOCSimulator vs. LetsDefend: Platform Comparison

SOCSimulator wins on operational realism. You get multi-tool shift simulation with SLA pressure, noise injection, and al…

Read more
Event ID

Windows Event ID Library: SOC Reference

Windows Security and Sysmon event IDs with simulated log samples, field tables, and tested detection queries.

Read more
Feature

Shift Mode: Real-Time SOC Simulation

Practice alert triage under realistic time pressure with SLA timers and noise injection.

Read more
Feature

Operations: Guided Training Operations

Structured CTF-style investigation operations covering real-world attack scenarios.

Read more