.. /Msbuild.exe
Star

AWL bypass (CSharp)
Execute (CSharp, DLL, XSL, CMD)

Used to compile and execute code

Paths:

Resources:

Acknowledgements:

Detections:

AWL bypass

  1. Build and execute a C# project stored in the target XML file.

    msbuild.exe file.xml
    Use case
    Compile and run code
    Privileges required
    User
    Operating systems
    Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
    ATT&CK® technique
    T1127.001: MSBuild
    Tags
    Execute: CSharp

Execute

  1. Build and execute a C# project stored in the target csproj file.

    msbuild.exe file.csproj
    Use case
    Compile and run code
    Privileges required
    User
    Operating systems
    Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
    ATT&CK® technique
    T1127.001: MSBuild
    Tags
    Execute: CSharp
  2. Executes generated Logger DLL file with TargetLogger export.

    msbuild.exe /logger:TargetLogger,C:\Windows\Temp\file.dll;MyParameters,Foo
    Use case
    Execute DLL
    Privileges required
    User
    Operating systems
    Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
    ATT&CK® technique
    T1127.001: MSBuild
    Tags
    Execute: DLL
  3. Execute JScript/VBScript code through XML/XSL Transformation. Requires Visual Studio MSBuild v14.0+.

    msbuild.exe file.proj
    Use case
    Execute project file that contains XslTransformation tag parameters
    Privileges required
    User
    Operating systems
    Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
    ATT&CK® technique
    T1127.001: MSBuild
    Tags
    Execute: XSL
  4. By putting any valid msbuild.exe command-line options in an RSP file and calling it as above will interpret the options as if they were passed on the command line.

    msbuild.exe @file.rsp
    Use case
    Bypass command-line based detections
    Privileges required
    User
    Operating systems
    Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
    ATT&CK® technique
    T1036: Masquerading
    Tags
    Execute: CMD