OpenWith.exe Executes Specified Binary

Last updated on:

Rule name

Rule type

Log sources

MITRE ATT&CK tags

Severity

OpenWith.exe Executes Specified Binary

Standard

Windows

Defense Evasion: System Binary Proxy Execution (T1218)

Critical

About the rule

Rule Type

Standard

Rule Description

OpenWith.exe is a legitimate Windows system utility that helps users choose which program to use when opening a file type without a default handler. However, threat actors can abuse this utility to execute arbitrary binaries under the guise of a system process stealthily, potentially bypassing security controls or user suspicion. When used maliciously, OpenWith.exe may be leveraged to run payloads from non-standard paths or as part of a larger evasion or execution chain, especially in living-off-the-land (LotL) attacks. This behavior is often seen in evasive malware campaigns aiming to blend in with normal OS activities.

Severity

Trouble

Rule journey

Attack chain scenario

Initial Access → Privilege Escalation → Execution Abuse via OpenWith.exe → Defense Evasion → Lateral Movement

Impact

  • Privilege escalation
  • Defense Evasion
  • Persistence
  • Lateral Movement

Rule Requirement

Prerequisites


Using Windows event viewer:
To enable detailed process tracking in a domain environment, log in to a domain controller using domain admin credentials and open the Group Policy Management Console (GPMC). Create or edit a GPO linked to the target OU and navigate to the Advanced Audit Policy Configuration section to enable success auditing for both process creation and termination. To capture command-line details, enable the Include command line in process creation events setting under Audit Process Creation. Additionally, create the Microsoft-Windows-Security-Auditing/Operational registry key in the specified EventLog path to support enhanced auditing.

Using Sysmon:
To enable detailed process monitoring using Sysmon, first download and install it from Microsoft Sysinternals. Run Command Prompt as an administrator and install Sysmon with a configuration file that includes process creation tracking using sysmon.exe -i [configfile.xml]. Ensure your configuration includes a <ProcessCreate> filter to capture all process creation events. Additionally, create the Microsoft-Windows-Sysmon/Operational registry key under the EventLog path if it doesn’t already exist.

Criteria

Action1: actionname = "Process started" AND PROCESSNAME endswith "\OpenWith.exe" AND COMMANDLINE contains "/c" select Action1.HOSTNAME,Action1.MESSAGE,Action1.COMMANDLINE,Action1.FILE_NAME,Action1.PROCESSNAME,Action1.USERNAME,Action1.PARENTPROCESSNAME

Detection

Execution Mode

realtime

Log Sources

Windows

MITRE ATT&CK

Defense Evasion: System Binary Proxy Execution (T1218)

Security Standards

Enabling this rule will help you meet the security standard's requirement listed below:

PR.PS-01: Configuration management practices are established and applied
ID.RA-01: Vulnerabilities in assets are identified, validated, and recorded

When this rule is triggered, you're notified of an attempt to abuse OpenWith.exe, a trusted Windows binary, to execute arbitrary or malicious code.

Author

Beyu Denis, oscd.community (rule), @harr0ey (idea)

Future actions

Known False Positives

In development or testing environments, engineers might use OpenWith.exe for debugging or compatibility checks.

Next Steps

When this rule is triggered, the following measures can be implemented:

  • Identification: Review the event to identify the binary being executed via OpenWith.exe. Confirm whether the behavior aligns with standard user activity or software behavior, or if it was initiated by a suspicious process or user.
  • Analysis: Investigate the parent process and command-line arguments associated with the execution. Use EDR or SIEM tools to trace the activity timeline.
  • Response: Isolate the host, terminate suspicious processes, and perform a full malware scan.
  • Application Control: Implement application whitelisting to restrict the execution of unapproved binaries, especially through legitimate Windows utilities like OpenWith.exe.

Mitigation

Mitigation ID

Mitigation Name

Mitigation description

M1042

Disable or Remove Feature or Program

Many native binaries may not be necessary within a given environment.

M1038

Execution Prevention

Restrict the execution of binaries that are susceptible to abuse and not required for a given system or network.

M1050

Exploit Protection

Microsoft's Enhanced Mitigation Experience Toolkit (EMET) Attack Surface Reduction (ASR) feature can help block methods that use trusted binaries to bypass application control.

M1037

Filter Network Traffic

Utilize network appliances to filter incoming and outgoing traffic and perform protocol-based filtering. Also, configure software on endpoints to filter network traffic.

M1026

Privileged Account Management

Restrict execution of particularly vulnerable binaries to privileged accounts or groups that need to use it to lessen the opportunities for malicious usage.

M1021

Restrict Web-Based Content

Restrict the use of certain websites, block downloads and attachments, disable JavaScript, and limit browser extensions to enhance security.

-