Detection rules › Sigma

Non-DLL Extension File Renamed With DLL Extension

Status
test
Severity
medium
Log source
category file_rename, product windows
Author
frack113
Source
github.com/SigmaHQ/sigma

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

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.

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
TargetFilenameends_with
  • .dll corpus 24 (sigma 24)
field:"TargetFilename" kind:ends_with value:".dll"