Sigma rule: Potentially Suspicious CMD Shell Output Redirect

A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-090ab9cd5f19, updated 2024-03-19T00:00:00.000Z.

Rule

Title
Potentially Suspicious CMD Shell Output Redirect
Status
test
Level
medium
Author
Nasreddine Bencherchali (Nextron Systems)
Date
2022-07-12
Modified
2024-03-19
File
rules/windows/process_creation/proc_creation_win_cmd_redirection_susp_folder.yml
Commit
ccbb0369507f796db0b0ae6854c8a2be471b9d84

Detects inline Windows shell commands redirecting output via the ">" symbol to a suspicious location.
This technique is sometimes used by malicious actors in order to redirect the output of reconnaissance commands such as "hostname" and "dir" to files for future exfiltration.

Log source

product
windows
category
process_creation

Detection

selection_img:
    - Image|endswith: '\cmd.exe'
    - OriginalFileName: 'Cmd.Exe'
selection_cli_1:
    CommandLine|contains:
        # Note: Add more suspicious locations as you find them
        # Note: The space from the start is missing to cover append operations ">>"
        # Note: We use the "?" to account for both a single and a double quote
        # Note: If you want to account for more spaces which is still a valid bypass option. Use a regex with "\s"
        - '>?%APPDATA%\'
        - '>?%TEMP%\'
        - '>?%TMP%\'
        - '>?%USERPROFILE%\'
        - '>?C:\ProgramData\'
        - '>?C:\Temp\'
        - '>?C:\Users\Public\'
        - '>?C:\Windows\Temp\'
selection_cli_2:
    CommandLine|contains:
        - ' >'
        - '">'
        - "'>"
    CommandLine|contains|all:
        - 'C:\Users\'
        - '\AppData\Local\'
condition: selection_img and 1 of selection_cli_*

False positives (as the rule lists them)

  • Legitimate admin or third party scripts used for diagnostic collection might generate some false positives

Tags

  • attack.stealth
  • attack.t1218

MITRE ATT&CK ids this rule names

Related rules

References

Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/process_creation/proc_creation_win_cmd_redirection_susp_folder.yml

Sources and licences

  • SigmaHQ

    "Potentially Suspicious CMD Shell Output Redirect" by Nasreddine Bencherchali (Nextron Systems) (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/process_creation/proc_creation_win_cmd_redirection_susp_folder.yml.
    Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License

    Detection Rule License (DRL) 1.1

Cite this page

Dragons Eye Ransomware Tracker, "Sigma rule: Potentially Suspicious CMD Shell Output Redirect",
entity page, dataset version ref-090ab9cd5f19, updated 2024-03-19T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/8e0bb260-d4b2-4fff-bb8d-3f82118e6892 (accessed 2026-11-03).
Underlying source: SigmaHQ rule 8e0bb260-d4b2-4fff-bb8d-3f82118e6892, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.

Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.