currentversion_autorun_keys_modification


Description

Detects modification of autostart extensibility point (ASEP) in registry

Query · yara_l

events:
    $reg.metadata.event_type = "REGISTRY_MODIFICATION"
    strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\software\\microsoft\\windows\\currentversion") and
    (
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\shellserviceobjectdelayload") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\run\\") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\runonce\\") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\runonceex\\") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\runservices\\") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\runservicesonce\\") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\policies\\system\\shell") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\policies\\explorer\\run") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\group policy\\scripts\\startup") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\group policy\\scripts\\shutdown") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\group policy\\scripts\\logon") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\group policy\\scripts\\logoff") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\explorer\\shellserviceobjects") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\explorer\\shelliconoverlayidentifiers") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\explorer\\shellexecutehooks") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\explorer\\sharedtaskscheduler") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\explorer\\browser helper objects") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\plap providers") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential providers") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential provider filters")
    )
    not (
        $reg.target.registry.registry_value_data = "(Empty)" or
        re.regex($reg.target.registry.registry_key, `\\NgcFirst\\ConsecutiveSwitchCount$`) nocase or
        re.regex($reg.principal.process.file.full_path, `\\AppData\\Local\\Microsoft\\OneDrive\\Update\\OneDriveSetup\.exe$`) nocase or
        re.regex($reg.principal.process.file.full_path, `\\AppData\\Roaming\\Spotify\\Spotify\.exe$`) nocase or
        re.regex($reg.principal.process.file.full_path, `\\AppData\\Local\\WebEx\\WebexHost\.exe$`) nocase or
        $reg.principal.process.file.full_path = "C:\\WINDOWS\\system32\\devicecensus.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Windows\\system32\\winsat.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files\\Microsoft OneDrive\\StandaloneUpdater\\OneDriveSetup.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files\\Microsoft OneDrive\\Update\\OneDriveSetup.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files (x86)\\Microsoft OneDrive\\Update\\OneDriveSetup.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files\\KeePass Password Safe 2\\ShInstUtil.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files\\Everything\\Everything.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files (x86)\\Microsoft Office\\root\\integration\\integrator.exe" nocase or
        (
            $reg.principal.process.file.full_path = "C:\\Windows\\system32\\LogonUI.exe" nocase and
            (
                strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential providers\\{d6886603-9d2f-4eb2-b667-1971041fa96b}\\") or
                strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential providers\\{bec09223-b018-416d-a0ac-523971b639f5}\\") or
                strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential providers\\{8af662bf-65a0-4d0a-a540-a338a999d36f}\\") or
                strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential providers\\{27fbdb57-b613-4af2-9d7e-4fa7a66c21ad}\\")
            )
        ) or
        (
            (
                strings.starts_with(strings.to_lower($reg.principal.process.file.full_path), "c:\\program files (x86)\\microsoft\\edgeupdate\\install\\") or
                strings.starts_with(strings.to_lower($reg.principal.process.file.full_path), "c:\\program files (x86)\\microsoft\\edgewebview\\") or
                strings.starts_with(strings.to_lower($reg.principal.process.file.full_path), "c:\\program files (x86)\\microsoft\\edge\\application\\msedge.exe")
            )
        ) or
        (
            $reg.principal.process.file.full_path = "C:\\Windows\\system32\\regsvr32.exe" nocase and
            strings.contains(strings.to_lower($reg.target.registry.registry_key), "dropboxt") and
            re.regex($reg.target.registry.registry_value_data, `A251-47B7-93E1-CDD82E34AF8B
Raw source currentversion_autorun_keys_modification · YARA-L
Esc
Published by chronicle/detection-rules ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
rule currentversion_autorun_keys_modification {

  meta:
    author = "Victor Sergeev, Daniil Yugoslavskiy, Gleb Sukhodolskiy, Timur Zinniatullin, oscd.community, Tim Shelton, frack113 (split)"
    description = "Detects modification of autostart extensibility point (ASEP) in registry"
    reference = "https://github.com/SigmaHQ/sigma/blob/master/rules/windows/registry/registry_set/registry_set_asep_reg_keys_modification_currentversion.yml"
    license = "https://github.com/SigmaHQ/Detection-Rule-License/blob/main/LICENSE.Detection.Rules.md"
    rule_name = "CurrentVersion Autorun Keys Modification"
    rule_id = "mr_711750f0-0bf3-4c89-b771-65a1ed6aad05"
    sigma_uuid = "20f0ee37-5942-4e45-b7d5-c5b5db9df5cd"
    sigma_status = "test"
    tactic = "TA0003"
    technique = "T1547.001"
    data_source = "Sysmon Windows Registry"
    platform = "Windows"
    severity = "Medium"
    priority = "Medium"
    false_positives = "Legitimate software automatically sets up autorun keys"

  events:
    $reg.metadata.event_type = "REGISTRY_MODIFICATION"
    strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\software\\microsoft\\windows\\currentversion") and
    (
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\shellserviceobjectdelayload") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\run\\") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\runonce\\") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\runonceex\\") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\runservices\\") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\runservicesonce\\") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\policies\\system\\shell") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\policies\\explorer\\run") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\group policy\\scripts\\startup") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\group policy\\scripts\\shutdown") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\group policy\\scripts\\logon") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\group policy\\scripts\\logoff") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\explorer\\shellserviceobjects") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\explorer\\shelliconoverlayidentifiers") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\explorer\\shellexecutehooks") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\explorer\\sharedtaskscheduler") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\explorer\\browser helper objects") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\plap providers") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential providers") or
        strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential provider filters")
    )
    not (
        $reg.target.registry.registry_value_data = "(Empty)" or
        re.regex($reg.target.registry.registry_key, `\\NgcFirst\\ConsecutiveSwitchCount$`) nocase or
        re.regex($reg.principal.process.file.full_path, `\\AppData\\Local\\Microsoft\\OneDrive\\Update\\OneDriveSetup\.exe$`) nocase or
        re.regex($reg.principal.process.file.full_path, `\\AppData\\Roaming\\Spotify\\Spotify\.exe$`) nocase or
        re.regex($reg.principal.process.file.full_path, `\\AppData\\Local\\WebEx\\WebexHost\.exe$`) nocase or
        $reg.principal.process.file.full_path = "C:\\WINDOWS\\system32\\devicecensus.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Windows\\system32\\winsat.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files\\Microsoft OneDrive\\StandaloneUpdater\\OneDriveSetup.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files\\Microsoft OneDrive\\Update\\OneDriveSetup.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files (x86)\\Microsoft OneDrive\\Update\\OneDriveSetup.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files\\KeePass Password Safe 2\\ShInstUtil.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files\\Everything\\Everything.exe" nocase or
        $reg.principal.process.file.full_path = "C:\\Program Files (x86)\\Microsoft Office\\root\\integration\\integrator.exe" nocase or
        (
            $reg.principal.process.file.full_path = "C:\\Windows\\system32\\LogonUI.exe" nocase and
            (
                strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential providers\\{d6886603-9d2f-4eb2-b667-1971041fa96b}\\") or
                strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential providers\\{bec09223-b018-416d-a0ac-523971b639f5}\\") or
                strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential providers\\{8af662bf-65a0-4d0a-a540-a338a999d36f}\\") or
                strings.contains(strings.to_lower($reg.target.registry.registry_key), "\\authentication\\credential providers\\{27fbdb57-b613-4af2-9d7e-4fa7a66c21ad}\\")
            )
        ) or
        (
            (
                strings.starts_with(strings.to_lower($reg.principal.process.file.full_path), "c:\\program files (x86)\\microsoft\\edgeupdate\\install\\") or
                strings.starts_with(strings.to_lower($reg.principal.process.file.full_path), "c:\\program files (x86)\\microsoft\\edgewebview\\") or
                strings.starts_with(strings.to_lower($reg.principal.process.file.full_path), "c:\\program files (x86)\\microsoft\\edge\\application\\msedge.exe")
            )
        ) or
        (
            $reg.principal.process.file.full_path = "C:\\Windows\\system32\\regsvr32.exe" nocase and
            strings.contains(strings.to_lower($reg.target.registry.registry_key), "dropboxt") and
            re.regex($reg.target.registry.registry_value_data, `A251-47B7-93E1-CDD82E34AF8B}

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.