Detection rules › Sigma

Potential Persistence Via App Paths Default Property

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

Detects changes to the "Default" property for keys located in the \Software\Microsoft\Windows\CurrentVersion\App Paths\ registry. Which might be used as a method of persistence The entries found under App Paths are used primarily for the following purposes. First, to map an application's executable file name to that file's fully qualified path. Second, to prepend information to the PATH environment variable on a per-application, per-process basis.

Known false positives

  • Legitimate applications registering their binary from on of the suspicious locations mentioned above (tune it)

MITRE ATT&CK coverage

Telemetry coverage

Rule body

title: Potential Persistence Via App Paths Default Property
id: 707e097c-e20f-4f67-8807-1f72ff4500d6
status: test
description: |
    Detects changes to the "Default" property for keys located in the \Software\Microsoft\Windows\CurrentVersion\App Paths\ registry. Which might be used as a method of persistence
    The entries found under App Paths are used primarily for the following purposes.
    First, to map an application's executable file name to that file's fully qualified path.
    Second, to prepend information to the PATH environment variable on a per-application, per-process basis.
references:
    - https://www.hexacorn.com/blog/2013/01/19/beyond-good-ol-run-key-part-3/
    - https://learn.microsoft.com/en-us/windows/win32/shell/app-registration
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-08-10
modified: 2023-08-17
tags:
    - attack.privilege-escalation
    - attack.persistence
    - attack.t1546.012
logsource:
    category: registry_set
    product: windows
detection:
    selection:
        TargetObject|contains: '\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths'
        TargetObject|endswith:
            - '(Default)'
            - 'Path'
        Details|contains:
            # Add more suspicious paths or binaries as you see fit.
            - '\Users\Public'
            - '\AppData\Local\Temp\'
            - '\Windows\Temp\'
            - '\Desktop\'
            - '\Downloads\'
            - '%temp%'
            - '%tmp%'
            - 'iex'
            - 'Invoke-'
            - 'rundll32'
            - 'regsvr32'
            - 'mshta'
            - 'cscript'
            - 'wscript'
            - '.bat'
            - '.hta'
            - '.dll'
            - '.ps1'
    condition: selection
falsepositives:
    - Legitimate applications registering their binary from on of the suspicious locations mentioned above (tune it)
level: high

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    TargetObject|contains: '\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths'
    TargetObject|endswith:
        - '(Default)'
        - 'Path'
    Details|contains:
        - '\Users\Public'
        - '\AppData\Local\Temp\'
        - '\Windows\Temp\'
        - '\Desktop\'
        - '\Downloads\'
        - '%temp%'
        - '%tmp%'
        - 'iex'
        - 'Invoke-'
        - 'rundll32'
        - 'regsvr32'
        - 'mshta'
        - 'cscript'
        - 'wscript'
        - '.bat'
        - '.hta'
        - '.dll'
        - '.ps1'

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Detailsmatch
  • %temp% corpus 5 (sigma 4, chronicle 1)
  • %tmp% corpus 5 (sigma 4, chronicle 1)
  • .bat corpus 3 (sigma 3)
  • .dll corpus 5 (sigma 5)
  • .hta corpus 2 (sigma 2)
  • .ps1 corpus 2 (sigma 2)
  • Invoke- corpus 2 (sigma 2)
  • \AppData\Local\Temp\ corpus 8 (sigma 8)
  • \Desktop\ corpus 3 (sigma 3)
  • \Downloads\ corpus 2 (sigma 2)
  • \Users\Public
  • \Windows\Temp\ corpus 5 (sigma 5)
  • cscript corpus 4 (sigma 4)
  • iex corpus 2 (sigma 2)
  • mshta corpus 5 (sigma 4, splunk 1)
  • regsvr32 corpus 3 (sigma 3)
  • rundll32 corpus 4 (sigma 4)
  • wscript corpus 4 (sigma 4)
field:"Details" kind:match
TargetObjectends_with
  • (Default) corpus 2 (sigma 2)
  • Path
field:"TargetObject" kind:ends_with
TargetObjectmatch
  • \SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
field:"TargetObject" kind:match value:"\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"