name: Suspicious MSBuild Spawn
id: a115fba6-5514-11eb-ae93-0242ac130002
version: 1
date: '2021-01-12'
author: Michael Haag, Splunk
type: batch
datamodel:
- Endpoint
description: The following analytic identifies wmiprvse.exe spawning msbuild.exe.
  This behavior is indicative of a COM object being utilized to spawn msbuild from
  wmiprvse.exe. It is common for MSBuild.exe to be spawned from devenv.exe while using
  Visual Studio. In this instance, there will be command line arguments and file paths.
  In a malicious instance, MSBuild.exe will spawn from non-standard processes and
  have no command line arguments. For example, MSBuild.exe spawning from explorer.exe,
  powershell.exe is far less common and should be investigated.
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=wmiprvse.exe
  AND Processes.process_name=msbuild.exe by Processes.dest Processes.parent_process
  Processes.user | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)`
  | `security_content_ctime(lastTime)` | `suspicious_msbuild_spawn_filter`'
how_to_implement: To successfully implement this search you need to be ingesting information
  on process that include the name of the process responsible for the changes from
  your endpoints into the `Endpoint` datamodel in the `Processes` node.
known_false_positives: Although unlikely, some legitimate applications may exhibit
  this behavior, triggering a false positive.
references:
- https://lolbas-project.github.io/lolbas/Binaries/Msbuild/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1127.001/T1127.001.md
tags:
  analytic_story:
  - Trusted Developer Utilities Proxy Execution MSBuild
  asset_type: Endpoint
  automated_detection_testing: passed
  cis20:
  - CIS 8
  dataset:
  - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1127.001/windows-sysmon.log
  kill_chain_phases:
  - Exploitation
  mitre_attack_id:
  - T1127.001
  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
