Detection rules › Sigma

Whoami.EXE Execution Anomaly

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

Detects the execution of whoami.exe with suspicious parent processes.

Known false positives

  • Admin activity
  • Scripts and administrative tools used in the monitored environment
  • Monitoring activity

MITRE ATT&CK coverage

TacticTechniques
Discovery

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

title: Whoami.EXE Execution Anomaly
id: 8de1cbe8-d6f5-496d-8237-5f44a721c7a0
status: test
description: Detects the execution of whoami.exe with suspicious parent processes.
references:
    - https://brica.de/alerts/alert/public/1247926/agent-tesla-keylogger-delivered-inside-a-power-iso-daa-archive/
    - https://app.any.run/tasks/7eaba74e-c1ea-400f-9c17-5e30eee89906/
    - https://www.youtube.com/watch?v=DsJ9ByX84o4&t=6s
author: Florian Roth (Nextron Systems)
date: 2021-08-12
modified: 2025-03-06
tags:
    - attack.discovery
    - attack.t1033
    - car.2016-03-001
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        - Image|endswith: '\whoami.exe'
        - OriginalFileName: 'whoami.exe'
    filter_main_known_parents:
        # This list can be any legitimate shell or application that you expect whoami to run from
        ParentImage|endswith:
            - '\cmd.exe'
            - '\powershell_ise.exe'
            - '\powershell.exe'
            - '\pwsh.exe'
    filter_optional_ms_monitoring_agent:
        ParentImage|endswith: ':\Program Files\Microsoft Monitoring Agent\Agent\MonitoringHost.exe'
    filter_main_parent_null:
        ParentImage: null
    filter_main_parent_empty:
        ParentImage:
            - ''
            - '-'
    condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
    - Admin activity
    - Scripts and administrative tools used in the monitored environment
    - Monitoring activity
level: medium

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_main_* and not 1 of filter_optional_*

Stage 1: selection

selection:
    - Image|endswith: '\whoami.exe'
    - OriginalFileName: 'whoami.exe'

Stage 2: not filter_main_*

filter_main_known_parents:
    ParentImage|endswith:
        - '\cmd.exe'
        - '\powershell_ise.exe'
        - '\powershell.exe'
        - '\pwsh.exe'
filter_main_parent_null:
    ParentImage: null
filter_main_parent_empty:
    ParentImage:
        - ''
        - '-'

Stage 3: not filter_optional_ms_monitoring_agent

filter_optional_ms_monitoring_agent:
    ParentImage|endswith: ':\Program Files\Microsoft Monitoring Agent\Agent\MonitoringHost.exe'

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
ParentImageends_with\cmd.exeexcludes:ParentImage field:"ParentImage" value:"\cmd.exe"
ParentImageends_with\powershell.exeexcludes:ParentImage field:"ParentImage" value:"\powershell.exe"
ParentImageends_with\powershell_ise.exeexcludes:ParentImage field:"ParentImage" value:"\powershell_ise.exe"
ParentImageends_with\pwsh.exeexcludes:ParentImage field:"ParentImage" value:"\pwsh.exe"
ParentImageeq-excludes:ParentImage field:"ParentImage" value:"-"
ParentImageis_null(no value, null check)excludes:ParentImage
ParentImageends_with:\Program Files\Microsoft Monitoring Agent\Agent\MonitoringHost.exeexcludes:ParentImage field:"ParentImage" value:":\Program Files\Microsoft Monitoring Agent\Agent\MonitoringHost.exe"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Imageends_with
  • \whoami.exe corpus 19 (sigma 19)
field:"Image" kind:ends_with value:"\whoami.exe"
OriginalFileNameeq
  • whoami.exe corpus 9 (sigma 9)
field:"OriginalFileName" kind:eq value:"whoami.exe"