Detection rules › Sigma

Suspicious Invoke-WebRequest Execution

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

Detects a suspicious call to Invoke-WebRequest cmdlet where the and output is located in a suspicious location

MITRE ATT&CK coverage

TacticTechniques
Command & ControlT1105 Ingress Tool Transfer

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Suspicious Invoke-WebRequest Execution
id: 5e3cc4d8-3e68-43db-8656-eaaeefdec9cc
related:
    - id: e218595b-bbe7-4ee5-8a96-f32a24ad3468
      type: derived
status: test
description: Detects a suspicious call to Invoke-WebRequest cmdlet where the and output is located in a suspicious location
references:
    - https://www.sentinelone.com/blog/living-off-windows-defender-lockbit-ransomware-sideloads-cobalt-strike-through-microsoft-security-tool/
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-08-02
modified: 2025-07-18
tags:
    - attack.command-and-control
    - attack.t1105
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith:
              - '\powershell_ise.exe'
              - '\powershell.exe'
              - '\pwsh.exe'
        - OriginalFileName:
              - 'powershell_ise.EXE'
              - 'PowerShell.EXE'
              - 'pwsh.dll'
    selection_commands:
        CommandLine|contains:
            # These are all aliases of Invoke-WebRequest
            - 'curl '
            - 'Invoke-WebRequest'
            - 'iwr '
            - 'wget '
    selection_flags:
        CommandLine|contains:
            - ' -ur'
            - ' -o'
    selection_susp_locations:
        CommandLine|contains:
            - '\AppData\'
            - '\Desktop\'
            - '\Temp\'
            - '\Users\Public\'
            - '%AppData%'
            - '%Public%'
            - '%Temp%'
            - '%tmp%'
            - ':\Windows\'
    condition: all of selection_*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_img

selection_img:
    - Image|endswith:
          - '\powershell_ise.exe'
          - '\powershell.exe'
          - '\pwsh.exe'
    - OriginalFileName:
          - 'powershell_ise.EXE'
          - 'PowerShell.EXE'
          - 'pwsh.dll'

Stage 2: selection_commands

selection_commands:
    CommandLine|contains:
        - 'curl '
        - 'Invoke-WebRequest'
        - 'iwr '
        - 'wget '

Stage 3: selection_flags

selection_flags:
    CommandLine|contains:
        - ' -ur'
        - ' -o'

Stage 4: selection_susp_locations

selection_susp_locations:
    CommandLine|contains:
        - '\AppData\'
        - '\Desktop\'
        - '\Temp\'
        - '\Users\Public\'
        - '%AppData%'
        - '%Public%'
        - '%Temp%'
        - '%tmp%'
        - ':\Windows\'

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
  • -o corpus 7 (sigma 6, chronicle 1)
  • -ur corpus 3 (sigma 2, chronicle 1)
  • %AppData% corpus 13 (sigma 11, chronicle 2)
  • %Public% corpus 7 (sigma 5, chronicle 2)
  • %Temp% corpus 16 (sigma 13, chronicle 2, kusto 1)
  • %tmp% corpus 15 (sigma 13, chronicle 2)
  • :\Windows\ corpus 2 (sigma 2)
  • Invoke-WebRequest corpus 13 (sigma 10, elastic 1, chronicle 1, kusto 1)
  • \AppData\ corpus 8 (sigma 8)
  • \Desktop\ corpus 13 (sigma 13)
  • \Temp\ corpus 5 (sigma 5)
  • \Users\Public\ corpus 17 (sigma 17)
  • curl corpus 12 (sigma 11, chronicle 1)
  • iwr corpus 13 (sigma 11, chronicle 2)
  • wget corpus 8 (sigma 7, chronicle 1)
Imageends_with
  • \powershell.exe corpus 182 (sigma 182)
  • \powershell_ise.exe corpus 41 (sigma 41)
  • \pwsh.exe corpus 168 (sigma 168)
OriginalFileNameeq
  • PowerShell.EXE corpus 120 (sigma 84, splunk 30, elastic 6)
  • powershell_ise.EXE corpus 51 (splunk 30, sigma 18, elastic 3)
  • pwsh.dll corpus 112 (sigma 79, splunk 30, elastic 3)