Skip to content
Threat Feed
high advisory

Suspicious JavaScript Execution Via Mshta.EXE

Detection of attackers using the Windows mshta.exe utility to execute malicious JavaScript code for living-off-the-land stealth execution.

This brief addresses the abuse of mshta.exe, a legitimate Windows utility designed to execute Microsoft HTML Applications (.hta). Attackers leverage this binary to execute arbitrary JavaScript or VBScript via command-line arguments to bypass security controls. By passing script code directly to mshta.exe, malicious actors achieve fileless execution or stage secondary payloads without triggering standard script-based blocklists. This technique is frequently observed in the early stages of post-exploitation to establish persistence or execute initial loader scripts. Defenders should monitor for command-line arguments explicitly invoking JavaScript engines through mshta.exe.

Impact

Successful abuse of mshta.exe allows attackers to execute code in the context of the current user, potentially facilitating credential harvesting, malware delivery, or lateral movement within an environment.

Recommendation

Deploy the provided Sigma rule to detect suspicious process creation events involving mshta.exe. Ensure process-level command-line logging is enabled via Sysmon (Event ID 1) or Windows Security Event Logs (Event ID 4688 with command line auditing enabled). Investigate any instances where mshta.exe is launched from non-standard parent processes or contains obfuscated script content.


Immediate actions

Deploy the provided Sigma rule to SIEM

Detection Engineering 48h

Threat Hunt

Search for mshta.exe execution containing 'javascript:' or 'vbscript:' in command lines

T1218.005 high high confidence hunt now

Data: Process creation logs

Detection coverage 1

Detect Suspicious JavaScript Execution Via Mshta.EXE

high

Detects execution of JavaScript code using mshta.exe, a technique used by attackers for fileless payload delivery.

sigma tactics: stealth techniques: T1218.005 sources: process_creation, windows

Detection queries are available on the platform. Get full rules →