Threat Huntmediumtest

Invocation Of Crypto-Classes From The "Cryptography" PowerShell Namespace

Detects the invocation of PowerShell commands with references to 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
Andreas Braathen (mnemonic.io)Created Fri Dec 01ad856965-f44d-42a8-945e-bbf7bd03d05awindows
Hunting Hypothesis
Log Source
WindowsProcess Creation
ProductWindows← raw: windows
CategoryProcess Creation← raw: process_creation

Events generated when a new process is spawned on the system. Covers command-line arguments, parent/child relationships, and process metadata.

Detection Logic
Detection Logic3 selectors
detection:
    selection_img:
        - Image|endswith:
              - '\powershell.exe'
              - '\pwsh.exe'
        - OriginalFileName:
              - 'PowerShell.EXE'
              - 'pwsh.dll'
    selection_cmdlet_namespace:
        CommandLine|contains: 'System.Security.Cryptography.'
    selection_cmdlet_classes:
        CommandLine|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.

Rule Metadata
Rule ID
ad856965-f44d-42a8-945e-bbf7bd03d05a
Status
test
Level
medium
Type
Threat Hunt
Created
Fri Dec 01
Path
rules-threat-hunting/windows/process_creation/proc_creation_win_powershell_crypto_namespace.yml
Raw Tags
attack.defense-evasionattack.executionattack.t1059.001attack.t1027.010detection.threat-hunting
View on GitHub