Microsoft-Windows-Security-Auditing › Event 5145

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

Provider
Microsoft-Windows-Security-Auditing
Channel
Security
Audit Policy
Object Access → Detailed File Share
Collection Priority
Recommended (Palantir, others)
Opcode
Info

Description

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

Message #

A network share object was checked to see whether client can be granted desired access.
	
Subject:
	Security ID: %1
	Account Name: %2
	Account Domain: %3
	Logon ID: %4

Network Information:	
	Object Type: %5
	Source Address: %6
	Source Port: %7
	
Share Information:
	Share Name: %8
	Share Path: %9
	Relative Target Name: %10

Access Request Information:
	Access Mask: %11
	Accesses: %12
Access Check Results:
	%13

Fields #

NameDescription
SubjectUserSid SID[Subject] Security ID
SubjectUserName UnicodeString[Subject] Account Name
SubjectDomainName UnicodeString[Subject] Account Domain
SubjectLogonId HexInt64[Subject] Logon ID
ObjectType UnicodeString[Network Information] Object Type
IpAddress UnicodeString[Network Information] Source Address
IpPort UnicodeString[Network Information] Source Port
ShareName UnicodeString[Share Information] Share Name
ShareLocalPath UnicodeString[Share Information] Share Path
RelativeTargetName UnicodeString[Share Information] Relative Target Name
AccessMask HexInt32[Access Request Information] Access Mask Access mask reference
AccessList UnicodeString[Access Request Information] Accesses
AccessReason UnicodeString
Known values
%%1801
Granted by
%%1802
Denied by
%%1803
Denied by Integrity Policy check
%%1804
Granted by Ownership
%%1805
Not granted
%%1806
Granted by NULL DACL
%%1807
Denied by Empty DACL
%%1808
Granted by NULL Security Descriptor
%%1809
Unknown or unchecked
%%1810
Not granted due to missing
%%1811
Granted by ACE on parent folder
%%1812
Denied by ACE on parent folder
%%1813
Granted by Central Access Rule
%%1814
NOT Granted by Central Access Rule
%%1815
Granted by parent folder's Central Access Rule
%%1816
NOT Granted by parent folder's Central Access Rule
%%1830
Not granted to AppContainers
%%1841
Denied by Process Trust Label ACE
%%1856
Denied by Access Filter Ace

Example Event #

{
  "system": {
    "provider": "Microsoft-Windows-Security-Auditing",
    "guid": "54849625-5478-4994-A5BA-3E3B0328C30D",
    "event_source_name": "",
    "event_id": 5145,
    "version": 0,
    "level": 0,
    "task": 12811,
    "opcode": 0,
    "keywords": 9232379236109516800,
    "time_created": "2023-11-06T01:51:58.765174+00:00",
    "event_record_id": 300953,
    "correlation": {},
    "execution": {
      "process_id": 4,
      "thread_id": 20724
    },
    "channel": "Security",
    "computer": "WinDev2310Eval",
    "security": {
      "user_id": ""
    }
  },
  "event_data": {
    "SubjectUserSid": "S-1-5-21-1992711665-1655669231-58201500-1000",
    "SubjectUserName": "User",
    "SubjectDomainName": "WINDEV2310EVAL",
    "SubjectLogonId": "0x27844",
    "ObjectType": "File",
    "IpAddress": "::1",
    "IpPort": "62726",
    "ShareName": "\\\\*\\C$",
    "ShareLocalPath": "\\??\\C:\\",
    "RelativeTargetName": "Users\\User\\Downloads",
    "AccessMask": "0x100081",
    "AccessList": "%%1541\r\n\t\t\t\t%%4416\r\n\t\t\t\t%%4423\r\n\t\t\t\t",
    "AccessReason": "-"
  },
  "message": ""
}

Detection Patterns #

Named Pipe

13 rules

Sigma

Florian Roth (Nextron Systems), Wojciech Lesicki
Florian Roth (Nextron Systems)
Florian Roth (Nextron Systems), Christian Burkard (Nextron Systems)
Show 3 more (6 total)
Florian Roth (Nextron Systems), blueteam0ps, elhoim

Splunk

Teoderick Contreras, Splunk
Show 2 more (5 total)

Kusto Query Language

Microsoft Security Research

Detection Rules #

View all rules referencing this event →

Sigma # view in reference

Show 12 more (15 total)

Elastic # view in reference

  • Potential Machine Account Relay Attack via SMB source high: Identifies potential relay attacks against a machine account by identifying network share access events coming from a remote source.ip but using the target server computer account. This may indicate a successful SMB relay attack.

Splunk # view in reference

  • Executable File Written in Administrative SMB Share source: The following analytic detects executable files (.exe or .dll) being written to Windows administrative SMB shares (Admin$, IPC$, C$). It leverages Windows Security Event Logs with EventCode 5145 to identify this activity. This behavior is significant as it is commonly used by tools like PsExec/PaExec for staging binaries before creating and starting services on remote endpoints, a technique often employed for lateral movement and remote code execution. If confirmed malicious, this activity could allow an attacker to execute arbitrary code remotely, potentially compromising additional systems within the network.
  • High Frequency Copy Of Files In Network Share source: The following analytic detects a high frequency of file copying or moving within network shares, which may indicate potential data sabotage or exfiltration attempts. It leverages Windows Security Event Logs (EventCode 5145) to monitor access to specific file types and network shares. This activity is significant as it can reveal insider threats attempting to transfer classified or internal files, potentially leading to data breaches or evidence tampering. If confirmed malicious, this behavior could result in unauthorized data access, data loss, or compromised sensitive information.
  • PetitPotam Network Share Access Request source: The following analytic detects network share access requests indicative of the PetitPotam attack (CVE-2021-36942). It leverages Windows Event Code 5145, which logs attempts to access network share objects. This detection is significant as PetitPotam can coerce authentication from domain controllers, potentially leading to unauthorized access. If confirmed malicious, this activity could allow attackers to escalate privileges or move laterally within the network, posing a severe security risk. Ensure Event Code 5145 is enabled via Group Policy to utilize this analytic effectively.

References #