Detection rules › Sigma

Potential PowerShell Execution Via DLL

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

Detects potential PowerShell execution from a DLL instead of the usual PowerShell process as seen used in PowerShdll. This detection assumes that PowerShell commands are passed via the CommandLine.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Potential PowerShell Execution Via DLL
id: 6812a10b-60ea-420c-832f-dfcc33b646ba
status: test
description: |
    Detects potential PowerShell execution from a DLL instead of the usual PowerShell process as seen used in PowerShdll.
    This detection assumes that PowerShell commands are passed via the CommandLine.
references:
    - https://github.com/p3nt4/PowerShdll/blob/62cfa172fb4e1f7f4ac00ca942685baeb88ff356/README.md
author: Markus Neis, Nasreddine Bencherchali (Nextron Systems)
date: 2018-08-25
modified: 2024-03-07
tags:
    - attack.stealth
    - attack.t1218.011
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith:
              - '\InstallUtil.exe'
              - '\RegAsm.exe'
              - '\RegSvcs.exe'
              - '\regsvr32.exe'
              - '\rundll32.exe'
        - OriginalFileName:
              - 'InstallUtil.exe'
              - 'RegAsm.exe'
              - 'RegSvcs.exe'
              - 'REGSVR32.EXE'
              - 'RUNDLL32.EXE'
    selection_cli:
        CommandLine|contains:
            - 'Default.GetString'
            - 'DownloadString'
            - 'FromBase64String'
            - 'ICM '
            - 'IEX '
            - 'Invoke-Command'
            - 'Invoke-Expression'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_img

selection_img:
    - Image|endswith:
          - '\InstallUtil.exe'
          - '\RegAsm.exe'
          - '\RegSvcs.exe'
          - '\regsvr32.exe'
          - '\rundll32.exe'
    - OriginalFileName:
          - 'InstallUtil.exe'
          - 'RegAsm.exe'
          - 'RegSvcs.exe'
          - 'REGSVR32.EXE'
          - 'RUNDLL32.EXE'

Stage 2: selection_cli

selection_cli:
    CommandLine|contains:
        - 'Default.GetString'
        - 'DownloadString'
        - 'FromBase64String'
        - 'ICM '
        - 'IEX '
        - 'Invoke-Command'
        - 'Invoke-Expression'

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
CommandLinematch
  • Default.GetString
  • DownloadString corpus 8 (sigma 7, kusto 1)
  • FromBase64String corpus 12 (sigma 9, splunk 2, elastic 1)
  • ICM corpus 2 (sigma 2)
  • IEX corpus 6 (sigma 6)
  • Invoke-Command corpus 3 (sigma 2, splunk 1)
  • Invoke-Expression corpus 4 (sigma 4)
Imageends_with
  • \InstallUtil.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)
OriginalFileNameeq
  • InstallUtil.exe corpus 11 (sigma 6, splunk 4, elastic 1)
  • REGSVR32.EXE corpus 26 (sigma 17, splunk 6, elastic 3)
  • RUNDLL32.EXE corpus 62 (sigma 35, splunk 21, elastic 6)
  • RegAsm.exe corpus 8 (sigma 6, elastic 1, splunk 1)
  • RegSvcs.exe corpus 7 (sigma 5, elastic 1, splunk 1)