Suspicious New Generic Credentials Added Through Cmdkey.EXE (via process_creation)

This rule detects use of "cmdkey.exe" to add generic credentials. As an example, this can be used before connecting to an RDP session via command line interface.

SigmamediumWindowsv1
sigma
title: Suspicious New Generic Credentials Added Through Cmdkey.EXE (via process_creation)
id: 61c1c7ec-a40c-5e16-ae06-41487082bac4
status: stable
description: This rule detects use of "cmdkey.exe" to add generic credentials. As an example, this can be used before connecting to an RDP session via command line interface.
references:
    - https://attack.mitre.org/techniques/T1003/005/
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1021.001/T1021.001.md#t1021001---remote-desktop-protocol
author: Huntrule Team
date: 2026-07-24
tags:
    - attack.credential-access
    - attack.t1003.005
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\cmdkey.exe'
        - OriginalFileName: 'cmdkey.exe'
    selection_cli_generic:
        CommandLine|contains|windash: ' -g'
    selection_cli_user:
        CommandLine|contains|windash: ' -u'
    selection_cli_password:
        CommandLine|contains|windash: ' -p'
    condition: all of selection_*
falsepositives:
    - Unknown
level: medium
regression_tests_path: regression_data/rules/windows/process_creation/proc_creation_win_cmdkey_adding_generic_creds/info.yml
simulation:
    - type: atomic-red-team
      name: RDP to DomainController
      technique: T1021.001
      atomic_guid: 355d4632-8cb9-449d-91ce-b566d0253d3e

Known false positives

  • Unknown

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