Splunk unknown stable spl
High Frequency Copy Of Files In Network Share
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.
Detection Logic
`wineventlog_security`
EventCode=5145
RelativeTargetName IN (
"*.7z", "*.bmp", "*.db", "*.doc", "*.docx",
"*.gif", "*.gz", "*.jpg", "*.key", "*.log",
"*.pdf", "*.png", "*.ppt", "*.pptx", "*.rar",
"*.rtf", "*.tar", "*.txt", "*.xls", "*.xlsx", "*.zip"
)
ObjectType=File
ShareName IN (
"\\\\*\\Admin$",
"\\\\*\\C$",
"\\\\*\\IPC$"
)
| eval AccessMask_ = tonumber(AccessMask, 16)
```
We Select only write-related operations:
0x2 = WriteData (create/write file)
0x4 = AppendData (append to file)
```
| where (bit_and(AccessMask_, 2) != 0)
OR (bit_and(AccessMask_, 4) != 0)
| bucket _time span=5m
```
Count write events per host, user and source IP within each time window
```
| stats
values(RelativeTargetName) AS valRelativeTargetName
values(ShareName) AS valShareName
values(ObjectType) AS valObjectType
values(AccessMask) AS valAccessMask
values(src_port) AS valSrcPort
values(SourceAddress) AS valSrcAddress
count AS numFileWriteEvents
BY 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
```
| eventstats
avg(numFileWriteEvents) AS avgFileWriteEvents
stdev(numFileWriteEvents) AS stdFileWriteEvents
count AS numSlots
BY dest EventCode src_user
| eval upperThreshold=avgFileWriteEvents + (stdFileWriteEvents * 3)
| eval isOutlier=if(
numFileWriteEvents > 20
AND (
numSlots < 5
OR numFileWriteEvents >= upperThreshold
),
1,
0
)
| where isOutlier=1
| `high_frequency_copy_of_files_in_network_share_filter` False Positives
- ⚠ This behavior may be seen in normal transfer of files within a network if network shares are commonly used for sharing documents.
Field Validations
Loading…
Comments (0)
Loading comments...