Skip to content
SIEMBench
100% Client-Side Tool • Inputs Never Sent to Our Servers

Event ID 5145

Event ID 5145: Detailed File Share Access

A network share object was checked to see whether client can be granted desired access

Log source
Security
How to enable it
Object Access > Audit Detailed File Share (Success and Failure)
Category
Lateral Movement
Priority
High
Typical volume
Very high
MITRE ATT&CK

What Event ID 5145 means

5145 records each file, folder or named pipe that a client asks for through a share. No SACL is needed, so switching on the subcategory covers every share on the host at once, which is both its strength and its cost.

Named pipes make it special. Remote management protocols run over pipes on IPC$, and the pipe name appears in RelativeTargetName. svcctl means that someone is controlling services, atsvc that someone is creating tasks, winreg that someone is reading the registry, and samr or lsarpc that accounts are being enumerated.

On file servers the volume can reach millions of events a day. Enable it on domain controllers and on servers of high value first, and on workstations where inbound SMB is rare and therefore cheap to log and meaningful.

Key fields to inspect

FieldMeaningSuspicious when
RelativeTargetName File, folder or pipe inside the share. PSEXESVC.exe, random .exe names, svcctl, atsvc, winreg, samr, or *.dit and *.vhdx.
ShareName Share, as \\*\name. \\*\ADMIN$, \\*\C$ and \\*\IPC$ from a workstation.
AccessMask Rights that were requested, in hexadecimal. Write rights (bit 0x2) on ADMIN$.
IpAddress Source address. A host that does not manage this one.
SubjectUserName Account that asked. A user, or a local administrator account.
AccessReason Why each right was granted or denied. Granted by membership in Administrators.
IpPort Source port. Useful for matching firewall records.

Named pipes worth knowing

PipeServiceAssociated activity
svcctlService Control ManagerPsExec and remote service creation
atsvcTask Scheduleratexec and remote tasks
winregRemote Registrysecretsdump reading SAM and LSA secrets
samrSecurity Account ManagerUser and group enumeration
lsarpcLocal Security AuthoritySID and policy lookups
srvsvcServer serviceShare and session enumeration
spoolssPrint SpoolerCoerced authentication and print exploits
efsrpcEncrypting File SystemCoerced authentication (PetitPotam)

Detection queries

Find executables written to administrative shares, and sensitive pipes opened remotely. Adjust names and thresholds to your environment. About these queries.

Splunk SPL

index=windows source="XmlWinEventLog:Security" EventCode=5145
| eval write=if(match(ShareName, "(?i)ADMIN\$|C\$") AND match(RelativeTargetName, "(?i)\.(exe|dll|bat|ps1|sys)$"), 1, 0), pipe=if(match(ShareName, "(?i)IPC\$") AND match(RelativeTargetName, "(?i)^(svcctl|atsvc|winreg|efsrpc|spoolss|PSEXESVC)"), 1, 0)
| where write=1 OR pipe=1
| stats values(RelativeTargetName) AS targets values(AccessMask) AS masks count BY Computer IpAddress SubjectUserName

Microsoft Sentinel KQL

SecurityEvent
| where EventID == 5145
| where (ShareName has_any ("ADMIN$", "C$") and RelativeTargetName matches regex @"(?i)\.(exe|dll|bat|ps1|sys)$") or (ShareName has "IPC$" and RelativeTargetName matches regex @"(?i)^(svcctl|atsvc|winreg|efsrpc|spoolss|PSEXESVC)")
| summarize Targets = make_set(RelativeTargetName, 30), Masks = make_set(AccessMask), Count = count() by Computer, IpAddress, SubjectUserName, bin(TimeGenerated, 10m)

PowerShell

Get-WinEvent -FilterHashtable @{ LogName = 'Security'; Id = 5145; StartTime = (Get-Date).AddDays(-1) } |
  ForEach-Object { $d = @{ Time = $_.TimeCreated }; ([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }; [pscustomobject]$d } |
  Where-Object { $_.RelativeTargetName -match '^(svcctl|atsvc|winreg|efsrpc)|\.exe$' } |
  Select-Object Time, SubjectUserName, IpAddress, ShareName, RelativeTargetName, AccessMask | Format-Table -AutoSize

Attack scenarios

PsExec and Impacket

The sequence over a single session is IPC$ svcctl, ADMIN$ with a new .exe, and then a service (7045). Impacket's output files, such as __output, are read back through the same shares.

Remote credential dumping

secretsdump starts Remote Registry, opens winreg, saves hives to Windows\Temp or System32 with random .tmp names, and reads them over ADMIN$. Each step is visible.

Coerced authentication

A client opens efsrpc or spoolss on a domain controller to make it authenticate to a machine under the attacker's control, which relays the credentials to another service.

Investigation checklist

  1. List everything the same address and account requested within the minute.
  2. Match the session to 4624 and 4672 for the logon and its privileges.
  3. For executables, collect the file and check for 7045, 4698 and 4688.
  4. For winreg with temporary files, assume that local and cached credentials are stolen.

Common benign causes

Event ID 5145 FAQ

Does event 5145 mean that a file was opened?

It means that access was checked, and the result is in the event. The client could have been denied or may only have asked for attributes. Use AccessMask, and 4663 if a SACL is present, to establish what was done.

Why is event 5145 so noisy?

It is written for every object checked on every share, including folder browsing. Restrict it to hosts where SMB is rare, and filter on administrative shares and named pipes when you collect.

Which named pipes indicate lateral movement?

svcctl for remote services and atsvc for remote tasks are the most direct. winreg with temporary hive files points to credential theft. Unknown pipe names with random letters can belong to command-and-control frameworks.

Techniques follow MITRE ATT&CK® v20.1. © 2026 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation (license). Field names were checked against Microsoft documentation and provider schemas.