detect-suspicious-mshta-usage
Description
This query was originally published in the threat analytics report, Ursnif (Gozi) continues to evolve. Microsoft HTML Applications, or HTAs, are executable files that use the same technologies and models as Internet Explorer, but do not run inside of a web browser. Mshta.exe is a Windows utility that provides a host for HTA files to run in. Although it has legitimate uses, attackers can use mshta.exe to run malicious Javascript or VBScript commands. The MITRE ATT&CK framework includes Mshta among its list of enterprise attack techniques. The following query detects when mshta.exe has been run, which might include illegitimate usage by attackers. References: https://docs.microsoft.com/previous-versions/ms536496(v=vs.85) https://attack.mitre.org/techniques/T1170/
Query · kql
// mshta.exe script launching processes DeviceProcessEvents | where Timestamp > ago(7d) and InitiatingProcessFileName =~ 'mshta.exe' and InitiatingProcessCommandLine contains '<script>'