Detection rules › Splunk

High Frequency Copy Of Files In Network Share

Status
production
Severity
low
Group by
_time, dest, signature_id, src_ip, user
Author
Teoderick Contreras, Splunk
Source
github.com/splunk/security_content

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.

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.

MITRE ATT&CK coverage

TacticTechniques
Exfiltration

Telemetry coverage

Rule body

name: High Frequency Copy Of Files In Network Share
id: 40925f12-4709-11ec-bb43-acde48001122
version: 11
creation_date: '2021-11-17'
modification_date: '2026-08-05'
author: Teoderick Contreras, Splunk
status: production
type: Anomaly
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.
data_source:
    - Windows Event Log Security 5145
search: |-
    `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`
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: |-
    This behavior may be seen in normal transfer of files within a network if network shares are commonly used for sharing documents.
references:
    - https://attack.mitre.org/techniques/T1537/
    - https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5145#table-of-file-access-codes
intermediate_findings:
    entities:
        - field: src_user
          type: user
          score: 20
          message: High frequency copy of file [$valRelativeTargetName$] into a network share from [$src_ip$] by [$src_user$]
threat_objects:
    - field: src_ip
      type: ip_address
analytic_story:
    - Information Sabotage
    - Insider Threat
    - Hellcat Ransomware
asset_type: Endpoint
mitre_attack_id:
    - T1537
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: endpoint

Stages and Predicates

Stage 1: search

`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$"
)

Stage 2: eval

| eval AccessMask_ = tonumber(AccessMask, 16)

Stage 3: where

| where (bit_and(AccessMask_, 2) != 0) OR (bit_and(AccessMask_, 4) != 0)

Stage 4: bucket

| bucket _time span=5m

Stage 5: stats

| 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

Stage 6: eventstats

| eventstats
    avg(numFileWriteEvents) AS avgFileWriteEvents
    stdev(numFileWriteEvents) AS stdFileWriteEvents
    count AS numSlots
BY dest EventCode src_user

Stage 7: eval

| eval upperThreshold=avgFileWriteEvents + (stdFileWriteEvents * 3)

Stage 8: eval

| eval isOutlier=if(
    numFileWriteEvents > 20
    AND (
        numSlots < 5
        OR numFileWriteEvents >= upperThreshold
    ),
    1,
    0
)
isOutlier =
ifnumFileWriteEvents > 20 AND numSlots < 5 OR numFileWriteEvents >= upperThreshold1
else0

Stage 9: where

| where isOutlier=1

Stage 10: search

| `high_frequency_copy_of_files_in_network_share_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 5145 corpus 23 (splunk 16, elastic 5, kusto 2)
field:"EventID" kind:eq value:"5145"
ObjectTypeeq
  • File corpus 10 (sigma 8, splunk 2)
field:"ObjectType" kind:eq value:"File"
RelativeTargetNamein
  • "*.7z"
  • "*.bmp"
  • "*.db"
  • "*.doc"
  • "*.docx"
  • "*.gif"
  • "*.gz"
  • "*.jpg"
  • "*.key"
  • "*.log"
  • "*.pdf"
  • "*.png"
  • "*.ppt"
  • "*.pptx"
  • "*.rar"
  • "*.rtf"
  • "*.tar"
  • "*.txt"
  • "*.xls"
  • "*.xlsx"
  • "*.zip"
field:"RelativeTargetName" kind:in
ShareNamein
  • "\\\\*\\Admin$"
  • "\\\\*\\C$"
  • "\\\\*\\IPC$"
field:"ShareName" kind:in
isOutliereq
  • 1 corpus 33 (splunk 33)
field:"isOutlier" kind:eq value:"1"