IOC: Csc.exe should normally not run as System account unless it is used for development.
Compile
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
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