Detection rules › Splunk
Windows Copy Files (Windows Event Log)
Adversaries may search local system sources, such as file systems or local databases, or network shares to find files of interest and sensitive data prior to Exfiltration. Interactive command shells may be in use, and common functionality within cmd may be used to gather information. These events are only detected when a new process is created, or if powershell logging is enabled and used
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Collection |
References
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule body
id: '5685.5946'
title: Windows Copy Files
description: 'Adversaries may search local system sources, such as file systems or
local databases, or network shares to find files of interest and sensitive data
prior to Exfiltration. Interactive command shells may be in use, and common functionality
within cmd may be used to gather information. These events are only detected when
a new process is created, or if powershell logging is enabled and used. Threat Actor
Association: APT29, Evilnum, REvil, TA428, Vice Society Software Association: Black
Basta, SamSam Atomics T1505.003 Test #1'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
"<EventID>4688<" OR Type=Process) (TERM(copy) OR TERM(xcopy) OR TERM(robocopy))
| regex process="(?i)(((^|\s+)copy|(xcopy|robocopy)(\.exe)?\"?)\s+)" | table _time,
host, user signature_id, process, process_*, parent_* | bin span=1s | stats values(*)
as * by _time, host '
techniques:
- collection:data from local system
- execution:command and scripting interpreter
- collection:data from network shared drive
technique_id:
- T1005
- T1059
- T1039
data_category:
- Process command-line parameters
- Windows event logs
references:
- https://book.hacktricks.xyz/exfiltration
- https://www.computerhope.com/xcopyhlp.htm
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) (TERM(copy) OR TERM(xcopy) OR TERM(robocopy))
Stage 2: regex
| regex process="(?i)(((^|\s+)copy|(xcopy|robocopy)(\.exe)?\"?)\s+)"
Stage 3: table
| table _time, host, user signature_id, process, process_*, parent_*
Stage 4: bucket
| bin span=1s
Stage 5: stats
| stats values(*) as * by _time, host
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"4688" |
process | regex_match |
| field:"CommandLine" kind:regex_match |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "<EventID>4688<" |
| 1 | copy |
| 1 | xcopy |
| 1 | robocopy |