Detection rules › Sigma

Potential Persistence Via Security Descriptors - ScriptBlock

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

Detects usage of certain functions and keywords that are used to manipulate security descriptors in order to potentially set a backdoor. As seen used in the DAMP project.

MITRE ATT&CK coverage

TacticTechniques
PersistenceNo specific technique
Privilege EscalationNo specific technique
Defense ImpairmentNo specific technique

Event coverage

Rule body yaml

title: Potential Persistence Via Security Descriptors - ScriptBlock
id: 2f77047c-e6e9-4c11-b088-a3de399524cd
status: test
description: Detects usage of certain functions and keywords that are used to manipulate security descriptors in order to potentially set a backdoor. As seen used in the DAMP project.
references:
    - https://github.com/HarmJ0y/DAMP
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-01-05
tags:
    - attack.persistence
    - attack.privilege-escalation
    - attack.defense-impairment
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection:
        ScriptBlockText|contains|all:
            - 'win32_Trustee'
            - 'win32_Ace'
            - '.AccessMask'
            - '.AceType'
            - '.SetSecurityDescriptor'
        ScriptBlockText|contains:
            - '\Lsa\JD'
            - '\Lsa\Skew1'
            - '\Lsa\Data'
            - '\Lsa\GBG'
    condition: selection
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    ScriptBlockText|contains|all:
        - 'win32_Trustee'
        - 'win32_Ace'
        - '.AccessMask'
        - '.AceType'
        - '.SetSecurityDescriptor'
    ScriptBlockText|contains:
        - '\Lsa\JD'
        - '\Lsa\Skew1'
        - '\Lsa\Data'
        - '\Lsa\GBG'

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
ScriptBlockTextmatch
  • .AccessMask
  • .AceType
  • .SetSecurityDescriptor
  • \Lsa\Data
  • \Lsa\GBG
  • \Lsa\JD
  • \Lsa\Skew1
  • win32_Ace
  • win32_Trustee