Siemphony’s repertoire
.NET compiler launched from a non-development parent process
Matches AN1381's "compilation activity using csc.exe, ilasm.exe... initiated by user-space processes outside typical development environments" in the single event Sigma can carry: the compiler as Image, gated on a ParentImage that is a shell, scripting host or file-explorer process rather than an IDE or build tool. MITRE's ParentProcessName knob is populated here with cmd.exe, powershell.exe, pwsh.exe, wscript.exe, cscript.exe, mshta.exe, rundll32.exe and explorer.exe — the brief names the knob, this list is authored, not MITRE's. msbuild.exe is deliberately left out of both the compiler and parent lists: it is already the subject of the published T1127.001 rule, which matches msbuild.exe spawning a script interpreter — the opposite direction from this rule's csc.exe/ilasm.exe-as-child pattern — and folding it in here would blur the two into one indistinguishable observable. The brief's OutputDirectoryPath and TimeWindow knobs (where the compiled binary lands, and whether it runs or calls out shortly after) have no equivalent in a single process-creation event. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0501, not hand-written and not tested by its author. Any lab result is on this rule's own page.Full descriptionShow less
The detection
The 4 SIEM queries below are previews produced by Siemphony’s own translator, not pySigma, and none has been executed against a real backend — review before you deploy.
detection.yml
title: .NET compiler launched from a non-development parent processid: bbbfc949-e612-4be1-b8a7-d87fa534c597status: experimentaldescription: | Matches AN1381's "compilation activity using csc.exe, ilasm.exe... initiated by user-space processes outside typical development environments" in the single event Sigma can carry: the compiler as Image, gated on a ParentImage that is a shell, scripting host or file-explorer process rather than an IDE or build tool. MITRE's ParentProcessName knob is populated here with cmd.exe, powershell.exe, pwsh.exe, wscript.exe, cscript.exe, mshta.exe, rundll32.exe and explorer.exe — the brief names the knob, this list is authored, not MITRE's. msbuild.exe is deliberately left out of both the compiler and parent lists: it is already the subject of the published T1127.001 rule, which matches msbuild.exe spawning a script interpreter — the opposite direction from this rule's csc.exe/ilasm.exe-as-child pattern — and folding it in here would blur the two into one indistinguishable observable. The brief's OutputDirectoryPath and TimeWindow knobs (where the compiled binary lands, and whether it runs or calls out shortly after) have no equivalent in a single process-creation event. UNVERIFIED AS AUTHORED — derived from MITRE ATT&CK DET0501, not hand-written and not tested by its author. Any lab result is on this rule's own page.references: - https://attack.mitre.org/techniques/T1027/004 - https://attack.mitre.org/detectionstrategies/DET0501author: Siemphony pipeline (machine-derived from MITRE ATT&CK v19.2)date: 2026-08-16tags: - attack.defense-evasion - attack.t1027.004logsource: category: process_creation product: windowsdetection: selection_compiler: Image|endswith: - '\csc.exe' - '\ilasm.exe' selection_parent: ParentImage|endswith: - '\cmd.exe' - '\powershell.exe' - '\pwsh.exe' - '\wscript.exe' - '\cscript.exe' - '\mshta.exe' - '\rundll32.exe' - '\explorer.exe' condition: selection_compiler and selection_parentfalsepositives: - "PowerShell's Add-Type cmdlet, which compiles inline C# through csc.exe under a CSharpCodeProvider call whenever a script or module defines a helper type — a routine pattern in administrative tooling, DSC resources and defensive scripts alike, and the most likely dominant source of matches wherever such scripts run." - "Build agents and CI runners that shell out to csc.exe directly from a cmd.exe or PowerShell wrapper batch/script instead of invoking msbuild.exe or devenv.exe, common on lightweight or self-hosted build machines." - "A user double-clicking a self-contained .NET installer or first-run bootstrapper launched from explorer.exe that JIT-compiles a helper assembly with ilasm.exe during setup."level: lowSentinel · KQL
Run this as a search.
DeviceProcessEvents| where ((FolderPath endswith "\\csc.exe" or FolderPath endswith "\\ilasm.exe") and (InitiatingProcessFolderPath endswith "\\cmd.exe" or InitiatingProcessFolderPath endswith "\\powershell.exe" or InitiatingProcessFolderPath endswith "\\pwsh.exe" or InitiatingProcessFolderPath endswith "\\wscript.exe" or InitiatingProcessFolderPath endswith "\\cscript.exe" or InitiatingProcessFolderPath endswith "\\mshta.exe" or InitiatingProcessFolderPath endswith "\\rundll32.exe" or InitiatingProcessFolderPath endswith "\\explorer.exe"))
Splunk · SPL
Run this as a search.
index=* ((Image="*\\csc.exe" OR Image="*\\ilasm.exe") AND (ParentImage="*\\cmd.exe" OR ParentImage="*\\powershell.exe" OR ParentImage="*\\pwsh.exe" OR ParentImage="*\\wscript.exe" OR ParentImage="*\\cscript.exe" OR ParentImage="*\\mshta.exe" OR ParentImage="*\\rundll32.exe" OR ParentImage="*\\explorer.exe"))Elastic · ES|QL
Run this as a search.
FROM logs-*| WHERE ((TO_LOWER(process.executable) LIKE "*\\\\csc.exe" OR TO_LOWER(process.executable) LIKE "*\\\\ilasm.exe") AND (TO_LOWER(process.parent.executable) LIKE "*\\\\cmd.exe" OR TO_LOWER(process.parent.executable) LIKE "*\\\\powershell.exe" OR TO_LOWER(process.parent.executable) LIKE "*\\\\pwsh.exe" OR TO_LOWER(process.parent.executable) LIKE "*\\\\wscript.exe" OR TO_LOWER(process.parent.executable) LIKE "*\\\\cscript.exe" OR TO_LOWER(process.parent.executable) LIKE "*\\\\mshta.exe" OR TO_LOWER(process.parent.executable) LIKE "*\\\\rundll32.exe" OR TO_LOWER(process.parent.executable) LIKE "*\\\\explorer.exe"))
Wazuh · XML rule
Deploy to your manager — this is a rule, not a search.
<group name="sigma,windows,process_creation,"> <!-- Rule ids must be unique on your manager; 100000+ is the user range. --> <rule id="100000" level="5"> <!-- Set <if_sid> to the decoder/base rule for windows so this only evaluates relevant events. --> <field name="Image" type="pcre2">(?i)(\\csc\.exe$|\\ilasm\.exe$)</field> <field name="ParentImage" type="pcre2">(?i)(\\cmd\.exe$|\\powershell\.exe$|\\pwsh\.exe$|\\wscript\.exe$|\\cscript\.exe$|\\mshta\.exe$|\\rundll32\.exe$|\\explorer\.exe$)</field> <description>.NET compiler launched from a non-development parent process</description> <mitre> <id>T1027.004</id> </mitre> </rule></group>
Verdicts · reactions · comments
Community
Verdicts from engineers who actually deployed it, and the conversation around it.
Log in to react
Not yet reported on
Nobody has run this in a real environment and said what happened.
Verdicts from engineers who deployed it
0 castNo verdicts reported yet. The first one is worth more than the tenth — say what you ran it against.
Log in to report a verdict.
@priya-raman
Add-Type is going to be 95% of this anywhere that has real PowerShell tooling, and the false-positive list says so plainly, which I appreciate more than I expected to. What made it usable for us was pairing it with where csc.exe writes: Add-Type lands a randomly named dll in %TEMP%, and an operator compiling a payload puts it somewhere they chose. That is the OutputDirectoryPath knob the description says has no single-event equivalent — it does not, and it is still worth building as a two-event correlation if your platform can join.