Executable File Written in Administrative SMB Share
Description
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.
- Type: TTP
-
Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Last Updated: 2024-05-16
- Author: Teoderick Contreras, Mauricio Velazco, Splunk
- ID: f63c34fe-a435-11eb-935a-acde48001122
Annotations
ATT&CK
Kill Chain Phase
- Exploitation
NIST
- DE.CM
CIS20
- CIS 10
CVE
Search
1
2
3
4
`wineventlog_security` EventCode=5145 RelativeTargetName IN ("*.exe","*.dll") ObjectType=File ShareName IN ("\\\\*\\C$","\\\\*\\IPC$","\\\\*\\admin$") AccessMask= "0x2"
| stats min(_time) as firstTime max(_time) as lastTime count by EventCode ShareName RelativeTargetName ObjectType AccessMask src_user src_port IpAddress
| `security_content_ctime(firstTime)`
| `executable_file_written_in_administrative_smb_share_filter`
Macros
The SPL above uses the following Macros:
executable_file_written_in_administrative_smb_share_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Required fields
List of fields required to use this analytic.
- _time
- EventCode
- Share_Name
- Relative_Target_Name
- Object_Type
- Access_Mask
- user
- src_port
- Source_Address
How To Implement
To successfully implement this search, you need to be ingesting Windows Security Event Logs with 5145 EventCode enabled. The Windows TA is also required. Also enable the object Audit access success/failure in your group policy.
Known False Positives
System Administrators may use looks like PsExec for troubleshooting or administrations tasks. However, this will typically come only from certain users and certain systems that can be added to an allow list.
Associated Analytic Story
- Active Directory Lateral Movement
- Prestige Ransomware
- Graceful Wipe Out Attack
- Industroyer2
- IcedID
- Data Destruction
- Hermetic Wiper
- Trickbot
RBA
Risk Score | Impact | Confidence | Message |
---|---|---|---|
70.0 | 70 | 100 | $src_user$ dropped or created an executable file in known sensitive SMB share. Share name=$ShareName$, Target name=$RelativeTargetName$, and Access mask=$AccessMask$ |
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.
Reference
- https://attack.mitre.org/techniques/T1021/002/
- https://www.rapid7.com/blog/post/2013/03/09/psexec-demystified/
- https://labs.vipre.com/trickbot-and-its-modules/
- https://whitehat.eu/incident-response-case-study-featuring-ryuk-and-trickbot-part-2/
- https://thedfirreport.com/2023/05/22/icedid-macro-ends-in-nokoyawa-ransomware/
Test Dataset
Replay any dataset to Splunk Enterprise by using our replay.py
tool or the UI.
Alternatively you can replay a dataset into a Splunk Attack Range
source | version: 4