Detection rules › Sigma
Non-DLL Extension File Renamed With DLL Extension
Detects rename operations of files with non-DLL extensions to files with a DLL extension. This is often performed by malware in order to avoid initial detections based on extensions.
Known false positives
- Likely from installers and temporary locations
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
title: Non-DLL Extension File Renamed With DLL Extension
id: bbfd974c-248e-4435-8de6-1e938c79c5c1
status: test
description: |
Detects rename operations of files with non-DLL extensions to files with a DLL extension. This is often performed by malware in order to avoid initial detections based on extensions.
references:
- https://twitter.com/ffforward/status/1481672378639912960
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1036/T1036.md#atomic-test-1---system-file-copied-to-unusual-location
author: frack113
date: 2022-02-19
modified: 2023-11-11
tags:
- attack.stealth
- attack.t1036.008
- detection.threat-hunting
logsource:
product: windows
category: file_rename
definition: 'Requirements: Microsoft-Windows-Kernel-File Provider with at least the KERNEL_FILE_KEYWORD_RENAME_SETLINK_PATH keyword'
detection:
selection:
TargetFilename|endswith: '.dll'
filter_main_dll:
# Note: To avoid file renames
SourceFilename|endswith: '.dll'
filter_main_installers:
SourceFilename|endswith: '.tmp'
filter_main_empty_source:
SourceFilename: ''
filter_main_null_source:
SourceFilename: null
filter_main_tiworker:
Image|contains: ':\Windows\WinSxS\'
Image|endswith: '\TiWorker.exe'
filter_main_upgrade:
- Image|endswith: ':\Windows\System32\wuauclt.exe'
- TargetFilename|contains: ':\$WINDOWS.~BT\Sources\'
filter_main_generic:
Image|contains:
- ':\Program Files (x86)\'
- ':\Program Files\'
filter_optional_squirrel:
SourceFilename|contains: '\SquirrelTemp\temp'
condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
- Likely from installers and temporary locations
level: medium
Stages and Predicates
Stage 0: condition
selection and not 1 of filter_main_* and not 1 of filter_optional_*Stage 1: selection
selection:
TargetFilename|endswith: '.dll'
Stage 2: not filter_main_*
filter_main_dll:
SourceFilename|endswith: '.dll'
filter_main_installers:
SourceFilename|endswith: '.tmp'
filter_main_empty_source:
SourceFilename: ''
filter_main_null_source:
SourceFilename: null
filter_main_tiworker:
Image|contains: ':\Windows\WinSxS\'
Image|endswith: '\TiWorker.exe'
filter_main_upgrade:
- Image|endswith: ':\Windows\System32\wuauclt.exe'
- TargetFilename|contains: ':\$WINDOWS.~BT\Sources\'
filter_main_generic:
Image|contains:
- ':\Program Files (x86)\'
- ':\Program Files\'
Stage 3: not filter_optional_squirrel
filter_optional_squirrel:
SourceFilename|contains: '\SquirrelTemp\temp'
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
Image | ends_with | \TiWorker.exe | excludes:Image field:"Image" value:"\TiWorker.exe" |
Image | match | :\Windows\WinSxS\ | excludes:Image field:"Image" value:":\Windows\WinSxS\" |
Image | ends_with | :\Windows\System32\wuauclt.exe | excludes:Image field:"Image" value:":\Windows\System32\wuauclt.exe" |
Image | match | :\Program Files (x86)\ | excludes:Image field:"Image" value:":\Program Files (x86)\" |
Image | match | :\Program Files\ | excludes:Image field:"Image" value:":\Program Files\" |
SourceFilename | ends_with | .dll | excludes:SourceFilename field:"SourceFilename" value:".dll" |
SourceFilename | ends_with | .tmp | excludes:SourceFilename field:"SourceFilename" value:".tmp" |
SourceFilename | is_null | excludes:SourceFilename | |
TargetFilename | match | :\$WINDOWS.~BT\Sources\ | excludes:TargetFilename field:"TargetFilename" value:":\$WINDOWS.~BT\Sources\" |
SourceFilename | match | \SquirrelTemp\temp | excludes:SourceFilename field:"SourceFilename" value:"\SquirrelTemp\temp" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
TargetFilename | ends_with |
| field:"TargetFilename" kind:ends_with value:".dll" |