Skip to content
Threat Feed
medium threat exploited

Abuse of forfiles.exe for Indirect Command Execution

Attackers utilize the Windows built-in utility 'forfiles.exe' to execute commands against multiple files, a technique leveraged by the Prestige ransomware to facilitate post-exploitation file enumeration and malicious activity.

The built-in Windows utility forfiles.exe is frequently abused by attackers to perform indirect command execution. By selecting specific files and executing a command on each, attackers can systematically interact with data on a compromised system. This technique is often seen during the post-exploitation phase, where threat actors enumerate files, execute secondary payloads, or prepare for data exfiltration. Notably, the Prestige ransomware has been documented using this method to facilitate its operations. Defenders should focus on process execution patterns where forfiles.exe is invoked repeatedly in a short duration, as this deviates significantly from standard administrative usage and is a strong indicator of automated post-exploitation activity.

Impact

Successful abuse of this technique allows attackers to automate interactions with the filesystem, significantly increasing the efficiency of data exfiltration and the deployment of secondary ransomware components. This activity has been observed in attacks affecting organizations in Eastern Europe, posing a severe risk to data integrity and business continuity if allowed to progress to full encryption or exfiltration stages.

Recommendation

Detection engineering teams should monitor high-frequency process creation events for forfiles.exe.

  • Deploy the provided Sigma rule to detect excessive usage of forfiles.exe by tracking process execution counts within a 1-minute window.
  • Enable Sysmon Event ID 1 or Windows Security Event 4688 to capture comprehensive command-line and parent process metadata.
  • Configure SIEM analytics to alert when the count of forfiles.exe executions per host exceeds a baseline threshold (e.g., 20 processes per minute).

Immediate actions

Deploy the Sigma rule to monitor for excessive forfiles.exe usage

Detection Engineering 48h

Threat Hunt

Search for processes spawning more than 20 forfiles.exe instances per minute

T1202 high high confidence convert to detection

Data: Process creation events

Detection coverage 1

Detect Excessive Forfiles Process Execution

medium

Detects 20 or more executions of forfiles.exe within a 1-minute window, indicative of batch processing for malicious purposes.

sigma tactics: defense_evasion, execution techniques: T1202 sources: process_creation, windows

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