.. /Forfiles.exe
Star

Execute
Alternate data streams

Selects and executes a command on a file or set of files. This command is useful for batch processing.


Paths:

Resources:
Acknowledgements:

Detection:

Execute

  1. Executes calc.exe since there is a match for notepad.exe in the c:\windows\System32 folder.

    forfiles /p c:\windows\system32 /m notepad.exe /c calc.exe
    Use case
    Use forfiles to start a new process to evade defensive counter measures
    Privileges required
    User
    Operating systems
    Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
    ATT&CK® technique
    T1202

Alternate data streams

  1. Executes the evil.exe Alternate Data Stream (AD) since there is a match for notepad.exe in the c:\windows\system32 folder.

    forfiles /p c:\windows\system32 /m notepad.exe /c "c:\folder\normal.dll:evil.exe"
    Use case
    Use forfiles to start a new process from a binary hidden in an alternate data stream
    Privileges required
    User
    Operating systems
    Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
    ATT&CK® technique
    T1564.004