.. /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 {PATH:.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
    Tags
    Execute: CSharp

Execute

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

    msbuild.exe {PATH:.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
    Tags
    Execute: CSharp
  2. Executes generated Logger DLL file with TargetLogger export.

    msbuild.exe /logger:TargetLogger,{PATH_ABSOLUTE:.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
    Tags
    Execute: DLL
  3. Execute JScript/VBScript code through XML/XSL Transformation. Requires Visual Studio MSBuild v14.0+.

    msbuild.exe {PATH:.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
    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 @{PATH:.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
    Tags
    Execute: CMD