PowerShell Crypto Namespace Class Invocation for Windows Process Creation

Alerts on PowerShell executions that reference System.Security.Cryptography and common crypto class names.

FreeReviewedSigma · Medium · v5
Product
windows
Category
process_creation
Author
Andreas Braathen (mnemonic.io) (SigmaHQ), DRL 1.1
Published
2023-12-01
Updated
2026-07-31
title: PowerShell Crypto Namespace Class Invocation for Windows Process Creation
id: 4d1f81dc-87e5-4b69-b5be-c2736e28a7a1
status: test
description: This rule flags Windows process creation events where PowerShell (powershell.exe or pwsh.exe) is launched with command-line content referencing the System.Security.Cryptography namespace and specific cryptography class names. Attackers may use built-in .NET cryptography APIs to perform on-the-fly decryption or encryption during execution for stealth and payload handling. The detection relies on process creation telemetry containing the process image and the full command line text.
references:
  - https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography?view=net-8.0
  - https://blogs.vmware.com/security/2023/11/jupyter-rising-an-update-on-jupyter-infostealer.html
  - https://www.virustotal.com/gui/file/39102fb7bb6a74a9c8cb6d46419f9015b381199ea8524c1376672b30fffd69d2
  - https://github.com/SigmaHQ/sigma/blob/master/rules-threat-hunting/windows/process_creation/proc_creation_win_powershell_crypto_namespace.yml
author: Andreas Braathen (mnemonic.io), Huntrule Team
date: 2023-12-01
tags:
  - attack.execution
  - attack.stealth
  - attack.t1059.001
  - attack.t1027.010
  - detection.threat-hunting
logsource:
  product: windows
  category: process_creation
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_*
falsepositives:
  - Classes are legitimately used, but less so when e.g. parents with low prevalence or decryption of content in temporary folders.
level: medium
license: DRL-1.1
related:
  - id: ad856965-f44d-42a8-945e-bbf7bd03d05a
    type: derived