Indirect Command Execution
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.exe directly. Tools such as Forfiles, the Program Compatibility Assistant (pcalua.exe), Windows Subsystem for Linux (WSL via wsl.exe or bash.exe), Scriptrunner.exe, and ssh.exe may invoke the execution of programs and commands from a scripting interpreter, Run window, or via scripts. Adversaries use these features for Defense Evasion, specifically to perform arbitrary execution while subverting detections and Group Policy controls that restrict cmd.exe usage or block certain file extensions. Real-world actors including Lazarus Group (forfiles for .htm execution), Revenge RAT (forfiles for command execution), and RedCurl (pcalua.exe for binary obfuscation) have demonstrated operational use of this technique.
What is T1202 Indirect Command Execution?
Indirect Command Execution (T1202) maps to the Defense Evasion tactic — the adversary is trying to avoid being detected in MITRE ATT&CK.
This page provides production-ready detection logic for Indirect Command Execution, covering the data sources and telemetry it touches: Process: Process Creation, Command: Command Execution, Microsoft Defender for Endpoint. The queries below are rated medium severity at high confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1202 Indirect Command Execution
- Canonical reference
- https://attack.mitre.org/techniques/T1202/
let IndirectExecutors = dynamic(["forfiles.exe", "pcalua.exe", "scriptrunner.exe", "wsl.exe", "bash.exe", "wscript.exe"]);
let SuspiciousChildProcesses = dynamic(["cmd.exe", "powershell.exe", "pwsh.exe", "mshta.exe", "wscript.exe", "cscript.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe", "bitsadmin.exe", "msbuild.exe", "csc.exe", "net.exe", "net1.exe", "sc.exe", "reg.exe"]);
// Detection 1: Forfiles used to execute commands indirectly
let ForfilesExec = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "forfiles.exe"
| where ProcessCommandLine has_any ("/c", "/C")
| where ProcessCommandLine has_any ("cmd", "powershell", "pwsh", "mshta", "wscript", "cscript", "rundll32", "regsvr32", "certutil", "bitsadmin", "/c ", "0x", "@path", "@file", "@fdate", "@ftime")
| extend ExecutionMethod = "Forfiles"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, ExecutionMethod;
// Detection 2: pcalua.exe used for binary execution bypass
let PcaluaExec = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "pcalua.exe"
| where ProcessCommandLine has_any ("-a", "-i")
| extend ExecutionMethod = "PcaluaBypass"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, ExecutionMethod;
// Detection 3: Scriptrunner.exe proxy execution
let ScriptrunnerExec = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "scriptrunner.exe"
| where ProcessCommandLine has_any ("-appcompat", "/appcompat", "-appcompatpath", ".exe", ".bat", ".ps1", ".cmd")
| extend ExecutionMethod = "Scriptrunner"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, ExecutionMethod;
// Detection 4: WSL/bash used to execute Windows-facing commands or reach out
let WslExec = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("wsl.exe", "bash.exe")
| where ProcessCommandLine has_any ("-e ", "--exec", "-c ", "cmd.exe", "powershell", "net.exe", "curl", "wget", "nc", "ncat", "python", "/mnt/c", "/proc/", "base64")
| extend ExecutionMethod = "WSL"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, ExecutionMethod;
// Detection 5: ssh.exe ProxyCommand / LocalCommand abuse
let SshExec = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "ssh.exe"
| where ProcessCommandLine has_any ("ProxyCommand", "LocalCommand", "-o ProxyCommand", "-o LocalCommand", "PermitLocalCommand")
| extend ExecutionMethod = "SSH-ProxyCommand"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, ExecutionMethod;
// Union all detections
union ForfilesExec, PcaluaExec, ScriptrunnerExec, WslExec, SshExec
| sort by Timestamp desc Detects indirect command execution via commonly abused Windows LOLBins that proxy execution to bypass cmd.exe restrictions and Group Policy controls. Covers five primary vectors: (1) forfiles.exe with /c flag executing interpreters or encoded commands; (2) pcalua.exe (Program Compatibility Assistant) with -a/-i flags launching arbitrary executables; (3) scriptrunner.exe used as an AppCompat shim to proxy execution; (4) wsl.exe or bash.exe invoking Windows-side commands, curl/wget, or accessing Windows filesystem via /mnt/c; (5) ssh.exe abusing ProxyCommand or LocalCommand options for arbitrary command execution. Uses union across five targeted sub-queries for full coverage.
Data Sources
Required Tables
False Positives
- Legitimate administrative use of forfiles.exe for batch file operations, directory traversal, or scheduled maintenance scripts (e.g., deleting files older than N days)
- WSL (wsl.exe/bash.exe) activity from developers who legitimately use Linux tools and access the Windows filesystem via /mnt/c in their daily workflows
- System compatibility infrastructure invoking pcalua.exe when users launch legacy applications that trigger Program Compatibility Assistant automatically
- SSH client usage with ProxyCommand set in ~/.ssh/config for legitimate jump-host configurations or tunneling through bastion hosts
- Scriptrunner.exe invoked by application shims during compatibility testing or software packaging processes
Sigma rule & cross-platform mapping
The detection logic for Indirect Command Execution (T1202) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for T1202
References (12)
- https://attack.mitre.org/techniques/T1202/
- https://community.rsa.com/community/products/netwitness/blog/2017/08/14/are-you-looking-out-for-forfilesexe-if-you-are-watching-for-cmdexe
- https://x.com/vector_sec/status/896049052642533376
- https://x.com/Evi1cg/status/935027922397573120
- https://secureteam.co.uk/2023/01/08/windows-error-reporting-tool-abused-to-load-malware/
- https://www.bleepingcomputer.com/news/security/hackers-abuse-windows-error-reporting-tool-to-deploy-malware/
- https://ss64.com/nt/scriptrunner.html
- https://cyble.com/blog/threat-actor-targets-manufacturing-industry-with-malware/
- https://lolbas-project.github.io/lolbas/Binaries/Forfiles/
- https://lolbas-project.github.io/lolbas/Binaries/Pcalua/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1202/T1202.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_lolbin_forfiles.yml
Testing Methodology
Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Forfiles Indirect Command Execution via cmd.exe
Expected signal: Sysmon Event ID 1: Process Create for forfiles.exe with CommandLine containing '/c cmd /c whoami'. Subsequent Sysmon Event ID 1: Process Create for cmd.exe with ParentImage=forfiles.exe. Sysmon Event ID 11: File Create for the output file in %TEMP%. Security Event ID 4688 (if command line auditing enabled) for both forfiles.exe and cmd.exe.
- Test 2Pcalua.exe Proxy Execution of Calculator (Binary Launch Bypass)
Expected signal: Sysmon Event ID 1: Process Create for pcalua.exe with CommandLine 'pcalua.exe -a calc.exe'. Sysmon Event ID 1: Process Create for calc.exe with ParentImage=pcalua.exe. Security Event ID 4688 for both processes. The parent-child relationship (pcalua → calc) is the key telemetry indicator.
- Test 3WSL Indirect Execution of Windows Binary via /mnt/c
Expected signal: Sysmon Event ID 1: Process Create for wsl.exe with CommandLine containing '-e /bin/sh -c cmd.exe'. Child process creation for cmd.exe or the shell spawned within WSL context. Sysmon Event ID 11: File Create for the output file at C:\Users\Public\. The wsl.exe parent attribution is the key telemetry.
- Test 4Forfiles Execute PowerShell Payload (Simulated Lazarus Group Pattern)
Expected signal: Sysmon Event ID 1: Process Create for forfiles.exe with CommandLine containing 'powershell.exe'. Subsequent Sysmon Event ID 1: Process Create for powershell.exe with ParentImage=forfiles.exe. PowerShell Script Block Logging Event ID 4104 showing the Get-Date command. Sysmon Event ID 11 for the output file.
- Test 5SSH.exe ProxyCommand Arbitrary Command Execution
Expected signal: Sysmon Event ID 1: Process Create for ssh.exe with CommandLine containing 'ProxyCommand' and 'cmd.exe'. Sysmon Event ID 1: Child process create for cmd.exe with ParentImage=ssh.exe. Sysmon Event ID 11: File Create for the output file. Network connection attempt Event ID 3 to localhost:22 (will fail). The ProxyCommand string in the SSH command line is the primary detection indicator.
Response Playbook
Triage
- Identify the specific indirect execution utility flagged (forfiles, pcalua, scriptrunner, wsl, ssh). Each has different risk profiles — forfiles and pcalua are rarely used legitimately by end users, whereas WSL and ssh are common on developer machines.
- Examine the full command line: for forfiles.exe, decode the /c argument to determine what was actually executed. For pcalua.exe, check the -a argument target binary path. For ssh.exe, extract the ProxyCommand value from the -o flag or referenced config file.
- Determine the parent process: was the LOLBin spawned by a user process (explorer.exe, double-click execution), an Office application (winword.exe, excel.exe), a scheduled task (taskeng.exe, svchost.exe), or another suspicious binary? Office → LOLBin is a high-confidence indicator.
- Check the user context: is this a standard end user, a service account, or an admin? Would this specific user have a reason to run forfiles.exe or pcalua.exe? Cross-reference with HR/IT records for developers who use WSL.
- Examine what child processes the LOLBin spawned using a pivot: DeviceProcessEvents | where InitiatingProcessFileName =~ '<lolbin>' and InitiatingProcessId == <pid>. The real payload execution happens in the child process.
- Check for concurrent network connections from either the LOLBin or its children around the same timestamp. Any outbound connections to public IPs during or within 60 seconds of LOLBin execution are highly suspicious.
- Look for file creation events (Sysmon EID 11) around the same timeframe — dropped payloads, staged scripts, or written configuration files (e.g., malicious SSH config) are common follow-on artifacts.
Containment
- If the LOLBin spawned a malicious child process (cmd.exe, powershell.exe) that made external network connections: immediately isolate the endpoint via EDR network isolation or emergency VLAN change.
- If forfiles.exe or pcalua.exe was launched by an Office application: quarantine the triggering Office document and block its hash at email gateway and endpoint AV.
- If ssh.exe ProxyCommand abuse is confirmed: locate and remove or rename the malicious SSH config file (check %USERPROFILE%\.ssh\config and any -F config path in the command line), then rotate any SSH keys on the affected host.
- If WSL was used to reach out externally: disable the WSL feature via PowerShell (Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux) and block wsl.exe and bash.exe execution via AppLocker or WDAC policy.
- If a dropped file or scheduled task was created: remove the artifact and delete any scheduled task entries created by the malicious execution. Check HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache for new entries.
- Revoke and reset credentials for any user accounts whose session was active on the endpoint during the incident, prioritizing accounts with elevated privileges.
Evidence Collection
- Process creation events: Sysmon Event ID 1 for the LOLBin process itself, all child processes it spawned, and the grandchildren. Collect the full process tree up and down from the LOLBin PID.
- Network connection events: Sysmon Event ID 3 for any outbound connections from the LOLBin or its child processes. Note destination IP, port, and protocol.
- File system events: Sysmon Event ID 11 (File Create) and Event ID 23 (File Delete) for files written or removed by the LOLBin process or its children.
- Registry events: Sysmon Event ID 12/13 (Registry Create/Set Value) — persistence mechanisms often accompany indirect execution (e.g., Run keys, scheduled task registry entries, COM hijacking).
- SSH config files: collect %USERPROFILE%\.ssh\config and any SSH config files referenced in the command line. Look for ProxyCommand or LocalCommand directives.
- Prefetch files: C:\Windows\Prefetch\FORFILES.EXE-*.pf, PCALUA.EXE-*.pf, WSL.EXE-*.pf — contain timestamps of last 8 executions and referenced DLLs/files, useful for establishing timeline.
- Windows Event ID 4688 (Security log, process creation with command line auditing enabled) for the LOLBin and child processes if Sysmon is not deployed.
- PowerShell ScriptBlock Logging (Event ID 4104) if the indirect execution eventually invoked PowerShell — provides fully deobfuscated script content.
- Amcache.hve and Shimcache: %SystemRoot%\AppCompat\Programs\Amcache.hve and SYSTEM hive ShimCache — record execution of any binary including those spawned indirectly, with timestamps.
Escalation Criteria
- ! LOLBin was spawned by a Microsoft Office application (winword.exe, excel.exe, outlook.exe, powerpnt.exe) — high confidence weaponized document, escalate immediately.
- ! The indirect execution resulted in a child process making outbound connections to a public IP, particularly on non-standard ports (not 80/443) or using DNS over non-standard ports.
- ! Forfiles or pcalua was used to execute an encoded PowerShell command or a file downloaded from a remote URL — indicates multi-stage payload delivery.
- ! SSH ProxyCommand abuse resulted in execution of a binary not in standard system paths (e.g., from %TEMP%, %APPDATA%, or a user-writable directory).
- ! Multiple hosts in the environment showing the same LOLBin execution pattern within a short time window — may indicate lateral movement, automated propagation, or a mass phishing campaign.
- ! Evidence of persistence establishment following the indirect execution: new scheduled tasks, Run key entries, service installation (Event ID 7045), or new user accounts.
Investigation Guide
Forensic Artifacts
- >
Prefetch: C:\Windows\Prefetch\FORFILES.EXE-*.pf — up to 8 most recent executions with timestamps and referenced file paths - >
Prefetch: C:\Windows\Prefetch\PCALUA.EXE-*.pf — timestamps of pcalua invocations - >
Prefetch: C:\Windows\Prefetch\WSL.EXE-*.pf and BASH.EXE-*.pf — WSL execution history - >
Shimcache (AppCompatCache): HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\AppCompatCache — records binary execution presence and timestamps for forfiles, pcalua, scriptrunner - >
Amcache: %SystemRoot%\AppCompat\Programs\Amcache.hve — detailed execution records including SHA1 hashes of executed binaries, first/last run times - >
SSH config file: %USERPROFILE%\.ssh\config — check for ProxyCommand or LocalCommand directives pointing to unexpected executables - >
SSH known_hosts: %USERPROFILE%\.ssh\known_hosts — reveals hosts the attacker may have connected through - >
Windows Event Log: Security Event ID 4688 (process creation) if command line auditing is enabled via GPO - >
Windows Event Log: Microsoft-Windows-Sysmon/Operational Event ID 1 — process creation with full command line, hash, and parent process details - >
LNK files and recent documents: %APPDATA%\Microsoft\Windows\Recent\*.lnk — may show the document or script that triggered the LOLBin - >
Registry: HKCU\Software\Microsoft\Windows\CurrentVersion\Run and HKLM equivalent — for persistence established post-execution - >
WSL filesystem: %LOCALAPPDATA%\Packages\*\LocalState\rootfs\tmp and /home/<user>/.bash_history — command history within WSL session
Tuning Guidance
Begin by baselining which users and systems legitimately use each utility. Forfiles.exe is almost exclusively used by administrators for batch file maintenance — build a whitelist of known-good command patterns (e.g., 'forfiles /p C:\Logs /s /m *.log /d -30 /c "cmd /c del @path"'). Pcalua.exe in normal environments is invoked automatically by Windows compatibility infrastructure, not manually by users or scripts — any scripted invocation is suspicious. WSL/bash.exe is common on developer workstations; create an allowlist by device group (developer pool vs. standard endpoints) and focus detections on non-developer machines. For ssh.exe, the ProxyCommand pattern is common in development and DevOps environments — tune by extracting the ProxyCommand value and checking if it points to legitimate ssh/nc binaries versus unexpected paths. Suppress alerts where the initiating parent process is a known-good system process (svchost.exe running scheduled tasks for backup operations, msiexec.exe during software installation). Raise severity thresholds for any LOLBin execution where the parent is a Microsoft Office application or a browser — these represent high-confidence weaponized document or drive-by download scenarios and should never be suppressed.
Hunting Queries
Hunt for known indirect execution LOLBins spawning dangerous child processes (interpreters, LOLBins). This reveals the execution chain — the real payload is the child process, not the parent LOLBin. High counts across many devices indicate potential campaign activity.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where InitiatingProcessFileName in~ ("forfiles.exe", "pcalua.exe", "scriptrunner.exe", "wsl.exe", "bash.exe")
| where FileName in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "mshta.exe", "wscript.exe", "cscript.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe", "bitsadmin.exe")
| summarize Count=count(), UniqueDevices=dcount(DeviceName), UniqueUsers=dcount(AccountName), ChildCommands=make_set(ProcessCommandLine, 5) by InitiatingProcessFileName, FileName
| sort by Count desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
(ParentImage="*\\forfiles.exe" OR ParentImage="*\\pcalua.exe" OR ParentImage="*\\scriptrunner.exe" OR ParentImage="*\\wsl.exe" OR ParentImage="*\\bash.exe")
(Image="*\\cmd.exe" OR Image="*\\powershell.exe" OR Image="*\\pwsh.exe" OR Image="*\\mshta.exe" OR Image="*\\wscript.exe" OR Image="*\\cscript.exe" OR Image="*\\rundll32.exe" OR Image="*\\regsvr32.exe" OR Image="*\\certutil.exe" OR Image="*\\bitsadmin.exe")
| stats count as Count, dc(host) as UniqueDevices, dc(User) as UniqueUsers, values(CommandLine) as ChildCommands by ParentImage, Image
| sort - Count Hunt specifically for forfiles.exe /c arguments that invoke interpreters or LOLBins rather than legitimate batch operations. Extracts the actual target of the /c argument to reveal what forfiles is really executing. Excludes standard .bat/.cmd targets to reduce noise from legitimate batch operations.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "forfiles.exe"
| where ProcessCommandLine has_any ("/c", "/C")
| extend ForfilesTarget = extract(@"(?i)/[cC]\s+[\"']?([^\"'\s]+)", 1, ProcessCommandLine)
| where ForfilesTarget !endswith ".bat" and ForfilesTarget !endswith ".cmd"
| where ForfilesTarget !startswith "\"" or ForfilesTarget has_any ("powershell", "cmd", "mshta", "wscript", "cscript", "certutil", "bitsadmin", "rundll32")
| project Timestamp, DeviceName, AccountName, ProcessCommandLine, ForfilesTarget, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1 Image="*\\forfiles.exe" CommandLine="*/c*"
| rex field=CommandLine "(?i)/[cC]\s+[\"']?(?P<ForfilesTarget>[^\"'\s]+)"
| where isnotnull(ForfilesTarget)
| where NOT match(lower(ForfilesTarget), "\.(bat|cmd)$")
| where match(lower(ForfilesTarget), "(powershell|cmd|mshta|wscript|cscript|certutil|bitsadmin|rundll32|regsvr32)")
| table _time, host, User, CommandLine, ForfilesTarget, ParentImage, ParentCommandLine
| sort - _time Hunt for ssh.exe invocations that reference ProxyCommand, LocalCommand, or custom SSH config files. These flags allow arbitrary command execution under the guise of SSH tunneling. The join with network events (KQL) provides context on what connections were actually established, helping distinguish legitimate jump-host usage from abuse.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "ssh.exe"
| where ProcessCommandLine has_any ("ProxyCommand", "LocalCommand", "-o ProxyCommand", "-o LocalCommand", "PermitLocalCommand=yes", "-F ")
| project Timestamp, DeviceName, AccountName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine
| join kind=leftouter (
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where InitiatingProcessFileName =~ "ssh.exe"
| summarize Connections=count(), DestIPs=make_set(RemoteIP, 5) by DeviceName, InitiatingProcessId
) on DeviceName
| sort by Timestamp desc index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1 Image="*\\ssh.exe"
(CommandLine="*ProxyCommand*" OR CommandLine="*LocalCommand*" OR CommandLine="*PermitLocalCommand*" OR CommandLine="*-F *")
| eval SshConfigRef=if(match(CommandLine, "-F\s"), "custom-config-file", "inline")
| table _time, host, User, CommandLine, SshConfigRef, ParentImage, ParentCommandLine
| sort - _time Atomic Red Team Tests
Uses forfiles.exe to indirectly invoke cmd.exe and execute a command without directly calling cmd.exe from the shell. This simulates the technique used by Revenge RAT and Lazarus Group to bypass restrictions on direct cmd.exe invocation. The /c flag passes a command string to the child process. The payload executes whoami and writes the output to a temp file for verification.
Command
forfiles.exe /p C:\Windows\System32 /m notepad.exe /c "cmd /c whoami > %TEMP%\df00tech-forfiles-test.txt" Cleanup
del %TEMP%\df00tech-forfiles-test.txt 2>nul Expected Telemetry
Sysmon Event ID 1: Process Create for forfiles.exe with CommandLine containing '/c cmd /c whoami'. Subsequent Sysmon Event ID 1: Process Create for cmd.exe with ParentImage=forfiles.exe. Sysmon Event ID 11: File Create for the output file in %TEMP%. Security Event ID 4688 (if command line auditing enabled) for both forfiles.exe and cmd.exe.
Expected Detection
Alert fires on forfiles.exe with /c argument invoking cmd. KQL: ForfilesExec subquery matches, ExecutionMethod=Forfiles. SPL: IsForfiles=1, SuspicionScore >= 1. Parent-child detection also fires showing cmd.exe spawned from forfiles.exe.
Uses pcalua.exe (Program Compatibility Assistant) to indirectly launch an arbitrary executable via the -a flag. This simulates the RedCurl group technique of using pcalua.exe to obfuscate binary execution. In a real attack, the -a argument would point to a malicious binary. This test uses calc.exe as a benign substitute.
Command
pcalua.exe -a calc.exe Cleanup
taskkill /im calc.exe /f 2>nul Expected Telemetry
Sysmon Event ID 1: Process Create for pcalua.exe with CommandLine 'pcalua.exe -a calc.exe'. Sysmon Event ID 1: Process Create for calc.exe with ParentImage=pcalua.exe. Security Event ID 4688 for both processes. The parent-child relationship (pcalua → calc) is the key telemetry indicator.
Expected Detection
Alert fires on pcalua.exe with -a flag. KQL: PcaluaExec subquery matches, ExecutionMethod=PcaluaBypass. SPL: IsPcalua=1, SuspicionScore >= 1. Hunting query reveals pcalua.exe spawning calc.exe as child process.
Uses Windows Subsystem for Linux to execute a Windows binary by referencing the Windows filesystem through the WSL /mnt/c mount point. Adversaries use this technique to invoke Windows tools from within the WSL execution context, blending Windows and Linux execution to confuse EDR parent-process attribution. Requires WSL to be installed.
Command
wsl.exe -e /bin/sh -c "cmd.exe /c whoami > /mnt/c/Users/Public/df00tech-wsl-test.txt" Cleanup
del C:\Users\Public\df00tech-wsl-test.txt 2>nul Expected Telemetry
Sysmon Event ID 1: Process Create for wsl.exe with CommandLine containing '-e /bin/sh -c cmd.exe'. Child process creation for cmd.exe or the shell spawned within WSL context. Sysmon Event ID 11: File Create for the output file at C:\Users\Public\. The wsl.exe parent attribution is the key telemetry.
Expected Detection
Alert fires on wsl.exe with -e flag and cmd.exe reference. KQL: WslExec subquery matches, ExecutionMethod=WSL. SPL: IsWsl=1, SuspicionScore >= 1.
Simulates the Lazarus Group technique of using forfiles.exe to execute a PowerShell command, bypassing controls that restrict direct PowerShell invocation. The /c argument passes a powershell.exe invocation that runs a benign command (Get-Date). In real attacks, this payload would contain a download cradle or encoded malicious script.
Command
forfiles.exe /p C:\Windows\System32 /m notepad.exe /c "powershell.exe -NoProfile -Command Get-Date | Out-File %TEMP%\df00tech-forfiles-ps-test.txt" Cleanup
del %TEMP%\df00tech-forfiles-ps-test.txt 2>nul Expected Telemetry
Sysmon Event ID 1: Process Create for forfiles.exe with CommandLine containing 'powershell.exe'. Subsequent Sysmon Event ID 1: Process Create for powershell.exe with ParentImage=forfiles.exe. PowerShell Script Block Logging Event ID 4104 showing the Get-Date command. Sysmon Event ID 11 for the output file.
Expected Detection
Alert fires on forfiles.exe invoking powershell.exe. KQL: ForfilesExec matches, and if the PowerShell detection is also active, a correlated alert fires. SPL: IsForfiles=1, SuspicionScore >= 1. Parent-child hunting query shows powershell.exe spawned from forfiles.exe — a strong indicator even without the forfiles detection firing.
Abuses the SSH client's ProxyCommand option via the -o flag to execute an arbitrary command instead of establishing a real SSH connection. The ProxyCommand value is executed by the shell before the SSH handshake, making it a proxy execution primitive. This technique was observed in campaigns using ssh.exe for defense evasion. The command executes whoami and the SSH connection intentionally fails (no server), but the ProxyCommand execution still occurs.
Command
ssh.exe -o "ProxyCommand=cmd.exe /c whoami > %TEMP%\df00tech-ssh-proxy-test.txt" localhost Cleanup
del %TEMP%\df00tech-ssh-proxy-test.txt 2>nul Expected Telemetry
Sysmon Event ID 1: Process Create for ssh.exe with CommandLine containing 'ProxyCommand' and 'cmd.exe'. Sysmon Event ID 1: Child process create for cmd.exe with ParentImage=ssh.exe. Sysmon Event ID 11: File Create for the output file. Network connection attempt Event ID 3 to localhost:22 (will fail). The ProxyCommand string in the SSH command line is the primary detection indicator.
Expected Detection
Alert fires on ssh.exe with ProxyCommand in command line. KQL: SshExec subquery matches, ExecutionMethod=SSH-ProxyCommand. SPL: IsSshProxy=1, SuspicionScore >= 1. SSH hunting query returns this event showing inline ProxyCommand reference.