Detection rules › Sigma

Potential PowerShell Execution Via DLL

Status
test
Severity
high
Log source
category process_creation, product windows
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

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

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

These rows show field, operator, and value matches.

FieldKindValuesSearch
CommandLinematch
  • Default.GetString
  • DownloadString corpus 9 (sigma 7, elastic 1, kusto 1)
  • FromBase64String corpus 15 (sigma 9, elastic 4, splunk 2)
  • ICM corpus 2 (sigma 2)
  • IEX corpus 7 (sigma 6, elastic 1)
  • Invoke-Command corpus 3 (sigma 2, splunk 1)
  • Invoke-Expression corpus 5 (sigma 4, elastic 1)
field:"CommandLine" kind:match
Imageends_with
  • \InstallUtil.exe corpus 8 (sigma 8)
  • \RegAsm.exe corpus 9 (sigma 9)
  • \RegSvcs.exe corpus 8 (sigma 8)
  • \regsvr32.exe corpus 64 (sigma 64)
  • \rundll32.exe corpus 94 (sigma 94)
field:"Image" kind:ends_with
OriginalFileNameeq
  • InstallUtil.exe corpus 21 (elastic 11, sigma 6, splunk 4)
  • REGSVR32.EXE corpus 37 (sigma 17, elastic 15, splunk 5)
  • RUNDLL32.EXE corpus 78 (sigma 35, elastic 22, splunk 21)
  • RegAsm.exe corpus 14 (elastic 7, sigma 6, splunk 1)
  • RegSvcs.exe corpus 13 (elastic 7, sigma 5, splunk 1)
field:"OriginalFileName" kind:eq