Detection rules › Sigma

Suspicious Path In Keyboard Layout IME File Registry Value

Status
test
Severity
high
Log source
product windows, category registry_set
Author
X__Junior (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects usage of Windows Input Method Editor (IME) keyboard layout feature, which allows an attacker to load a DLL into the process after sending the WM_INPUTLANGCHANGEREQUEST message. Before doing this, the client needs to register the DLL in a special registry key that is assumed to implement this keyboard layout. This registry key should store a value named "Ime File" with a DLL path. IMEs are essential for languages that have more characters than can be represented on a standard keyboard, such as Chinese, Japanese, and Korean.

MITRE ATT&CK coverage

TacticTechniques
Defense ImpairmentT1685 Disable or Modify Tools

Event coverage

ProviderEventTitle
SysmonEvent ID 13RegistryEvent (Value Set)

Rule body yaml

title: Suspicious Path In Keyboard Layout IME File Registry Value
id: 9d8f9bb8-01af-4e15-a3a2-349071530530
related:
    - id: b888e3f2-224d-4435-b00b-9dd66e9ea1f1
      type: derived
status: test
description: |
    Detects usage of Windows Input Method Editor (IME) keyboard layout feature, which allows an attacker to load a DLL into the process after sending the WM_INPUTLANGCHANGEREQUEST message.
    Before doing this, the client needs to register the DLL in a special registry key that is assumed to implement this keyboard layout. This registry key should store a value named "Ime File" with a DLL path.
    IMEs are essential for languages that have more characters than can be represented on a standard keyboard, such as Chinese, Japanese, and Korean.
references:
    - https://www.linkedin.com/pulse/guntior-story-advanced-bootkit-doesnt-rely-windows-disk-baranov-wue8e/
author: X__Junior (Nextron Systems)
date: 2023-11-21
tags:
    - attack.defense-impairment
    - attack.t1685
logsource:
    product: windows
    category: registry_set
detection:
    selection_registry:
        TargetObject|contains|all:
            - '\Control\Keyboard Layouts\'
            - 'Ime File'
    selection_folders_1:
        Details|contains:
            - ':\Perflogs\'
            - ':\Users\Public\'
            - ':\Windows\Temp\'
            - '\AppData\Local\Temp\'
            - '\AppData\Roaming\'
            - '\Temporary Internet'
    selection_folders_2:
        - Details|contains|all:
              - ':\Users\'
              - '\Favorites\'
        - Details|contains|all:
              - ':\Users\'
              - '\Favourites\'
        - Details|contains|all:
              - ':\Users\'
              - '\Contacts\'
    condition: selection_registry and 1 of selection_folders_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

selection_registry and 1 of selection_folders_*

Stage 1: selection_registry

selection_registry:
    TargetObject|contains|all:
        - '\Control\Keyboard Layouts\'
        - 'Ime File'

Stage 2: selection_folders_1

selection_folders_1:
    Details|contains:
        - ':\Perflogs\'
        - ':\Users\Public\'
        - ':\Windows\Temp\'
        - '\AppData\Local\Temp\'
        - '\AppData\Roaming\'
        - '\Temporary Internet'

Stage 3: selection_folders_2

selection_folders_2:
    - Details|contains|all:
          - ':\Users\'
          - '\Favorites\'
    - Details|contains|all:
          - ':\Users\'
          - '\Favourites\'
    - Details|contains|all:
          - ':\Users\'
          - '\Contacts\'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
Detailsmatch
  • :\Perflogs\ corpus 4 (sigma 4)
  • :\Users\ corpus 4 (sigma 4)
  • :\Users\Public\ corpus 4 (sigma 4)
  • :\Windows\Temp\ corpus 4 (sigma 4)
  • \AppData\Local\Temp\ corpus 8 (sigma 8)
  • \AppData\Roaming\ corpus 3 (sigma 3)
  • \Contacts\ corpus 4 (sigma 4)
  • \Favorites\ corpus 3 (sigma 3)
  • \Favourites\ corpus 3 (sigma 3)
  • \Temporary Internet corpus 3 (sigma 3)
TargetObjectmatch
  • Ime File corpus 2 (sigma 2)
  • \Control\Keyboard Layouts\ corpus 2 (sigma 2)