T1083 Splunk · SPL

Detect File and Directory Discovery in Splunk

Adversaries may enumerate files and directories or search specific filesystem locations to gather information about a host or network share. This discovery technique helps adversaries identify sensitive files, understand the environment, and shape follow-on behavior such as targeted exfiltration or lateral movement. Common tools include dir, tree, ls, find, locate, and forfiles. Adversaries may also search for credential files, configuration files, or documents with specific extensions using recursive enumeration patterns.

MITRE ATT&CK

Tactic
Discovery
Technique
T1083 File and Directory Discovery
Canonical reference
https://attack.mitre.org/techniques/T1083/

SPL Detection Query

Splunk (SPL)
spl
index=wineventlog (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1)
| eval cmdline=lower(CommandLine)
| eval parent=lower(ParentImage)
// Detect recursive file discovery patterns
| eval IsRecursive=if(match(cmdline, "(/s|/S|-recurse|-r\s|--recursive|-R\s)"), 1, 0)
// Detect credential-hunting file searches
| eval HuntsCredentials=if(match(cmdline, "(\.key|\.pem|\.pfx|\.p12|\.kdbx|id_rsa|authorized_keys|\.ppk|password|passwd|credential|secret|\.aws|web\.config|appsettings)"), 1, 0)
// Detect suspicious parent processes launching discovery
| eval IsSuspiciousParent=if(match(parent, "(winword|excel|powerpnt|outlook|mshta|wscript|cscript|regsvr32|rundll32|msiexec|msedge|chrome|firefox)"), 1, 0)
// Detect sensitive path targeting
| eval TargetsSensitivePath=if(match(cmdline, "(\\\\users\\\\|\\\\appdata\\\\|\\\\documents\\\\|\\\\desktop\\\\|\\\\temp\\\\|\\\\ssh\\\\|\.aws|\.config|inetpub|wwwroot)"), 1, 0)
// Match file discovery process names
| where (match(Image, "(cmd\.exe|powershell\.exe|pwsh\.exe|find\.exe|where\.exe)")
         AND match(cmdline, "(dir\s|tree\s|forfiles|get-childitem|\bgci\b|get-item|find\s|where\s)"))
| eval SuspicionScore=IsRecursive + (IsSuspiciousParent * 2) + TargetsSensitivePath + (HuntsCredentials * 2)
| where SuspicionScore >= 2
| table _time, host, User, Image, CommandLine, ParentImage, ParentCommandLine, IsRecursive, IsSuspiciousParent, TargetsSensitivePath, HuntsCredentials, SuspicionScore
| sort - SuspicionScore, - _time
medium severity medium confidence

Detects file and directory discovery activity using Sysmon Event ID 1 (Process Creation) logs. Evaluates command lines for recursive directory enumeration, credential file targeting, sensitive path access, and suspicious parent processes. Assigns a weighted suspicion score, triggering on scores >= 2. Suspicious parent processes (Office, browsers, script hosts) carry double weight as they strongly indicate post-exploitation activity.

Data Sources

Process: Process CreationCommand: Command ExecutionSysmon Event ID 1

Required Sourcetypes

XmlWinEventLog:Microsoft-Windows-Sysmon/Operational

False Positives & Tuning

  • Backup and archival software performing scheduled recursive filesystem scans
  • IT asset inventory tools enumerating installed files and directories
  • Security scanners and EDR agents conducting file integrity monitoring
  • Developer tools indexing project workspaces on startup
  • File synchronization clients performing reconciliation scans
Download portable Sigma rule (.yml)

Other platforms for T1083


Testing Methodology

Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Recursive Directory Listing via CMD

    Expected signal: Sysmon Event ID 1: Process Create with Image=cmd.exe, CommandLine containing 'dir /s /b C:\Users'. Security Event ID 4688 (if command line auditing enabled). Sysmon Event ID 11: File Create for %TEMP%\df00tech-dir-test.txt. Parent process will be the shell or test runner invoking the command.

  2. Test 2Credential File Search via PowerShell

    Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Get-ChildItem', '-Recurse', '-Force', and credential extensions (.key, .pem, .pfx, id_rsa, .kdbx). Sysmon Event ID 11: File Create for the output file. PowerShell ScriptBlock Log Event ID 4104 with full script.

  3. Test 3File Search via Windows where.exe for Executable Targets

    Expected signal: Sysmon Event ID 1: Process Create with Image=where.exe, CommandLine containing '/r C:\Program Files *.exe'. Security Event ID 4688 with same details if command line auditing is enabled. Sysmon Event ID 11 for the output file creation.

  4. Test 4Tree Command for Full Filesystem Enumeration

    Expected signal: Sysmon Event ID 1: Process Create with Image=cmd.exe, CommandLine containing 'tree /f /a C:\Users'. Security Event ID 4688 if command line auditing is enabled. Sysmon Event ID 11 for the output file creation in TEMP.

  5. Test 5Linux Credential File Discovery via find

    Expected signal: Linux auditd EXECVE records showing find command with -name patterns for credential files. Syslog entries if process accounting is enabled. On systems with Sysmon for Linux: Event ID 1 (Process Create) with CommandLine showing find with credential extension patterns.

Unlock Pro Content

Get the full detection package for T1083 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections