.. /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 pshell.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 project.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,C:\Loggers\TargetLogger.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 project.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 @sample.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