Windows Process Creation: NirCmd Command Execution

Alerts when NirCmd.exe is launched with command-execution-oriented parameters in the process command line.

FreeUnreviewedSigmamediumv1
title: "Windows Process Creation: NirCmd Command Execution"
id: bf88bb5d-1b99-482a-b848-681350984f67
status: test
description: This rule flags Windows process executions of NirCmd (NirCmd.exe) where the command line includes NirCmd command execution features such as execmd, shexec, runinteractive, or script-based execution. Attackers can use NirCmd to run arbitrary commands and manipulate execution behavior, making process command-line telemetry a key indicator. The detection relies on process creation logs with Image/OriginalFileName and CommandLine content matches.
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
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_pua_nircmd.yml
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems), Huntrule Team
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
license: DRL-1.1
related:
  - id: 4e2ed651-1906-4a59-a78a-18220fca1b22
    type: derived

What it detects

This rule flags Windows process executions of NirCmd (NirCmd.exe) where the command line includes NirCmd command execution features such as execmd, shexec, runinteractive, or script-based execution. Attackers can use NirCmd to run arbitrary commands and manipulate execution behavior, making process command-line telemetry a key indicator. The detection relies on process creation logs with Image/OriginalFileName and CommandLine content matches.

Known false positives

  • Legitimate use by administrators

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.