Detection rules › Sigma

Email Exifiltration Via Powershell

Status
test
Severity
high
Log source
product windows, category process_creation
Author
Nasreddine Bencherchali (Nextron Systems), Azure-Sentinel (idea)
Source
github.com/SigmaHQ/sigma

Detects email exfiltration via powershell cmdlets

MITRE ATT&CK coverage

TacticTechniques
ExfiltrationNo specific technique

Event coverage

Rule body yaml

title: Email Exifiltration Via Powershell
id: 312d0384-401c-4b8b-abdf-685ffba9a332
status: test
description: Detects email exfiltration via powershell cmdlets
references:
    - https://www.microsoft.com/security/blog/2022/09/07/profiling-dev-0270-phosphorus-ransomware-operations/
    - https://github.com/Azure/Azure-Sentinel/blob/7e6aa438e254d468feec061618a7877aa528ee9f/Hunting%20Queries/Microsoft%20365%20Defender/Ransomware/DEV-0270/Email%20data%20exfiltration%20via%20PowerShell.yaml
author: Nasreddine Bencherchali (Nextron Systems),  Azure-Sentinel (idea)
date: 2022-09-09
tags:
    - attack.exfiltration
logsource:
    category: process_creation
    product: windows
detection:
    selection:
        Image|endswith:
            - '\powershell.exe'
            - '\pwsh.exe'
        CommandLine|contains|all:
            - 'Add-PSSnapin'
            - 'Get-Recipient'
            - '-ExpandProperty'
            - 'EmailAddresses'
            - 'SmtpAddress'
            - '-hidetableheaders'
    condition: selection
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    Image|endswith:
        - '\powershell.exe'
        - '\pwsh.exe'
    CommandLine|contains|all:
        - 'Add-PSSnapin'
        - 'Get-Recipient'
        - '-ExpandProperty'
        - 'EmailAddresses'
        - 'SmtpAddress'
        - '-hidetableheaders'

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
CommandLinematch
  • -ExpandProperty corpus 2 (sigma 1, kusto 1)
  • -hidetableheaders corpus 2 (sigma 1, kusto 1)
  • Add-PSSnapin corpus 3 (sigma 2, kusto 1)
  • EmailAddresses corpus 2 (sigma 1, kusto 1)
  • Get-Recipient corpus 2 (sigma 1, kusto 1)
  • SmtpAddress corpus 2 (sigma 1, kusto 1)
Imageends_with
  • \powershell.exe corpus 182 (sigma 182)
  • \pwsh.exe corpus 168 (sigma 168)