Dynamic .NET Compilation Via Csc.EXE
Detects execution of "csc.exe" to compile .NET code. Attackers often leverage this to compile code on the fly and use it in other stages.
Detection logic
Detection requirements
- Platform
- LinuxmacOSWindows
The rule states no platform. This is derived from the ATT&CK technique it maps to.
- Log source product
- windows
- Log source category
- process_creation
Known benign triggers
- Ansible
- Legitimate Microsoft software - https://twitter.com/gabriele_pippi/status/1206907900268072962
- Legitimate software from program files - https://twitter.com/gN3mes1s/status/1206874118282448897
MITRE ATT&CK mappings
0 exclusive techniques.This is coverage no other published rule has; it is not this rule's total technique count.
References
| Reference | Cited by |
|---|---|
| app.any.run/tasks/c6993447-d1d8-414e-b856-675325e5aa09/ | Only this detection cites it |
| github.com/redcanaryco/atomic-red-team/blob/b27a3cb25025161d49ac861cb216db68c46a3537/atomics/T1027.004/T1027.004.md#atomic-test-1---compile-after-delivery-using-cscexe | Only this detection cites it |
| securityboulevard.com/2019/08/agent-tesla-evading-edr-by-removing-api-hooks/ | Only this detection cites it |
| twitter.com/gN3mes1s/status/1206874118282448897 | Only this detection cites it |
| www.clearskysec.com/wp-content/uploads/2018/11/MuddyWater-Operations-in-Lebanon-and-Oman.pdf | Only this detection cites it |
From the source
- At source
- Open at source
- Upstream identifier
- dcaa3f04-70c3-427a-80b4-b870d73c94c4
- Tagged by the source as
- attack.stealth
Licence
- Published under
- Detection Rule License 1.1Read the licence
- Attribution
- Required
Authorship
- Published
- Sep 4, 2026
- Version
- 2