Detect Indirect Command Execution With this Free Splunk Rule
Adversaries may abuse utilities that allow for command execution to bypass security restrictions that limit the use of command-line interpreters. Various Windows utilities may be used to execute commands, possibly without invoking cmd. For example, For files, the Program Compatibility Assistant (pcalua.exe), components of the Windows Subsystem for Linux (WSL), as well as other utilities may invoke the execution of programs and commands from a Command and Scripting Interpreter, Run window, or via scripts.
Adversaries may abuse these features for Defense Evasion, specifically to perform arbitrary execution while subverting detections and/or mitigation controls (such as Group Policy) that limit/prevent the usage of cmd or file extensions more commonly associated with malicious payloads.
Tactic: Defense Evasion
Data Sources: File monitoring, Process command-line parameters, Process monitoring, Windows event logs
Defense Bypassed: Application control, Application control by file name or path, Static File Analysis
Forfiles: Forfiles can be used to subvert controls and possibly conceal command execution by not directly invoking cmd.
Revenge RAT: Revenge RAT uses the Forfiles utility to execute commands on the system.
This type of attack technique cannot be easily mitigated with preventive controls since it is based on the abuse of system features.
Monitor and analyze logs from host-based detection mechanisms, such as Sysmon, for events such as process creations that include or are resulting from parameters associated with invoking programs/commands/files and/or spawning child processes/network connections.
Resource of Install Root Certificate With this Free Splunk Detection Rule:
index=windows source=”WinEventLog:Microsoft-Windows-Sysmon/Operational” (EventCode=1 Image=”\\forfiles.exe” CommandLine=”/c*”) OR (EventCode=1 ParentImage=”\\forfiles.exe”) index=windows source=”WinEventLog:Microsoft-Windows-Sysmon/Operational” (EventCode=1 Image=”\\pcalua.exe” CommandLine=”-a”) OR (EventCode=1 ParentImage=”*\\pcalua.exe”)