Analytics Story: Suspicious MSHTA Activity
Description
Monitor and detect techniques used by attackers who leverage the mshta.exe process to execute malicious code.
Why it matters
One common adversary tactic is to bypass application control solutions via the mshta.exe process, which loads Microsoft HTML applications (mshtml.dll) with the .hta suffix. In these cases, attackers use the trusted Windows utility to proxy execution of malicious files, whether an .hta application, javascript, or VBScript. The searches in this story help you detect and investigate suspicious activity that may indicate that an attacker is leveraging mshta.exe to execute malicious code. Triage Validate execution
- Determine if MSHTA.exe executed. Validate the OriginalFileName of MSHTA.exe and further PE metadata. If executed outside of c:\windows\system32 or c:\windows\syswow64, it should be highly suspect.
- Determine if script code was executed with MSHTA. Situational Awareness The objective of this step is meant to identify suspicious behavioral indicators related to executed of Script code by MSHTA.exe.
- Parent process. Is the parent process a known LOLBin? Is the parent process an Office Application?
- Module loads. Are the known MSHTA.exe modules being loaded by a non-standard application? Is MSHTA loading any suspicious .DLLs?
- Network connections. Any network connections? Review the reputation of the remote IP or domain. Retrieval of script code The objective of this step is to confirm the executed script code is benign or malicious.
Detections
Data Sources
Name | Platform | Sourcetype | Source |
---|---|---|---|
CrowdStrike ProcessRollup2 | N/A | crowdstrike:events:sensor |
crowdstrike |
Sysmon EventID 1 | Windows | xmlwineventlog |
XmlWinEventLog:Microsoft-Windows-Sysmon/Operational |
Sysmon EventID 11 | Windows | xmlwineventlog |
XmlWinEventLog:Microsoft-Windows-Sysmon/Operational |
Sysmon EventID 12 | Windows | xmlwineventlog |
XmlWinEventLog:Microsoft-Windows-Sysmon/Operational |
Sysmon EventID 13 | Windows | xmlwineventlog |
XmlWinEventLog:Microsoft-Windows-Sysmon/Operational |
Windows Event Log Security 4688 | Windows | xmlwineventlog |
XmlWinEventLog:Security |
References
- https://redcanary.com/blog/introducing-atomictestharnesses/
- https://redcanary.com/blog/windows-registry-attacks-threat-detection/
- https://attack.mitre.org/techniques/T1218/005/
- https://medium.com/@mbromileyDFIR/malware-monday-aebb456356c5
Source: GitHub | Version: 2