Detection rules › Sigma

Removal of Potential COM Hijacking Registry Keys

Status
test
Severity
medium
Log source
category registry_delete, product windows
Author
Roberto Rodriguez (Cyb3rWard0g), OTR (Open Threat Research)
Source
github.com/SigmaHQ/sigma

Detects any deletion of entries in ".*\shell\open\command" registry keys. These registry keys might have been used for COM hijacking activities by a threat actor or an attacker and the deletion could indicate steps to remove its tracks.

Known false positives

  • Legitimate software (un)installations are known to cause false positives. Please add them as a filter when encountered

MITRE ATT&CK coverage

TacticTechniques
Persistence
Defense Impairment

Telemetry coverage

Rule body

title: Removal of Potential COM Hijacking Registry Keys
id: 96f697b0-b499-4e5d-9908-a67bec11cdb6
status: test
description: |
    Detects any deletion of entries in ".*\shell\open\command" registry keys.
    These registry keys might have been used for COM hijacking activities by a threat actor or an attacker and the deletion could indicate steps to remove its tracks.
references:
    - https://github.com/OTRF/detection-hackathon-apt29/issues/7
    - https://github.com/OTRF/ThreatHunter-Playbook/blob/2d4257f630f4c9770f78d0c1df059f891ffc3fec/docs/evals/apt29/detections/3.C.1_22A46621-7A92-48C1-81BF-B3937EB4FDC3.md
    - https://learn.microsoft.com/en-us/windows/win32/shell/launch
    - https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-iexecutecommand
    - https://learn.microsoft.com/en-us/windows/win32/shell/shell-and-managed-code
author: Roberto Rodriguez (Cyb3rWard0g), OTR (Open Threat Research)
date: 2020-05-02
modified: 2025-10-07
tags:
    - attack.persistence
    - attack.defense-impairment
    - attack.t1112
logsource:
    product: windows
    category: registry_delete
detection:
    selection:
        TargetObject|endswith: '\shell\open\command'
    filter_main_explorer:
        Image|endswith: 'C:\Windows\explorer.exe'
    filter_main_svchost:
        Image: 'C:\Windows\system32\svchost.exe'
    filter_main_msiexec:
        Image:
            - 'C:\Windows\System32\msiexec.exe'
            - 'C:\Windows\SysWOW64\msiexec.exe'
    filter_main_generic_prorams:
        Image|startswith:
            - 'C:\Program Files\'
            - 'C:\Program Files (x86)\'
    filter_main_openwith:
        Image: 'C:\Windows\System32\OpenWith.exe'
    filter_optional_dropbox:
        Image|endswith: '\Dropbox.exe'
        # We don't use the HKCR anchor as it could be logged as a different variation (HKEY_CLASSES_ROOT)
        TargetObject|contains: '\Dropbox.'
    filter_optional_wireshark:
        Image|endswith: '\AppData\Local\Temp\Wireshark_uninstaller.exe'
        # We don't use the HKCR anchor as it could be logged as a different variation (HKEY_CLASSES_ROOT)
        TargetObject|contains: '\wireshark-capture-file\'
    filter_optional_peazip:
        Image|contains: 'peazip'
        # We don't use the HKCR anchor as it could be logged as a different variation (HKEY_CLASSES_ROOT)
        TargetObject|contains: '\PeaZip.'
    filter_optional_everything:
        Image|endswith: '\Everything.exe'
        # We don't use the HKCR anchor as it could be logged as a different variation (HKEY_CLASSES_ROOT)
        TargetObject|contains: '\Everything.'
    filter_optional_uninstallers:
        # This image path is linked with different uninstallers when running as admin unfortunately
        Image|startswith: 'C:\Windows\Installer\MSI'
    filter_optional_java:
        Image|startswith: 'C:\Program Files (x86)\Java\'
        Image|endswith: '\installer.exe'
        TargetObject|contains: '\Classes\WOW6432Node\CLSID\{4299124F-F2C3-41b4-9C73-9236B2AD0E8F}'
    filter_optional_edgeupdate:
        Image|contains: '\Microsoft\EdgeUpdate\Install'
    filter_optional_avira:
        Image:
            - 'C:\Program Files (x86)\Avira\Antivirus\'
            - 'C:\Program Files\Avira\Antivirus\'
        TargetObject|endswith:
            - '\CLSID\{305CA226-D286-468e-B848-2B2E8E697B74}\Shell\Open\Command'
            - '\AntiVir.Keyfile\shell\open\command'
    filter_optional_installer_temp:
        - Image|contains|all:
              - 'AppData\Local\Temp'
              - '\setup.exe'
        - Image|contains|all:
              - '\Temp\is-'
              - '\target.tmp'
    filter_optional_ninite:
        Image|endswith: '\ninite.exe'
    filter_optional_discord:
        Image|endswith: '\reg.exe'
        TargetObject|endswith: '\Discord\shell\open\command'
    filter_optional_spotify:
        Image|endswith: '\Spotify.exe'
        TargetObject|endswith: '\Spotify\shell\open\command'
    filter_optional_eclipse:
        Image|endswith: 'C:\eclipse\eclipse.exe'
        TargetObject|contains: '_Classes\eclipse+'
    filter_optional_teamviewer:
        Image|contains|all:
            - '\Temp'
            - '\TeamViewer'
    condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
    - Legitimate software (un)installations are known to cause false positives. Please add them as a filter when encountered
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:
    TargetObject|endswith: '\shell\open\command'

Stage 2: not filter_main_*

filter_main_explorer:
    Image|endswith: 'C:\Windows\explorer.exe'
filter_main_svchost:
    Image: 'C:\Windows\system32\svchost.exe'
filter_main_msiexec:
    Image:
        - 'C:\Windows\System32\msiexec.exe'
        - 'C:\Windows\SysWOW64\msiexec.exe'
filter_main_generic_prorams:
    Image|startswith:
        - 'C:\Program Files\'
        - 'C:\Program Files (x86)\'
filter_main_openwith:
    Image: 'C:\Windows\System32\OpenWith.exe'

Stage 3: not filter_optional_*

filter_optional_dropbox:
    Image|endswith: '\Dropbox.exe'
    TargetObject|contains: '\Dropbox.'
filter_optional_wireshark:
    Image|endswith: '\AppData\Local\Temp\Wireshark_uninstaller.exe'
    TargetObject|contains: '\wireshark-capture-file\'
filter_optional_peazip:
    Image|contains: 'peazip'
    TargetObject|contains: '\PeaZip.'
filter_optional_everything:
    Image|endswith: '\Everything.exe'
    TargetObject|contains: '\Everything.'
filter_optional_uninstallers:
    Image|startswith: 'C:\Windows\Installer\MSI'
filter_optional_java:
    Image|startswith: 'C:\Program Files (x86)\Java\'
    Image|endswith: '\installer.exe'
    TargetObject|contains: '\Classes\WOW6432Node\CLSID\{4299124F-F2C3-41b4-9C73-9236B2AD0E8F}'
filter_optional_edgeupdate:
    Image|contains: '\Microsoft\EdgeUpdate\Install'
filter_optional_avira:
    Image:
        - 'C:\Program Files (x86)\Avira\Antivirus\'
        - 'C:\Program Files\Avira\Antivirus\'
    TargetObject|endswith:
        - '\CLSID\{305CA226-D286-468e-B848-2B2E8E697B74}\Shell\Open\Command'
        - '\AntiVir.Keyfile\shell\open\command'
filter_optional_installer_temp:
    - Image|contains|all:
          - 'AppData\Local\Temp'
          - '\setup.exe'
    - Image|contains|all:
          - '\Temp\is-'
          - '\target.tmp'
filter_optional_ninite:
    Image|endswith: '\ninite.exe'
filter_optional_discord:
    Image|endswith: '\reg.exe'
    TargetObject|endswith: '\Discord\shell\open\command'
filter_optional_spotify:
    Image|endswith: '\Spotify.exe'
    TargetObject|endswith: '\Spotify\shell\open\command'
filter_optional_eclipse:
    Image|endswith: 'C:\eclipse\eclipse.exe'
    TargetObject|contains: '_Classes\eclipse+'
filter_optional_teamviewer:
    Image|contains|all:
        - '\Temp'
        - '\TeamViewer'

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
Imageends_withC:\Windows\explorer.exeexcludes:Image field:"Image" value:"C:\Windows\explorer.exe"
ImageeqC:\Windows\SysWOW64\msiexec.exeexcludes:Image field:"Image" value:"C:\Windows\SysWOW64\msiexec.exe"
ImageeqC:\Windows\System32\OpenWith.exeexcludes:Image field:"Image" value:"C:\Windows\System32\OpenWith.exe"
ImageeqC:\Windows\System32\msiexec.exeexcludes:Image field:"Image" value:"C:\Windows\System32\msiexec.exe"
ImageeqC:\Windows\system32\svchost.exeexcludes:Image field:"Image" value:"C:\Windows\system32\svchost.exe"
Imagestarts_withC:\Program Files (x86)\excludes:Image field:"Image" value:"C:\Program Files (x86)\"
Imagestarts_withC:\Program Files\excludes:Image field:"Image" value:"C:\Program Files\"
ImageeqC:\Program Files (x86)\Avira\Antivirus\excludes:Image field:"Image" value:"C:\Program Files (x86)\Avira\Antivirus\"
ImageeqC:\Program Files\Avira\Antivirus\excludes:Image field:"Image" value:"C:\Program Files\Avira\Antivirus\"
TargetObjectends_with\AntiVir.Keyfile\shell\open\commandexcludes:TargetObject field:"TargetObject" value:"\AntiVir.Keyfile\shell\open\command"
TargetObjectends_with\CLSID\{305CA226-D286-468e-B848-2B2E8E697B74}\Shell\Open\Commandexcludes:TargetObject field:"TargetObject" value:"\CLSID\{305CA226-D286-468e-B848-2B2E8E697B74}\Shell\Open\Command"
Imageends_withC:\eclipse\eclipse.exeexcludes:Image field:"Image" value:"C:\eclipse\eclipse.exe"
TargetObjectmatch_Classes\eclipse+excludes:TargetObject field:"TargetObject" value:"_Classes\eclipse+"
Imageends_with\AppData\Local\Temp\Wireshark_uninstaller.exeexcludes:Image field:"Image" value:"\AppData\Local\Temp\Wireshark_uninstaller.exe"
TargetObjectmatch\wireshark-capture-file\excludes:TargetObject field:"TargetObject" value:"\wireshark-capture-file\"
Imageends_with\Dropbox.exeexcludes:Image field:"Image" value:"\Dropbox.exe"
TargetObjectmatch\Dropbox.excludes:TargetObject field:"TargetObject" value:"\Dropbox."
Imageends_with\Everything.exeexcludes:Image field:"Image" value:"\Everything.exe"
TargetObjectmatch\Everything.excludes:TargetObject field:"TargetObject" value:"\Everything."
Imageends_with\Spotify.exeexcludes:Image field:"Image" value:"\Spotify.exe"
TargetObjectends_with\Spotify\shell\open\commandexcludes:TargetObject field:"TargetObject" value:"\Spotify\shell\open\command"
Imageends_with\installer.exeexcludes:Image field:"Image" value:"\installer.exe"
Imagestarts_withC:\Program Files (x86)\Java\excludes:Image field:"Image" value:"C:\Program Files (x86)\Java\"
TargetObjectmatch\Classes\WOW6432Node\CLSID\{4299124F-F2C3-41b4-9C73-9236B2AD0E8F}excludes:TargetObject field:"TargetObject" value:"\Classes\WOW6432Node\CLSID\{4299124F-F2C3-41b4-9C73-9236B2AD0E8F}"
Imageends_with\reg.exeexcludes:Image field:"Image" value:"\reg.exe"
TargetObjectends_with\Discord\shell\open\commandexcludes:TargetObject field:"TargetObject" value:"\Discord\shell\open\command"
ImagematchAppData\Local\Tempexcludes:Image field:"Image" value:"AppData\Local\Temp"
Imagematch\setup.exeexcludes:Image field:"Image" value:"\setup.exe"
Imagematch\TeamViewerexcludes:Image field:"Image" value:"\TeamViewer"
Imagematch\Tempexcludes:Image field:"Image" value:"\Temp"
Imagematch\Temp\is-excludes:Image field:"Image" value:"\Temp\is-"
Imagematch\target.tmpexcludes:Image field:"Image" value:"\target.tmp"
Imagematchpeazipexcludes:Image field:"Image" value:"peazip"
TargetObjectmatch\PeaZip.excludes:TargetObject field:"TargetObject" value:"\PeaZip."
Imageends_with\ninite.exeexcludes:Image field:"Image" value:"\ninite.exe"
Imagematch\Microsoft\EdgeUpdate\Installexcludes:Image field:"Image" value:"\Microsoft\EdgeUpdate\Install"
Imagestarts_withC:\Windows\Installer\MSIexcludes:Image field:"Image" value:"C:\Windows\Installer\MSI"

Indicators

These rows show field, operator, and value matches.