Detection rules › Sigma

Suspicious PowerShell Download - Powershell Script

Status
test
Severity
medium
Log source
product windows, category ps_script
Author
Florian Roth (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects suspicious PowerShell download command

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Suspicious PowerShell Download - Powershell Script
id: 403c2cc0-7f6b-4925-9423-bfa573bed7eb
related:
    - id: 65531a81-a694-4e31-ae04-f8ba5bc33759
      type: derived
status: test
description: Detects suspicious PowerShell download command
references:
    - https://learn.microsoft.com/en-us/dotnet/api/system.net.webclient.downloadstring?view=net-8.0
    - https://learn.microsoft.com/en-us/dotnet/api/system.net.webclient.downloadfile?view=net-8.0
author: Florian Roth (Nextron Systems)
date: 2017-03-05
modified: 2022-12-02
tags:
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    webclient:
        ScriptBlockText|contains: 'System.Net.WebClient'
    download:
        ScriptBlockText|contains:
            - '.DownloadFile('
            - '.DownloadFileAsync('
            - '.DownloadString('
            - '.DownloadStringAsync('
    condition: webclient and download
falsepositives:
    - PowerShell scripts that download content from the Internet
level: medium

Stages and Predicates

Stage 0: condition

webclient and download

Stage 1: webclient

webclient:
    ScriptBlockText|contains: 'System.Net.WebClient'

Stage 2: download

download:
    ScriptBlockText|contains:
        - '.DownloadFile('
        - '.DownloadFileAsync('
        - '.DownloadString('
        - '.DownloadStringAsync('

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
ScriptBlockTextmatch
  • .DownloadFile(
  • .DownloadFileAsync(
  • .DownloadString(
  • .DownloadStringAsync(
  • System.Net.WebClient corpus 3 (sigma 2, splunk 1)