Detection rules › Splunk
Executable File Written in Administrative SMB Share
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.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Lateral Movement | T1021.002 Remote Services: SMB/Windows Admin Shares |
Event coverage
| Provider | Event ID | Title |
|---|---|---|
| Security-Auditing | 5145 | A network share object was checked to see whether client can be granted desired access. |
Stages and Predicates
Stage 1: search
search AccessMask="0x2" EventCode=5145 ObjectType="File" RelativeTargetName IN ("*.dll", "*.exe") ShareName IN ("\\\\*\\C$", "\\\\*\\IPC$", "\\\\*\\admin$")
Stage 2: stats
stats BY EventCode, ShareName, RelativeTargetName, ObjectType, AccessMask, src_user, src_port, IpAddress, dest
Stage 3: search
search
Stage 4: search
search `macro`
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
AccessMask | eq |
|
EventCode | eq |
|
ObjectType | eq |
|
RelativeTargetName | in |
|
ShareName | in |
|
Neighbors
Broader alternatives (more inclusive than this rule)
These rules match a superset of what this rule catches. They cover the same events plus more. Use them if you want wider coverage and can absorb more false positives.
- Transferring Files with Credential Data via Network Shares (drops 5 filters this rule applies)