Detection rules › Splunk

File and Directory Discovery Output to File - Windows (Windows Event Log)

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

Adversaries may enumerate files and directories or may search in specific locations of a host or network share for certain information within a file system. Adversaries may use the information from File and Directory Discovery during automated discovery to shape follow-on behaviors, including whether or not the adversary fully infects the target and/or attempts specific actions

MITRE ATT&CK coverage

TacticTechniques
Discovery

References

Telemetry coverage

Rule body

id: '16818.26804'
title: File and Directory Discovery Output to File - Windows
description: 'Adversaries may enumerate files and directories or may search in specific
  locations of a host or network share for certain information within a file system.
  Adversaries may use the information from File and Directory Discovery during automated
  discovery to shape follow-on behaviors, including whether or not the adversary fully
  infects the target and/or attempts specific actions. -- Threat Actor Association:
  APT28 (aka. Fancy Bear, Forest Blizzard, Strontium, Tsar Team) -- Atomics T1083
  Test #1 Atomics T1083 Test #5'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) (TERM(tree) OR TERM(dir) OR TERM(Get-ChildItem)
  OR TERM(gci) OR TERM(ls) OR TERM(locate) OR TERM(find)) (TERM(>>) OR ">>"
  OR TERM(Out-File)) | table _time, host, user process, process_*, parent_process_name
  | bin span=1s | stats values(*) as * by _time, host '
techniques:
- discovery:file and directory discovery
technique_id: 
- T1083
data_category:
- Windows event logs
references:
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1083/T1083.md#atomic-test-1---file-and-directory-discovery-cmdexe

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) (TERM(tree) OR TERM(dir) OR TERM(Get-ChildItem) OR TERM(gci) OR TERM(ls) OR TERM(locate) OR TERM(find)) (TERM(>>) OR ">>" OR TERM(Out-File))

Stage 2: table

| table _time, host, user process, process_*, parent_process_name

Stage 3: bucket

| bin span=1s

Stage 4: 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"

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4688<"
1tree
1dir
1"Get-ChildItem"
1gci
1ls
1locate
1find
1">>"
1">>"
1"Out-File"