Detection rules › Sigma
Arbitrary DLL or Csproj Code Execution Via Dotnet.EXE
Detects execution of arbitrary DLLs or unsigned code via a ".csproj" files via Dotnet.EXE.
Known false positives
- Legitimate administrator usage
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
Rule body
title: Arbitrary DLL or Csproj Code Execution Via Dotnet.EXE
id: d80d5c81-04ba-45b4-84e4-92eba40e0ad3
status: test
description: Detects execution of arbitrary DLLs or unsigned code via a ".csproj" files via Dotnet.EXE.
references:
- https://lolbas-project.github.io/lolbas/OtherMSBinaries/Dotnet/
- https://twitter.com/_felamos/status/1204705548668555264
- https://bohops.com/2019/08/19/dotnet-core-a-vector-for-awl-bypass-defense-evasion/
author: Beyu Denis, oscd.community
date: 2020-10-18
modified: 2025-10-08
tags:
- attack.stealth
- attack.t1218
logsource:
category: process_creation
product: windows
detection:
selection_img:
- Image|endswith: '\dotnet.exe'
- OriginalFileName: '.NET Host'
selection_cli:
CommandLine|endswith:
- '.csproj'
- '.csproj"'
- '.dll'
- '.dll"'
- ".csproj'"
- ".dll'"
filter_optional_notepadplus_plus:
ParentImage:
- 'C:\Program Files (x86)\Notepad++\notepad++.exe'
- 'C:\Program Files\Notepad++\notepad++.exe'
CommandLine|contains|all:
- 'C:\ProgramData\CSScriptNpp\'
- '-cscs_path:'
- '\cs-script\cscs.dll'
condition: all of selection_* and not 1 of filter_optional_*
falsepositives:
- Legitimate administrator usage
level: medium
Stages and Predicates
Stage 0: condition
all of selection_* and not 1 of filter_optional_*Stage 1: selection_img
selection_img:
- Image|endswith: '\dotnet.exe'
- OriginalFileName: '.NET Host'
Stage 2: selection_cli
selection_cli:
CommandLine|endswith:
- '.csproj'
- '.csproj"'
- '.dll'
- '.dll"'
- ".csproj'"
- ".dll'"
Stage 3: not filter_optional_notepadplus_plus
filter_optional_notepadplus_plus:
ParentImage:
- 'C:\Program Files (x86)\Notepad++\notepad++.exe'
- 'C:\Program Files\Notepad++\notepad++.exe'
CommandLine|contains|all:
- 'C:\ProgramData\CSScriptNpp\'
- '-cscs_path:'
- '\cs-script\cscs.dll'
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
ParentImage | eq | C:\Program Files (x86)\Notepad++\notepad++.exe | excludes:ParentImage field:"ParentImage" value:"C:\Program Files (x86)\Notepad++\notepad++.exe" |
ParentImage | eq | C:\Program Files\Notepad++\notepad++.exe | excludes:ParentImage field:"ParentImage" value:"C:\Program Files\Notepad++\notepad++.exe" |
CommandLine | match | -cscs_path: | excludes:CommandLine field:"CommandLine" value:"-cscs_path:" |
CommandLine | match | C:\ProgramData\CSScriptNpp\ | excludes:CommandLine field:"CommandLine" value:"C:\ProgramData\CSScriptNpp\" |
CommandLine | match | \cs-script\cscs.dll | excludes:CommandLine field:"CommandLine" value:"\cs-script\cscs.dll" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
CommandLine | ends_with |
| field:"CommandLine" kind:ends_with |
Image | ends_with |
| field:"Image" kind:ends_with value:"\dotnet.exe" |
OriginalFileName | eq |
| field:"OriginalFileName" kind:eq value:".NET Host" |