Detection rules › Splunk

Windows Copy Files (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

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

References

Telemetry coverage

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.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq value:"4688"
processregex_match
  • "(?i)(((^|\s+)copy|(xcopy|robocopy)(.exe)?\"?)\s+)" corpus 2 (splunk 2)
field:"CommandLine" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4688<"
1copy
1xcopy
1robocopy