Detection rules › Sigma

Shell Process Spawned by Java.EXE

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Andreas Hunkeler (@Karneades), Nasreddine Bencherchali
Source
github.com/SigmaHQ/sigma

Detects shell spawned from Java host process, which could be a sign of exploitation (e.g. log4j exploitation)

MITRE ATT&CK coverage

TacticTechniques
Initial AccessNo specific technique
PersistenceNo specific technique
Privilege EscalationNo specific technique

Event coverage

Rule body yaml

title: Shell Process Spawned by Java.EXE
id: dff1e1cc-d3fd-47c8-bfc2-aeb878a754c0
related:
    - id: 0d34ed8b-1c12-4ff2-828c-16fc860b766d
      type: similar
status: test
description: Detects shell spawned from Java host process, which could be a sign of exploitation (e.g. log4j exploitation)
references:
    - https://web.archive.org/web/20231230220738/https://www.lunasec.io/docs/blog/log4j-zero-day/
author: Andreas Hunkeler (@Karneades), Nasreddine Bencherchali
date: 2021-12-17
modified: 2024-01-18
tags:
    - attack.initial-access
    - attack.persistence
    - attack.privilege-escalation
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        ParentImage|endswith: '\java.exe'
        Image|endswith:
            - '\bash.exe'
            - '\cmd.exe'
            - '\powershell.exe'
            - '\pwsh.exe'
    filter_main_build:
        ParentImage|contains: 'build'  # excluding CI build agents
        CommandLine|contains: 'build'  # excluding CI build agents
    condition: selection and not 1 of filter_main_*
falsepositives:
    - Legitimate calls to system binaries
    - Company specific internal usage
level: medium

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_main_*

Stage 1: selection

selection:
    ParentImage|endswith: '\java.exe'
    Image|endswith:
        - '\bash.exe'
        - '\cmd.exe'
        - '\powershell.exe'
        - '\pwsh.exe'

Stage 2: not filter_main_build

filter_main_build:
    ParentImage|contains: 'build'
    CommandLine|contains: 'build'

Exclusions

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

FieldKindExcluded values
CommandLinematchbuild
ParentImagematchbuild

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
  • \bash.exe corpus 22 (sigma 22)
  • \cmd.exe corpus 130 (sigma 130)
  • \powershell.exe corpus 182 (sigma 182)
  • \pwsh.exe corpus 168 (sigma 168)
ParentImageends_with
  • \java.exe corpus 8 (sigma 8)