Threat Huntmediumtest
Registry Set With Crypto-Classes From The "Cryptography" PowerShell Namespace
Detects the setting of a registry inside the "\Shell\Open\Command" value with PowerShell classes from the "System.Security.Cryptography" namespace. The PowerShell namespace "System.Security.Cryptography" provides classes for on-the-fly encryption and decryption. These can be used for example in decrypting malicious payload for defense evasion.
Convert In Phoenix Studio
Open this Sigma rule in the converter with the YAML preloaded and ready for backend selection.
Launch
Hunting Hypothesis
Log Source
WindowsRegistry Set
ProductWindows← raw: windows
CategoryRegistry Set← raw: registry_set
Detection Logic
Detection Logic4 selectors
detection:
selection_key:
TargetObject|contains: '\Shell\Open\Command'
selection_value_img:
Details|contains:
- 'powershell'
- 'pwsh'
selection_value_namespace:
Details|contains: 'System.Security.Cryptography.'
selection_value_classes:
Details|contains:
- '.AesCryptoServiceProvider'
- '.DESCryptoServiceProvider'
- '.DSACryptoServiceProvider'
- '.RC2CryptoServiceProvider'
- '.Rijndael'
- '.RSACryptoServiceProvider'
- '.TripleDESCryptoServiceProvider'
condition: all of selection_*False Positives
Classes are legitimately used, but less so when e.g. parents with low prevalence or decryption of content in temporary folders.
MITRE ATT&CK
Sub-techniques
Other
detection.threat-hunting
Rule Metadata
Rule ID
1c2a3268-3881-414a-80af-a5b313b14c0e
Status
test
Level
medium
Type
Threat Hunt
Created
Fri Dec 01
Path
rules-threat-hunting/windows/registry/registry_set/registry_set_powershell_crypto_namespace.yml
Raw Tags
attack.defense-evasionattack.executionattack.persistenceattack.privilege-escalationattack.t1059.001attack.t1027.010attack.t1547.001detection.threat-hunting