Skip to content

Latest commit

 

History

History
80 lines (43 loc) · 2.72 KB

msbuild.md

File metadata and controls

80 lines (43 loc) · 2.72 KB

MSBuild

This is a collection of detection techniques and information for blue teams on how to better detect abuse of Trusted Developer Tools - or MSBuild.exe.

All queries are in CarbonBlack Response, but are easily converted to Sysmon or other EDR products by matching fields.

Netconn or remote retrieval:

process_name:msbuild.exe (cmdline:http OR cmdline:https)

process_name:msbuild.exe netconn_count:[1 TO *]

Spawning off something:

parent_name:wmiprvse.exe process_name:msbuild.exe

parent_name:mshta.exe process_name:msbuild.exe

MsBuild spawning directly off Explorer is highly suspect:

parent_name:explorer.exe process_name:msbuild.exe

Inline tasks:

process_name:msbuild.exe (modload:microsoft.build.tasks.v4.0.dll OR modload:microsoft.build.tasks.v4.0.ni.dll)

process_name:msbuild.exe digsig_result_modload:Unsigned parent_name:cmd.exe

process_name:msbuild.exe crossproc_name:notepad.exe

Interactive use of MsBuild:

process_name:msbuild.exe (parent_name:powershell.exe OR parent_name:cmd.exe)

Injecting into something:

process_name:msbuild.exe AND crossproc_type:"remotethread"

Credential Theft:

process_name:msbuild.exe (modload:vaultcli.dll AND modload:samlib.dll)

Normal / Not Normal

A key point about MsBuild is how it looks from the use of a developer compared to an adversary.

Normal:

MSBuild Normal

MsBuild Normal 2

It's also normal at times to see these being ran via powershell or cmd, similar looking cmdline.

Not Normal:

Not Normal MSBuild

Other Ideas

  • Is it normal for dev's to write/execute .csproj out of non-standard paths? \appdata\local \appdata\roaming\ \programdata\ \downloads\

  • Monitor for non standard file extensions on the command line (.txt,.template) loaded by MsBuild.

  • Is it normal for an Office product to write a .csproj (or renamed .csproj) file to disk?

  • Note that, you should monitor for renamed msbuild on all of these.

Projects / References