01 / TRADECRAFT
2 examplesCommand reference
Compile2
EXAMPLE 01T1127
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.
COMMAND
csc.exe -out:{PATH:.exe} {PATH:.cs}EXAMPLE 02T1127
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.
COMMAND
csc -target:library {PATH:.cs}02 / ON DISK
Known paths
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exeC:\Windows\Microsoft.NET\Framework64\v4.0.30319\Csc.exeC:\Windows\Microsoft.NET\Framework\v3.5\csc.exeC:\Windows\Microsoft.NET\Framework64\v3.5\csc.exeC:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exeC:\Windows\Microsoft.NET\Framework64\v2.0.50727\csc.exe03 / DEFENSIVE INTELLIGENCE
4 resourcesDetection & indicators
- Sigmaproc_creation_win_csc_susp_parent.ymlgithub.com
- Sigmaproc_creation_win_csc_susp_folder.ymlgithub.com
- Elasticdefense_evasion_dotnet_compiler_parent_process.tomlgithub.com
- Elasticdefense_evasion_execution_msbuild_started_unusal_process.tomlgithub.com
Indicators & detection notes
- IOC
Csc.exe should normally not run as System account unless it is used for development.
FURTHER READING