Detection rules › Sigma

Kapeka Backdoor Scheduled Task Creation

Status
test
Severity
high
Log source
product windows, service security
Author
Swachchhanda Shrawan Poudel
Source
github.com/SigmaHQ/sigma

Detects Kapeka backdoor scheduled task creation based on attributes such as paths, commands line flags, etc.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
Security-AuditingEvent ID 4698A scheduled task was created.

Rule body yaml

title: Kapeka Backdoor Scheduled Task Creation
id: 6c130acd-0adb-4545-bcc4-2e85d0883c9a
related:
    - id: 64a871dd-83f6-4e5f-80fc-5a7ca3a8a819
      type: similar
status: test
description: Detects Kapeka backdoor scheduled task creation based on attributes such as paths, commands line flags, etc.
references:
    - https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4698
    - https://labs.withsecure.com/publications/kapeka
    - https://app.any.run/tasks/1efb3ed4-cc0f-4690-a0ed-24516809bc72/
    - https://www.virustotal.com/gui/file/bd07fb1e9b4768e7202de6cc454c78c6891270af02085c51fce5539db1386c3f/behavior
author: Swachchhanda Shrawan Poudel
date: 2024-07-03
tags:
    - attack.execution
    - attack.privilege-escalation
    - attack.persistence
    - attack.t1053.005
    - detection.emerging-threats
logsource:
    product: windows
    service: security
    definition: 'Requirements: The Advanced Audit Policy setting Object Access > Audit Other Object Access Events has to be configured to trigger this detection.'
detection:
    selection_eid:
        EventID: 4698
    selection_paths:
        TaskContent|contains:
            - ':\ProgramData\'
            - '\AppData\Local\'
    selection_command:
        TaskContent|contains|all:
            - 'rundll32'
            - '.wll'
            - '#1'
    selection_taskname:
        TaskContent|contains:
            - 'OneDrive' # The scheduled task was called “OneDrive” instead of “Sens Api” in some cases
            - 'Sens Api'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_eid

selection_eid:
    EventID: 4698

Stage 2: selection_paths

selection_paths:
    TaskContent|contains:
        - ':\ProgramData\'
        - '\AppData\Local\'

Stage 3: selection_command

selection_command:
    TaskContent|contains|all:
        - 'rundll32'
        - '.wll'
        - '#1'

Stage 4: selection_taskname

selection_taskname:
    TaskContent|contains:
        - 'OneDrive'
        - 'Sens Api'

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
TaskContentmatch
  • #1
  • .wll
  • :\ProgramData\
  • OneDrive
  • Sens Api
  • \AppData\Local\
  • rundll32 corpus 2 (sigma 2)