Detection rules › Sigma

Scripting/CommandLine Process Spawned Regsvr32

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects various command line and scripting engines/processes such as "PowerShell", "Wscript", "Cmd", etc. spawning a "regsvr32" instance.

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Scripting/CommandLine Process Spawned Regsvr32
id: ab37a6ec-6068-432b-a64e-2c7bf95b1d22
related:
    - id: 8e2b24c9-4add-46a0-b4bb-0057b4e6187d
      type: obsolete
status: test
description: Detects various command line and scripting engines/processes such as "PowerShell", "Wscript", "Cmd", etc. spawning a "regsvr32" instance.
references:
    - https://web.archive.org/web/20171001085340/https://subt0x10.blogspot.com/2017/04/bypass-application-whitelisting-script.html
    - https://app.any.run/tasks/34221348-072d-4b70-93f3-aa71f6ebecad/
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2023-05-26
tags:
    - attack.stealth
    - attack.t1218.010
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        ParentImage|endswith:
            - '\cmd.exe'
            - '\cscript.exe'
            - '\mshta.exe'
            - '\powershell_ise.exe'
            - '\powershell.exe'
            - '\pwsh.exe'
            - '\wscript.exe'
        Image|endswith: '\regsvr32.exe'
    filter_main_rpcproxy:
        ParentImage: C:\Windows\System32\cmd.exe
        CommandLine|endswith: ' /s C:\Windows\System32\RpcProxy\RpcProxy.dll'
    condition: selection and not 1 of filter_main_*
falsepositives:
    - Legitimate ".bat", ".hta", ".ps1" or ".vbs" scripts leverage legitimately often. Apply additional filter and exclusions as necessary
    - Some legitimate Windows services
level: medium # Can be reduced to low if you experience a ton of FP

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_main_*

Stage 1: selection

selection:
    ParentImage|endswith:
        - '\cmd.exe'
        - '\cscript.exe'
        - '\mshta.exe'
        - '\powershell_ise.exe'
        - '\powershell.exe'
        - '\pwsh.exe'
        - '\wscript.exe'
    Image|endswith: '\regsvr32.exe'

Stage 2: not filter_main_rpcproxy

filter_main_rpcproxy:
    ParentImage: C:\Windows\System32\cmd.exe
    CommandLine|endswith: ' /s C:\Windows\System32\RpcProxy\RpcProxy.dll'

Exclusions

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

FieldKindExcluded values
CommandLineends_with /s C:\Windows\System32\RpcProxy\RpcProxy.dll
ParentImageeqC:\Windows\System32\cmd.exe

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
Imageends_with
  • \regsvr32.exe corpus 65 (sigma 65)
ParentImageends_with
  • \cmd.exe corpus 20 (sigma 20)
  • \cscript.exe corpus 17 (sigma 17)
  • \mshta.exe corpus 13 (sigma 13)
  • \powershell.exe corpus 24 (sigma 24)
  • \powershell_ise.exe corpus 3 (sigma 3)
  • \pwsh.exe corpus 21 (sigma 21)
  • \wscript.exe corpus 19 (sigma 19)