Query Details

Ttp T1127 001 Susp Network Conn MS Build

Query

# TTP Detection Rule: Suspicious network connection from MSBuild

## Query Information

#### MITRE ATT&CK Technique(s)

| Technique ID | Title    | Link    |
| ---  | --- | --- |
|  T1127.001 | Trusted Developer Utilities Proxy Execution: MSBuild | [MSBuild](https://attack.mitre.org/techniques/T1562/001/)|

#### Description
Detection opportunity: MSBuild without commands

In some detections, we observed the Microsoft Build Engine (msbuild.exe) making outbound network connections to IPs associated with the ArechClient2 remote access tool. In general, it is suspicious for msbuild.exe to execute without a corresponding command line, which is precisely what we observed here. Simply looking for execution of msbuild.exe without a corresponding command line and examining surrounding activity for suspicious network connections and child processes could help detect this threat.

#### Risk
FIN7, ZLoader, and FakeBat have been observed performing this behaviour in recent intrusions. Adversaries may modify and/or disable security tools to avoid possible detection of their malware/tools and activities. 

#### Author <Optional>
- **Name:** Gavin Knapp
- **Github:** https://github.com/m4nbat 
- **Twitter:** https://twitter.com/knappresearchlb
- **LinkedIn:** https://www.linkedin.com/in/grjk83/
- **Website:**

#### References
- [https://kqlquery.com/](https://redcanary.com/blog/msix-installers/)

## Defender For Endpoint
```KQL
// Detection opportunity 5: MSBuild without commands
DeviceNetworkEvents
| where InitiatingProcessFileName =~ "msbuild.exe" and (isempty(InitiatingProcessCommandLine) or InitiatingProcessCommandLine =~ "msbuild.exe")
```
## Sentinel
```KQL
// Detection opportunity 5: MSBuild without commands
DeviceNetworkEvents
| where InitiatingProcessFileName =~ "msbuild.exe" and (isempty(InitiatingProcessCommandLine) or InitiatingProcessCommandLine =~ "msbuild.exe")
```

Explanation

The query is looking for suspicious network connections made by the Microsoft Build Engine (msbuild.exe) without a corresponding command line. This behavior has been observed in intrusions by FIN7, ZLoader, and FakeBat. The query can be used in both Defender for Endpoint and Sentinel.

Details

Bert-Jan Pals profile picture

Bert-Jan Pals

Released: January 16, 2024

Tables

DeviceNetworkEvents

Keywords

Devices,Intune,User,KQL,MSBuild,Detection,NetworkConnections,Suspicious,MITREATT&CK,Technique,Rule,DetectionOpportunity,MicrosoftBuildEngine,IPs,ArechClient2,RemoteAccessTool,CommandLine,Activity,Threat,Risk,FIN7,ZLoader,FakeBat,Malware,SecurityTools,Adversaries,Intrusions,Modification,Disable,Detection,Author,Name,Github,Twitter,LinkedIn,Website,References,DefenderForEndpoint,Sentinel.

Operators

where=~andisempty

Actions