Detection rules › Sigma
Potential DLL Sideloading Using Coregen.exe
Detect usage of the "coregen.exe" (Microsoft CoreCLR Native Image Generator) binary to sideload arbitrary DLLs.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | |
| Stealth |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 7: Image loaded |
Rule body
title: Potential DLL Sideloading Using Coregen.exe
id: 0fa66f66-e3f6-4a9c-93f8-4f2610b00171
status: test
description: Detect usage of the "coregen.exe" (Microsoft CoreCLR Native Image Generator) binary to sideload arbitrary DLLs.
references:
- https://lolbas-project.github.io/lolbas/OtherMSBinaries/Coregen/
author: frack113
date: 2022-12-31
tags:
- attack.privilege-escalation
- attack.stealth
- attack.t1218
- attack.t1055
logsource:
category: image_load
product: windows
detection:
selection:
Image|endswith: '\coregen.exe'
filter_main_legit_paths:
ImageLoaded|startswith:
- 'C:\Program Files (x86)\Microsoft Silverlight\'
- 'C:\Program Files\Microsoft Silverlight\'
- 'C:\Windows\System32\'
- 'C:\Windows\SysWOW64\'
condition: selection and not 1 of filter_main_*
falsepositives:
- Unknown
level: medium
Stages and Predicates
Stage 0: condition
selection and not 1 of filter_main_*Stage 1: selection
selection:
Image|endswith: '\coregen.exe'
Stage 2: not filter_main_legit_paths
filter_main_legit_paths:
ImageLoaded|startswith:
- 'C:\Program Files (x86)\Microsoft Silverlight\'
- 'C:\Program Files\Microsoft Silverlight\'
- 'C:\Windows\System32\'
- 'C:\Windows\SysWOW64\'
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
ImageLoaded | starts_with | C:\Program Files (x86)\Microsoft Silverlight\ | excludes:ImageLoaded field:"ImageLoaded" value:"C:\Program Files (x86)\Microsoft Silverlight\" |
ImageLoaded | starts_with | C:\Program Files\Microsoft Silverlight\ | excludes:ImageLoaded field:"ImageLoaded" value:"C:\Program Files\Microsoft Silverlight\" |
ImageLoaded | starts_with | C:\Windows\SysWOW64\ | excludes:ImageLoaded field:"ImageLoaded" value:"C:\Windows\SysWOW64\" |
ImageLoaded | starts_with | C:\Windows\System32\ | excludes:ImageLoaded field:"ImageLoaded" value:"C:\Windows\System32\" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
Image | ends_with |
| field:"Image" kind:ends_with value:"\coregen.exe" |