Sigma rule: Potential Xor Encoded PowerShell Command

A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-29c2ec15dd76, updated 2023-01-30T00:00:00.000Z.

SigmaHQ marks this rule as deprecated.

Rule

Title
Potential Xor Encoded PowerShell Command
Status
deprecated
Level
medium
Author
Teymur Kheirkhabarov (idea), Vasiliy Burov (rule), oscd.community, Tim Shelton
Date
2022/07/06
Modified
2023/01/30
File
deprecated/windows/proc_creation_win_powershell_xor_encoded_command.yml
Commit
ccbb0369507f796db0b0ae6854c8a2be471b9d84

Detects usage of "xor" or "bxor" in combination of a "foreach" loop. This pattern is often found in encoded powershell code and commands as a way to avoid detection

Log source

product
windows
category
process_creation

Detection

selection_img:
    - Image|endswith:
        - '\powershell.exe'
        - '\pwsh.exe'
    - OriginalFileName:
        - 'PowerShell.exe'
        - 'pwsh.dll'
selection_cli:
    CommandLine|contains|all:
        - 'ForEach'
        - 'Xor'
condition: all of selection_*

False positives (as the rule lists them)

  • Unknown

Tags

  • attack.defense_evasion
  • attack.t1027
  • attack.execution
  • attack.t1059.001

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/deprecated/windows/proc_creation_win_powershell_xor_encoded_command.yml

Sources and licences

  • SigmaHQ

    "Potential Xor Encoded PowerShell Command" by Teymur Kheirkhabarov (idea), Vasiliy Burov (rule), oscd.community, Tim Shelton (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/deprecated/windows/proc_creation_win_powershell_xor_encoded_command.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: Potential Xor Encoded PowerShell Command",
entity page, dataset version ref-29c2ec15dd76, updated 2023-01-30T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/5b572dcf-254b-425c-a8c5-d9af6bea35a6 (accessed 2026-11-03).
Underlying source: SigmaHQ rule 5b572dcf-254b-425c-a8c5-d9af6bea35a6, 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.