Detection rules › Sigma

Whoami.EXE Execution With Output Option

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 the execution of "whoami.exe" with the "/FO" flag to choose CSV as output format or with redirection options to export the results to a file for later use.

MITRE ATT&CK coverage

TacticTechniques
DiscoveryT1033 System Owner/User Discovery

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Whoami.EXE Execution With Output Option
id: c30fb093-1109-4dc8-88a8-b30d11c95a5d
status: test
description: Detects the execution of "whoami.exe" with the "/FO" flag to choose CSV as output format or with redirection options to export the results to a file for later use.
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), Nasreddine Bencherchali (Nextron Systems)
date: 2023-02-28
modified: 2023-12-04
tags:
    - attack.discovery
    - attack.t1033
    - car.2016-03-001
logsource:
    category: process_creation
    product: windows
detection:
    selection_main_img:
        - Image|endswith: '\whoami.exe'
        - OriginalFileName: 'whoami.exe'
    selection_main_cli:
        CommandLine|contains:
            - ' /FO CSV'
            - ' -FO CSV'
    selection_special:
        CommandLine|contains: 'whoami*>'
    condition: all of selection_main_* or selection_special
falsepositives:
    - Unknown
level: medium

Stages and Predicates

Stage 0: condition

all of selection_main_* or selection_special

Stage 1: selection_main_img

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

Stage 2: selection_main_cli

selection_main_cli:
    CommandLine|contains:
        - ' /FO CSV'
        - ' -FO CSV'

Stage 3: selection_special

selection_special:
    CommandLine|contains: 'whoami*>'

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
  • -FO CSV
  • /FO CSV
  • whoami*>
Imageends_with
  • \whoami.exe corpus 19 (sigma 19)
OriginalFileNameeq
  • whoami.exe corpus 9 (sigma 9)