| ID | Technique | Tactic |
|---|---|---|
| T1537 | Transfer Data to Cloud Account | Exfiltration |
Detection: High Frequency Copy Of Files In Network Share
Description
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.
Search
1`wineventlog_security`
2EventCode=5145
3RelativeTargetName IN (
4 "*.7z", "*.bmp", "*.db", "*.doc", "*.docx",
5 "*.gif", "*.gz", "*.jpg", "*.key", "*.log",
6 "*.pdf", "*.png", "*.ppt", "*.pptx", "*.rar",
7 "*.rtf", "*.tar", "*.txt", "*.xls", "*.xlsx", "*.zip"
8)
9ObjectType=File
10ShareName IN (
11 "\\\\*\\Admin$",
12 "\\\\*\\C$",
13 "\\\\*\\IPC$"
14)
15
16| eval AccessMask_ = tonumber(AccessMask, 16)
We Select only write-related operations: 0x2 = WriteData (create/write file) 0x4 = AppendData (append to file)
1
2
3| where (bit_and(AccessMask_, 2) != 0) OR (bit_and(AccessMask_, 4) != 0)
4
5
6| bucket _time span=5m
Count write events per host, user and source IP within each time window
1
2| stats
3 values(RelativeTargetName) AS valRelativeTargetName
4 values(ShareName) AS valShareName
5 values(ObjectType) AS valObjectType
6 values(AccessMask) AS valAccessMask
7 values(src_port) AS valSrcPort
8 values(SourceAddress) AS valSrcAddress
9 count AS numFileWriteEvents
10BY dest _time EventCode src_user src_ip
Build a historical baseline for each destination host and user using the average and standard deviation of previous buckets
1
2
3| eventstats
4 avg(numFileWriteEvents) AS avgFileWriteEvents
5 stdev(numFileWriteEvents) AS stdFileWriteEvents
6 count AS numSlots
7BY dest EventCode src_user
8
9
10| eval upperThreshold=avgFileWriteEvents + (stdFileWriteEvents * 3)
11
12| eval isOutlier=if(
13 numFileWriteEvents > 20
14 AND (
15 numSlots < 5
16 OR numFileWriteEvents >= upperThreshold
17 ),
18 1,
19 0
20)
21
22| where isOutlier=1
23
24| `high_frequency_copy_of_files_in_network_share_filter`
Data Source
| Name | Platform | Sourcetype | Source |
|---|---|---|---|
| Windows Event Log Security 5145 | 'XmlWinEventLog' |
'XmlWinEventLog:Security' |
Macros Used
| Name | Value |
|---|---|
| wineventlog_security | eventtype="wineventlog_security" OR Channel="security" OR source="XmlWinEventLog:Security" OR source="WinEventLog:Security" |
| high_frequency_copy_of_files_in_network_share_filter | search * |
high_frequency_copy_of_files_in_network_share_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Annotations
Default Configuration
This detection is configured by default in Splunk Enterprise Security to run with the following settings:
| Setting | Value |
|---|---|
| Disabled | true |
| Cron Schedule | 0 * * * * |
| Earliest Time | -70m@m |
| Latest Time | -10m@m |
| Schedule Window | auto |
| Creates Finding (Notable) | No |
| Creates Intermediate Finding (Risk Event) | Yes |
Implementation
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
This behavior may be seen in normal transfer of files within a network if network shares are commonly used for sharing documents.
Associated Analytic Story
Intermediate Findings
| Message | Entity Field | Entity Type | Risk Score |
|---|---|---|---|
| High frequency copy of file [$valRelativeTargetName$] into a network share from [$src_ip$] by [$src_user$] | src_user | user | 20 |
Threat Objects
| Field | Type |
|---|---|
| src_ip | ip_address |
References
Detection Testing
| Test Type | Status | Dataset | Source | Sourcetype |
|---|---|---|---|---|
| Validation | ✅ Passing | N/A | N/A | N/A |
| Unit | ✅ Passing | Dataset | XmlWinEventLog:Security |
XmlWinEventLog |
| Integration | ✅ Passing | Dataset | XmlWinEventLog:Security |
XmlWinEventLog |
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: GitHub |
Version: 11