Skip to main content
T1202Defense Evasionmedium difficulty

Indirect Command Execution

Indirect Command Execution (T1202) is command execution without a command-line interpreter in the process chain: attackers abuse built-in utilities like Forfiles, pcalua.exe (Program Compatibility Assistant), and Scriptrunner.exe to launch payloads. The command shows up nowhere near cmd.exe or powershell.exe, so rules that only watch the interpreter miss it entirely. Detection has to move upstream to the launcher itself.

Practice detecting Indirect Command Execution on realistic SIEM, XDR alerts in SOCSimulator Operations.

SIEMXDR

What is Indirect Command Execution?

Indirect Command Execution is documented as technique T1202 in MITRE ATT&CK® v19.1 under the Defense Evasion tactic. Detection requires visibility into SIEM, XDR telemetry.

The mechanic is delegation. Forfiles is a file-search utility that supports a /c switch to run a command against every file it matches, so forfiles.exe /p C:\Windows\System32 /m notepad.exe /c "cmd.exe /c <payload>" quietly runs the payload once, using notepad.exe as a throwaway search target it never actually touches. Pcalua.exe, the Program Compatibility Assistant, does the same thing with its -a flag: pcalua -a <path> is meant to relaunch a program under compatibility settings, but it will relaunch anything handed to it, including a dropped executable or a script.

Neither binary is flagged by application-control policies that block cmd.exe or powershell.exe directly, because forfiles and pcalua are Microsoft-signed utilities with legitimate uses (batch file operations, compatibility troubleshooting) that ship on every Windows install. That is the entire value proposition for the attacker: the parent process in the telemetry is boring, and unless a rule specifically watches the command-line arguments to these tools, the execution looks like nothing happened.

Scriptrunner.exe (part of Microsoft Intune's management agent) and WSL components (wsl.exe, bash.exe) extend the same idea to Linux userland or MDM tooling: an attacker with local access invokes a subsystem the security stack was not built to inspect. In practice the two variants a SOC analyst hits most often are forfiles and pcalua, because both are present on stock Windows with no extra install and both are documented, working LOLBINs with public proof-of-concept commands.

Where Indirect Command Execution fits in an attack

Indirect command execution shows up after initial access, typically as the first local-execution step following a phishing attachment, a malicious shortcut, or an exploited document. It is a delivery and evasion technique, not an objective on its own: the attacker's real goal is whatever pcalua or forfiles launches next, usually a PowerShell downloader, a script that fetches a second stage, or a dropped binary that establishes persistence.

It sits alongside other Defense Evasion techniques the same intrusion typically uses, most often Signed Binary Proxy Execution (T1218) for the next hop and Obfuscated Files or Information (T1027) to hide the payload the launcher is calling. Because the technique's entire purpose is bypassing command-line restrictions, it is disproportionately common in environments running application allow-listing or command-line logging policies that block cmd.exe and powershell.exe outright: attackers reach for forfiles or pcalua specifically because those controls do not cover them, which is itself a useful triage signal when the rule fires in a hardened environment.

Detection Strategies

The following detection strategies help SOC analysts identify Indirect Command Execution activity. These methods apply across SIEM, XDR environments and can be implemented as detection rules, correlation queries, or behavioral analytics in your security platform.

SPL
| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime
FROM datamodel=Endpoint.Processes
WHERE Processes.parent_process="*pcalua* -a*"
BY Processes.dest Processes.parent_process Processes.parent_process_name
   Processes.process Processes.process_name Processes.user
| `drop_dm_object_name(Processes)`
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`

Direct port of Splunk Security Content's 'Windows Indirect Command Execution Via pcalua' analytic: any process whose parent command line matches pcalua -a, meaning pcalua launched something on the attacker's behalf instead of running its own compatibility check.

Simulated example generated by SOCSimulator Research
EventID: 1
UtcTime: 2026-07-16 03:14:22.118
Image: C:\Windows\System32\forfiles.exe
CommandLine: forfiles.exe /p C:\Windows\System32 /m notepad.exe /c "cmd.exe /c powershell.exe -nop -w hidden -enc SQBFAFgA"
User: CORP\jcarter
IntegrityLevel: Medium
ParentImage: C:\Windows\System32\taskeng.exe
ParentCommandLine: taskeng.exe

Tuning and false positives

Forfiles has legitimate batch-processing uses, IT scripts that loop over log files, backup jobs that clean up old exports, or software deployment tooling that touches files matching a pattern. Pcalua.exe genuinely does run when a user right-clicks an older application and selects 'Troubleshoot compatibility', which some organizations' help desks still walk end users through for legacy line-of-business software.

The differentiator is the command target and its parent. Forfiles used by a scheduled maintenance task calling a known internal script from an approved path is routine; the same forfiles /c syntax spawning powershell -enc from a user's Temp folder, with no ticket and no prior history on that host, is not. Build a short allow-list of the specific scripts and service accounts your environment legitimately uses forfiles for, then alert on any invocation outside that set. For pcalua, baseline which applications your users actually run through the compatibility wizard; a first-time pcalua -a target pointing at an executable in a Downloads or Public folder is the pattern worth escalating, not the tool itself.

Example Alerts

These realistic alert examples show what Indirect Command Execution looks like in your security tools. Use them to tune detection rules and train analysts to recognize true positives versus false positives in live environments.

HighXDR

Pcalua.exe Launched With -a Flag

pcalua.exe -a C:\Users\Public\update.exe ran on WKS-ACCT-07 with explorer.exe as parent, immediately after the user opened a downloaded compatibility-troubleshooter shortcut. The Program Compatibility Assistant is not normally invoked this way from a shortcut delivered by email.

HighSIEM

Forfiles Proxying Execution With /c

Sysmon Event ID 1 recorded forfiles.exe /p C:\Windows\System32 /m notepad.exe /c "cmd.exe /c powershell -enc <base64>" on FS-02.corp.local, spawned from a scheduled task. Forfiles is being used to run PowerShell without cmd.exe ever appearing as a direct parent.

MediumXDR

Forfiles.exe Running From a Non-Default Path

forfiles.exe executed from C:\Users\jcarter\AppData\Local\Temp\ instead of C:\Windows\System32, with a same-named cmd.exe sitting in the same folder. This is the child-process-masquerading pattern where forfiles picks up the attacker's local copy of cmd instead of the legitimate system binary.

Responding to Indirect Command Execution

When this fires, start with the target: what did forfiles or pcalua actually launch. Pull the full command line, not just the alert summary, since the payload is usually base64-encoded PowerShell or a path to a dropped file. Check the parent process too: a scheduled task or explorer.exe launching the LOLBIN from a user-writable path (Temp, Downloads, Public) is a much stronger signal than the same launcher running from System32 under a known service account.

If the target is an unrecognized script or binary with no legitimate business justification, treat it as active execution, not reconnaissance. Isolate the host, capture the dropped file and any child processes it spawned for analysis, and check for what came immediately after: new scheduled tasks, registry Run key writes, or an outbound connection, since indirect execution is almost always followed within seconds by the real persistence or C2 step. Escalate to full incident response if the host shows any of those follow-on indicators rather than waiting for a second alert to confirm.

Frequently Asked Questions

How do SOC analysts detect Indirect Command Execution?
Detection centers on SIEM, XDR telemetry for the defense evasion phase of the attack. Alert on pcalua.exe whose command line contains the -a flag, the parameter that tells the Program Compatibility Assistant to launch an arbitrary target instead of running its normal compatibility check. Alert on forfiles.exe whose command line contains /c, the switch that lets forfiles run any command against a matched file set, effectively proxying execution through a utility no one associates with code execution.
What does a Indirect Command Execution alert look like?
A representative XDR detection is "Pcalua.exe Launched With -a Flag" (high severity): pcalua.exe -a C:\Users\Public\update.exe ran on WKS-ACCT-07 with explorer.exe as parent, immediately after the user opened a downloaded compatibility-troubleshooter shortcut. The Program Compatibility Assistant is not normally invoked this way from a shortcut delivered by email.
Which tools detect Indirect Command Execution, and how can I practice?
Indirect Command Execution (T1202) is best surfaced with SIEM, XDR telemetry, which exposes the defense evasion signals described above. Practice detecting it on those exact consoles in SOCSimulator Operations, free.
Glossary

What is False Positive? SOC Glossary

A false positive is a security alert that fires on legitimate, benign activity, incorrectly classifying safe behavior as…

Read more
Glossary

What is EDR? SOC Glossary

Endpoint Detection and Response (EDR) is a security technology that continuously monitors endpoint activity, recording p…

Read more
Glossary

What is Threat Hunting? SOC Glossary

Threat hunting is the proactive, human-led process of searching through security telemetry to find hidden threats that e…

Read more
Glossary

What is Log Management? SOC Glossary

Log management is the process of collecting, normalizing, storing, retaining, and analyzing log data from across the IT …

Read more
Career Path

Detection Engineer Career Guide: Salary & Skills

Detection Engineers build the rules, analytics, and automated workflows that determine what the SOC can see. You transla…

Read more
Career Path

Threat Hunter Career Guide: Salary & Skills

Threat Hunters do not wait for alerts. You develop hypotheses based on threat intelligence and adversary behavior models…

Read more
Tool

SIEM Training Console: SOCSimulator

The SIEM console in SOCSimulator replicates the workflow of enterprise platforms like Splunk Enterprise Security, Micros…

Read more
Tool

XDR Training Console: SOCSimulator

The XDR console in SOCSimulator replicates the investigation workflow of platforms like CrowdStrike Falcon, Microsoft De…

Read more
Comparison

SOCSimulator Vs. Letsdefend: Platform Comparison

SOCSimulator wins on operational realism. You get multi-tool shift simulation with SLA pressure, noise injection, and al…

Read more
Glossary

SOC Glossary: Security Operations Terminology

Complete glossary of Security Operations Center terminology for aspiring SOC analysts.

Read more
Feature

Shift Mode: Real-Time SOC Simulation

Practice alert triage under realistic time pressure with SLA timers and noise injection.

Read more
Feature

Operations: Guided Training Operations

Structured CTF-style investigation operations covering real-world attack scenarios.

Read more