Outbound MSHTA Connection
Description
Detects outbound network connections initiated by mshta.exe. mshta.exe is a legitimate Windows binary, but it is frequently abused by adversaries to execute malicious script content from local or remote HTA resources.
This query helps identify suspicious executions.
It is recommended to investigate if you can block mshta in your organization, if not possible use auto isolation rules for suspicious outbound mshta connections.
Query · kql
DeviceNetworkEvents | where InitiatingProcessFileName =~ "mshta.exe" | where RemoteIPType == "Public" or not(ipv4_is_private(RemoteIP)) | project-reorder Timestamp, InitiatingProcessCommandLine, RemoteUrl, RemoteIP, DeviceName, InitiatingProcessAccountUpn