Detection rules › Sigma

PUA - NirCmd Execution

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 use of NirCmd tool for command execution, which could be the result of legitimate administrative activity

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: PUA - NirCmd Execution
id: 4e2ed651-1906-4a59-a78a-18220fca1b22
status: test
description: Detects the use of NirCmd tool for command execution, which could be the result of legitimate administrative activity
references:
    - https://www.nirsoft.net/utils/nircmd.html
    - https://www.winhelponline.com/blog/run-program-as-system-localsystem-account-windows/
    - https://www.nirsoft.net/utils/nircmd2.html#using
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2022-01-24
modified: 2023-02-13
tags:
    - attack.execution
    - attack.t1569.002
    - attack.s0029
logsource:
    category: process_creation
    product: windows
detection:
    selection_org:
        - Image|endswith: '\NirCmd.exe'
        - OriginalFileName: 'NirCmd.exe'
    selection_cmd:
        CommandLine|contains:
            - ' execmd '
            - '.exe script '
            - '.exe shexec '
            - ' runinteractive '
    combo_exec:
        CommandLine|contains:
            - ' exec '
            - ' exec2 '
    combo_exec_params:
        CommandLine|contains:
            - ' show '
            - ' hide '
    condition: 1 of selection_* or all of combo_*
falsepositives:
    - Legitimate use by administrators
level: medium

Stages and Predicates

Stage 0: condition

1 of selection_* or all of combo_*

Stage 1: selection_org

selection_org:
    - Image|endswith: '\NirCmd.exe'
    - OriginalFileName: 'NirCmd.exe'

Stage 2: selection_cmd

selection_cmd:
    CommandLine|contains:
        - ' execmd '
        - '.exe script '
        - '.exe shexec '
        - ' runinteractive '

Stage 3: combo_exec

combo_exec:
    CommandLine|contains:
        - ' exec '
        - ' exec2 '

Stage 4: combo_exec_params

combo_exec_params:
    CommandLine|contains:
        - ' show '
        - ' hide '

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
  • exec corpus 3 (sigma 2, splunk 1)
  • exec2
  • execmd
  • hide
  • runinteractive
  • show corpus 2 (sigma 1, splunk 1)
  • .exe script
  • .exe shexec
Imageends_with
  • \NirCmd.exe
OriginalFileNameeq
  • NirCmd.exe corpus 2 (sigma 2)