Microsoft.Workflow.Compiler.exe
A utility included with .NET that is capable of compiling and executing C# or VB.net code.
Full path
C:\Windows\Microsoft.Net\Framework64\v4.0.30319\Microsoft.Workflow.Compiler.exeCommands
Compile and run code
Microsoft.Workflow.Compiler.exe {PATH} {PATH:.log}Compile and execute C# or VB.net code in a XOML file referenced in the first argument (any extension accepted).
os: Windows 10S, Windows 11
Compile and run code
Microsoft.Workflow.Compiler.exe {PATH} {PATH:.log}Compile and execute C# or VB.net code in a XOML file referenced in the test.txt file.
os: Windows 10S, Windows 11
Compile and run code
Microsoft.Workflow.Compiler.exe {PATH} {PATH:.log}Compile and execute C# or VB.net code in a XOML file referenced in the test.txt file.
os: Windows 10S, Windows 11
Detection
- Sigma https://github.com/SigmaHQ/sigma/blob/c04bef2fbbe8beff6c7620d5d7ea6872dbe7acba/rules/windows/process_creation/proc_creation_win_lolbin_workflow_compiler.yml
- Splunk https://github.com/splunk/security_content/blob/961a81d4a5cb5c5febec4894d6d812497171a85c/detections/endpoint/suspicious_microsoft_workflow_compiler_usage.yml
- Splunk https://github.com/splunk/security_content/blob/18f63553a9dc1a34122fa123deae2b2f9b9ea391/detections/endpoint/suspicious_microsoft_workflow_compiler_rename.yml
- Elastic https://github.com/elastic/detection-rules/blob/414d32027632a49fb239abb8fbbb55d3fa8dd861/rules/windows/defense_evasion_unusual_process_network_connection.toml
- Elastic https://github.com/elastic/detection-rules/blob/414d32027632a49fb239abb8fbbb55d3fa8dd861/rules/windows/defense_evasion_network_connection_from_windows_binary.toml
- BlockRule https://docs.microsoft.com/en-us/windows/security/threat-protection/windows-defender-application-control/microsoft-recommended-block-rules
- IOCMicrosoft.Workflow.Compiler.exe would not normally be run on workstations.
- IOCThe presence of csc.exe or vbc.exe as child processes of Microsoft.Workflow.Compiler.exe
- IOCPresence of "<CompilerInput" in a text file.
Resources
- https://twitter.com/mattifestation/status/1030445200475185154
- https://posts.specterops.io/arbitrary-unsigned-code-execution-vector-in-microsoft-workflow-compiler-exe-3d9294bc5efb
- https://gist.github.com/mattifestation/3e28d391adbd7fe3e0c722a107a25aba#file-workflowcompilerdetectiontests-ps1
- https://gist.github.com/mattifestation/7ba8fc8f724600a9f525714c9cf767fd#file-createcompilerinputxml-ps1
- https://www.forcepoint.com/blog/security-labs/using-c-post-powershell-attacks
- https://www.fortynorthsecurity.com/microsoft-workflow-compiler-exe-veil-and-cobalt-strike/
- https://medium.com/@Bank_Security/undetectable-c-c-reverse-shells-fab4c0ec4f15
acknowledgement: Matt Graeber @mattifestation, John Bergbom @BergbomJohn, FortyNorth Security @FortyNorthSec, Bank Security @Bank_Security