.. /Csc.exe
Star

Compile

Binary file used by .NET Framework to compile C# code

Paths:

Resources:

Detections:

Compile

  1. Use csc.exe to compile C# code, targeting the .NET Framework, stored in the specified .cs file and output the compiled version to the specified .exe path.

    csc.exe -out:{PATH:.exe} {PATH:.cs}
    Use case
    Compile attacker code on system. Bypass defensive counter measures.
    Privileges required
    User
    Operating systems
    Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
    ATT&CK® technique
    T1127
  2. Use csc.exe to compile C# code, targeting the .NET Framework, stored in the specified .cs file and output the compiled version to a DLL file with the same name.

    csc -target:library {PATH:.cs}
    Use case
    Compile attacker code on system. Bypass defensive counter measures.
    Privileges required
    User
    Operating systems
    Windows vista, Windows 7, Windows 8, Windows 8.1, Windows 10, Windows 11
    ATT&CK® technique
    T1127