Skip to content
Threat Feed
medium advisory

Detection of Suspicious Dir Piped to Findstr Activity

Adversaries frequently leverage the 'dir' command piped to 'findstr' for reconnaissance to identify sensitive files and credentials on compromised Windows systems.

This detection focuses on the execution of the Windows 'dir' command piped to the 'findstr' utility. This pattern is commonly observed during the reconnaissance and discovery phases of an attack. Attackers use this combination to efficiently enumerate directories and filter output for specific strings, such as passwords, configuration files, or sensitive document extensions. While this command sequence can be used by system administrators for routine maintenance or file searching, its presence in an environment often indicates an adversary mapping the file system to identify targets for exfiltration or lateral movement. Defenders should baseline common administrative scripting activity to minimize false positives while identifying anomalous reconnaissance patterns.

Impact

Successful reconnaissance via this technique allows an attacker to identify high-value targets, configuration files containing hardcoded credentials, and sensitive data residing on the local file system. This intelligence gathering typically precedes further exploitation, data exfiltration, or lateral movement, significantly increasing the risk of credential compromise and unauthorized access to organizational data.

Recommendation

  • Deploy the provided Sigma rule to your SIEM environment to monitor process-creation events for the specified command-line pattern.
  • Establish a baseline of legitimate administrative scripts and user behavior that utilize 'dir' and 'findstr' to tune out frequent false positives.
  • Enable Sysmon or Windows Event Log 4688 to ensure full command-line visibility is captured and indexed for security analysis.

Immediate actions

Deploy Sigma rule and baseline administrative command line patterns.

Detection Engineering 48h

Threat Hunt

Search historical process logs for high-frequency or anomalous 'dir' piping patterns.

T1119 medium medium confidence convert to detection

Data: Process command line arguments

Mitigations

Restrict command line utility access if not required by users.

medium_term IT Operations

T1119

Detection coverage 1

Detect Windows Dir Piped to Findstr

medium

Detects the execution of the 'dir' command piped to 'findstr', a common pattern used by attackers for reconnaissance and file discovery.

sigma tactics: discovery techniques: T1119 sources: process_creation, windows

Detection queries are available on the platform. Get full rules →