name: Suspicious mshta child process
id: 60023bb6-5500-11eb-ae93-0242ac130002
version: 1
date: '2021-01-12'
author: Michael Haag, Splunk
type: batch
datamodel:
- Endpoint
description: The following analytic identifies child processes spawning from  "mshta.exe".
  The search will return the first time and last time these command-line arguments
  were used for these executions, as well as the target system, the user, parent process
  "mshta.exe" and its child process.
search: '| tstats `security_content_summariesonly` count values(Processes.process_name)
  as process_name values(Processes.process) as process min(_time) as firstTime max(_time)
  as lastTime from datamodel=Endpoint.Processes where Processes.parent_process_name=mshta.exe
  AND (Processes.process_name=powershell.exe OR Processes.process_name=colorcpl.exe
  OR Processes.process_name=msbuild.exe OR Processes.process_name=microsoft.workflow.compiler.exe
  OR Processes.process_name=searchprotocolhost.exe OR Processes.process_name=scrcons.exe
  OR Processes.process_name=cscript.exe OR Processes.process_name=wscript.exe OR Processes.process_name=powershell.exe
  OR Processes.process_name=cmd.exe) by Processes.dest Processes.parent_process Processes.user
  | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
  | `suspicious_mshta_child_process_filter`'
how_to_implement: To successfully implement this search, you need to be ingesting
  logs with the process name, parent process, and command-line executions from your
  endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the
  Sysmon TA.
known_false_positives: Although unlikely, some legitimate applications may exhibit
  this behavior, triggering a false positive.
references:
- https://github.com/redcanaryco/AtomicTestHarnesses
- https://redcanary.com/blog/introducing-atomictestharnesses/
tags:
  analytic_story:
  - Suspicious MSHTA Activity
  asset_type: Endpoint
  automated_detection_testing: passed
  cis20:
  - CIS 8
  dataset:
  - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1218.005/atomic_red_team/windows-sysmon.log
  kill_chain_phases:
  - Exploitation
  mitre_attack_id:
  - T1218.005
  nist:
  - PR.PT
  - DE.CM
  product:
  - Splunk Enterprise
  - Splunk Enterprise Security
  - Splunk Cloud
  required_fields:
  - _time
  - Processes.process_name
  - Processes.process
  - Processes.parent_process_name
  - Processes.dest
  - Processes.parent_process
  - Processes.user
  security_domain: endpoint
