Possible PowerShell Script With File Upload Capabilities (via ps_script)

This rule detects PowerShell scripts abusing the "Invoke-WebRequest" cmdlet to send data via either "PUT" or "POST" method.

SigmalowWindowsv1
sigma
title: Possible PowerShell Script With File Upload Capabilities (via ps_script)
id: 483c7dbe-e15a-571f-b566-550d48f73841
status: stable
description: This rule detects PowerShell scripts abusing the "Invoke-WebRequest" cmdlet to send data via either "PUT" or "POST" method.
references:
    - https://attack.mitre.org/techniques/T1020/
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1020/T1020.md
    - https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
    - https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-7.4
author: Huntrule Team
date: 2026-05-11
tags:
    - attack.exfiltration
    - attack.t1020
logsource:
    product: windows
    category: ps_script
    definition: bade5735-5ab0-4aa7-a642-a11be0e40872
detection:
    selection_cmdlet:
        ScriptBlockText|contains:
            - 'Invoke-RestMethod'
            - 'Invoke-WebRequest'
            - 'irm '
            - 'iwr '
    selection_flag:
        ScriptBlockText|contains:
            - '-Method "POST"'
            - '-Method "PUT"'
            - '-Method POST'
            - '-Method PUT'
            - "-Method 'POST'"
            - "-Method 'PUT'"
    condition: all of selection_*
falsepositives:
    - Unknown
level: low

Known false positives

  • Unknown

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.