Detection rules › Splunk
File and Directory Discovery Output to File - Windows (Sysmon)
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
| Tactic | Techniques |
|---|---|
| Discovery |
References
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
Rule body
id: '16818.27145'
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_sysmon` (TERM(EventCode=1) OR "<EventID>1<")
(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 Sysmon
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_sysmon` (TERM(EventCode=1) OR "<EventID>1<") (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.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"1" |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "<EventID>1<" |
| 1 | tree |
| 1 | dir |
| 1 | "Get-ChildItem" |
| 1 | gci |
| 1 | ls |
| 1 | locate |
| 1 | find |
| 1 | ">>" |
| 1 | ">>" |
| 1 | "Out-File" |