Microsoft Build Engine Started an Unusual Process

An instance of MSBuild, the Microsoft Build Engine, started a PowerShell script or the Visual C# Command Line Compiler. This technique is sometimes used to deploy a malicious payload using the Build Engine.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2020/03/25"
 3integration = ["endpoint", "windows", "system"]
 4maturity = "production"
 5updated_date = "2024/10/28"
 6min_stack_version = "8.14.0"
 7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
 8
 9[rule]
10author = ["Elastic"]
11description = """
12An instance of MSBuild, the Microsoft Build Engine, started a PowerShell script or the Visual C# Command Line Compiler.
13This technique is sometimes used to deploy a malicious payload using the Build Engine.
14"""
15false_positives = [
16    """
17    The Build Engine is commonly used by Windows developers but use by non-engineers is unusual. If a build system
18    triggers this rule it can be exempted by process, user or host name.
19    """,
20]
21from = "now-9m"
22index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.*", "logs-system.security*"]
23language = "kuery"
24license = "Elastic License v2"
25name = "Microsoft Build Engine Started an Unusual Process"
26references = ["https://blog.talosintelligence.com/2020/02/building-bypass-with-msbuild.html"]
27risk_score = 21
28rule_id = "9d110cb3-5f4b-4c9a-b9f5-53f0a1707ae6"
29setup = """## Setup
30
31If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
32events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
33Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
34`event.ingested` to @timestamp.
35For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
36"""
37severity = "low"
38tags = [
39    "Domain: Endpoint",
40    "OS: Windows",
41    "Use Case: Threat Detection",
42    "Tactic: Defense Evasion",
43    "Tactic: Execution",
44    "Data Source: Elastic Defend",
45    "Data Source: System",
46]
47timestamp_override = "event.ingested"
48type = "new_terms"
49
50query = '''
51host.os.type:windows and event.category:process and event.type:start and process.parent.name:("MSBuild.exe" or "msbuild.exe") and
52process.name:("csc.exe" or "iexplore.exe" or "powershell.exe")
53'''
54
55
56[[rule.threat]]
57framework = "MITRE ATT&CK"
58[[rule.threat.technique]]
59id = "T1027"
60name = "Obfuscated Files or Information"
61reference = "https://attack.mitre.org/techniques/T1027/"
62[[rule.threat.technique.subtechnique]]
63id = "T1027.004"
64name = "Compile After Delivery"
65reference = "https://attack.mitre.org/techniques/T1027/004/"
66
67
68[[rule.threat.technique]]
69id = "T1127"
70name = "Trusted Developer Utilities Proxy Execution"
71reference = "https://attack.mitre.org/techniques/T1127/"
72[[rule.threat.technique.subtechnique]]
73id = "T1127.001"
74name = "MSBuild"
75reference = "https://attack.mitre.org/techniques/T1127/001/"
76
77
78
79[rule.threat.tactic]
80id = "TA0005"
81name = "Defense Evasion"
82reference = "https://attack.mitre.org/tactics/TA0005/"
83
84[rule.new_terms]
85field = "new_terms_fields"
86value = ["host.id", "user.name"]
87[[rule.new_terms.history_window_start]]
88field = "history_window_start"
89value = "now-14d"

References

Related rules

to-top