Sigma Rule Library

Suspicious PowerShell Download - Powershell Script

Detects suspicious PowerShell download command

View on GitHubOpen raw file

Detection logic

webclient

ScriptBlockText|contains: System.Net.WebClient

download

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

Condition

webclient and download

Raw 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

False positives

  • PowerShell scripts that download content from the Internet

References

  • derived65531a81-a694-4e31-ae04-f8ba5bc33759

Similar rules