← Back to SOC feed Coverage →

Use of MSBuild as LOLBin

kql MEDIUM Azure-Sentinel
DeviceProcessEvents
huntingmicrosoftofficialransomware
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-05T11:00:00Z · Confidence: medium

Hunt Hypothesis

The Use of MSBuild as LOLBin detects adversaries leveraging MSBuild.exe as a command-and-control tool to exfiltrate data and establish persistence. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify early-stage Macaw ransomware activity and disrupt its deployment before significant damage occurs.

KQL Query

DeviceProcessEvents 
| where InitiatingProcessFileName =~ "wmiprvse.exe" 
| where FileName =~ "msbuild.exe" and ProcessCommandLine has "programdata"

Analytic Rule Definition

id: 166c732a-a02e-4c7a-a441-cb74fe3c3f2d
name: Use of MSBuild as LOLBin
description: |
  Prior to deploying Macaw ransomware in an organization, the adversary frequently uses MSBuild.exe as a LOLBin to communicate with the C2.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
tactics:
- Command and control
query: |
  DeviceProcessEvents 
  | where InitiatingProcessFileName =~ "wmiprvse.exe" 
  | where FileName =~ "msbuild.exe" and ProcessCommandLine has "programdata"

Required Data Sources

Sentinel TableNotes
DeviceProcessEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Campaigns/Macaw Ransomware/Use of MSBuild as LOLBin.yaml