Detection rules › Sigma

Bad Opsec Defaults Sacrificial Processes With Improper Arguments

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Oleg Kolesnikov @securonix invrep_de, oscd.community, Florian Roth (Nextron Systems), Christian Burkard (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects attackers using tooling with bad opsec defaults. E.g. spawning a sacrificial process to inject a capability into the process without taking into account how the process is normally run. One trivial example of this is using rundll32.exe without arguments as a sacrificial process (default in CS, now highlighted by c2lint), running WerFault without arguments (Kraken - credit am0nsec), and other examples.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Bad Opsec Defaults Sacrificial Processes With Improper Arguments
id: a7c3d773-caef-227e-a7e7-c2f13c622329
related:
    - id: f5647edc-a7bf-4737-ab50-ef8c60dc3add
      type: obsolete
status: test
description: |
    Detects attackers using tooling with bad opsec defaults.
    E.g. spawning a sacrificial process to inject a capability into the process without taking into account how the process is normally run.
    One trivial example of this is using rundll32.exe without arguments as a sacrificial process (default in CS, now highlighted by c2lint), running WerFault without arguments (Kraken - credit am0nsec), and other examples.
references:
    - https://blog.malwarebytes.com/malwarebytes-news/2020/10/kraken-attack-abuses-wer-service/
    - https://www.cobaltstrike.com/help-opsec
    - https://twitter.com/CyberRaiju/status/1251492025678983169
    - https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/regsvr32
    - https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rundll32
    - https://learn.microsoft.com/en-us/dotnet/framework/tools/regasm-exe-assembly-registration-tool
    - https://learn.microsoft.com/en-us/dotnet/framework/tools/regsvcs-exe-net-services-installation-tool
author: Oleg Kolesnikov @securonix invrep_de, oscd.community, Florian Roth (Nextron Systems), Christian Burkard (Nextron Systems)
date: 2020-10-23
modified: 2024-08-15
tags:
    - attack.stealth
    - attack.t1218.011
logsource:
    category: process_creation
    product: windows
detection:
    selection_werfault:
        Image|endswith: '\WerFault.exe'
        CommandLine|endswith: 'WerFault.exe'
    selection_rundll32:
        Image|endswith: '\rundll32.exe'
        CommandLine|endswith: 'rundll32.exe'
    selection_regsvcs:
        Image|endswith: '\regsvcs.exe'
        CommandLine|endswith: 'regsvcs.exe'
    selection_regasm:
        Image|endswith: '\regasm.exe'
        CommandLine|endswith: 'regasm.exe'
    selection_regsvr32:
        Image|endswith: '\regsvr32.exe'
        CommandLine|endswith: 'regsvr32.exe'
    filter_optional_edge_update:
        ParentImage|contains: '\AppData\Local\Microsoft\EdgeUpdate\Install\{'
        Image|endswith: '\rundll32.exe'
        CommandLine|endswith: 'rundll32.exe'
    filter_optional_chromium_installer:
        # As reported in https://github.com/SigmaHQ/sigma/issues/4570 and others
        ParentImage|contains:
            - '\AppData\Local\BraveSoftware\Brave-Browser\Application\'
            - '\AppData\Local\Google\Chrome\Application\'
        ParentImage|endswith: '\Installer\setup.exe'
        ParentCommandLine|contains: '--uninstall '
        Image|endswith: '\rundll32.exe'
        CommandLine|endswith: 'rundll32.exe'
    condition: 1 of selection_* and not 1 of filter_optional_*
falsepositives:
    - Unlikely
level: high

Stages and Predicates

Stage 0: condition

1 of selection_* and not 1 of filter_optional_*

Stage 1: selection_werfault

selection_werfault:
    Image|endswith: '\WerFault.exe'
    CommandLine|endswith: 'WerFault.exe'

Stage 2: selection_rundll32

selection_rundll32:
    Image|endswith: '\rundll32.exe'
    CommandLine|endswith: 'rundll32.exe'

Stage 3: selection_regsvcs

selection_regsvcs:
    Image|endswith: '\regsvcs.exe'
    CommandLine|endswith: 'regsvcs.exe'

Stage 4: selection_regasm

selection_regasm:
    Image|endswith: '\regasm.exe'
    CommandLine|endswith: 'regasm.exe'

Stage 5: selection_regsvr32

selection_regsvr32:
    Image|endswith: '\regsvr32.exe'
    CommandLine|endswith: 'regsvr32.exe'

Stage 6: not filter_optional_*

filter_optional_edge_update:
    ParentImage|contains: '\AppData\Local\Microsoft\EdgeUpdate\Install\{'
    Image|endswith: '\rundll32.exe'
    CommandLine|endswith: 'rundll32.exe'
filter_optional_chromium_installer:
    ParentImage|contains:
        - '\AppData\Local\BraveSoftware\Brave-Browser\Application\'
        - '\AppData\Local\Google\Chrome\Application\'
    ParentImage|endswith: '\Installer\setup.exe'
    ParentCommandLine|contains: '--uninstall '
    Image|endswith: '\rundll32.exe'
    CommandLine|endswith: 'rundll32.exe'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
ParentImagematch\AppData\Local\BraveSoftware\Brave-Browser\Application\
ParentImagematch\AppData\Local\Google\Chrome\Application\
CommandLineends_withrundll32.exe
Imageends_with\rundll32.exe
ParentCommandLinematch--uninstall
ParentImageends_with\Installer\setup.exe
CommandLineends_withrundll32.exe
Imageends_with\rundll32.exe
ParentImagematch\AppData\Local\Microsoft\EdgeUpdate\Install\{

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
CommandLineends_with
  • WerFault.exe
  • regasm.exe
  • regsvcs.exe
  • regsvr32.exe
  • rundll32.exe corpus 2 (sigma 2)
Imageends_with
  • \WerFault.exe corpus 9 (sigma 9)
  • \regasm.exe corpus 9 (sigma 9)
  • \regsvcs.exe corpus 8 (sigma 8)
  • \regsvr32.exe corpus 65 (sigma 65)
  • \rundll32.exe corpus 95 (sigma 95)