Detection rules › Splunk

PowerShell CreateDecryptor (PowerShell)

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

Event coverage

Rule body yaml

id: '45003.90177'
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_powershell` (TERM(EventCode=4103) OR
  "EventID>4103<" OR TERM(EventCode=4104) OR "EventID>4104<") "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:
- PowerShell logs
- Process command-line parameters
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_powershell` (TERM(EventCode=4103) OR "EventID>4103<" OR TERM(EventCode=4104) OR "EventID>4104<") "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

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
EventCodeeq
  • 4103 corpus 105 (splunk 105)
  • 4104 corpus 268 (splunk 268)
processregex_match
  • "(?i)CreateDecryptor" corpus 3 (splunk 3)

Search terms

Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.

StageTerm
1TERM
1"EventID>4103<"
1TERM
1"EventID>4104<"
1"CreateDecryptor"