Detection rules › Splunk

PowerShell CreateDecryptor (Windows Event Log)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Threat actors may abuse the CreateDecryptor() method within PowerShell scripts to dynamically decrypt embedded payloads, configuration files, or sensitive data at runtime. CreateDecryptor() is part of legitimate .NET cryptographic operations, but its presence in PowerShell ScriptBlock or CommandLine activity — especially outside normal application behavior — often signals malware unpacking, fileless attacks, or ransomware staging. This use case detects references to CreateDecryptor in PowerShell activity, potentially indicating obfuscated payload execution or preparation for in-memory attacks.

MITRE ATT&CK coverage

References

Telemetry coverage

Rule body

id: '45003.90187'
title: PowerShell CreateDecryptor
description: Threat actors may abuse the CreateDecryptor() method within PowerShell
  scripts to dynamically decrypt embedded payloads, configuration files, or sensitive
  data at runtime. CreateDecryptor() is part of legitimate .NET cryptographic operations,
  but its presence in PowerShell ScriptBlock or CommandLine activity — especially
  outside normal application behavior — often signals malware unpacking, fileless
  attacks, or ransomware staging. This use case detects references to CreateDecryptor
  in PowerShell activity, potentially indicating obfuscated payload execution or preparation
  for in-memory attacks.
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "EventID>4688<" OR Type=Process) (TERM(powershell) OR TERM(pwsh)) "CreateDecryptor"
  | regex process="(?i)CreateDecryptor" | table _time, host, user process, process_*,
  signature_id | bin span=1s | stats values(*) as * by _time, host '
techniques:
- execution:command and scripting interpreter:powershell
- defense-evasion:obfuscated files or information
technique_id:
- T1059.001
- T1027
data_category:
- Process command-line parameters
- Windows event logs
references:
- https://www.cybereason.com/blog/threat-analysis-lummastealer-2.0
- https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.symmetricalgorithm.createdecryptor?view=net-9.0
- https://www.virustotal.com/gui/file/034694376c291c82789e7dc2c8771a4dff47c1c447f2ea7427edb968f480fa71

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "EventID>4688<" OR Type=Process) (TERM(powershell) OR TERM(pwsh)) "CreateDecryptor"

Stage 2: regex

| regex process="(?i)CreateDecryptor"

Stage 3: table

| table _time, host, user process, process_*, signature_id

Stage 4: bucket

| bin span=1s

Stage 5: stats

| stats values(*) as * by _time, host

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4688 corpus 317 (splunk 283, kusto 33, elastic 1)
field:"EventID" kind:eq value:"4688"
processregex_match
  • "(?i)CreateDecryptor" corpus 3 (splunk 3)
field:"CommandLine" kind:regex_match

Search terms

These SPL tokens match against raw event text.

StageTerm
1"EventID>4688<"
1powershell
1pwsh
1"CreateDecryptor"