Detection rules › Splunk
Invoke-WebRequest Command (Windows Event Log)
Detects when typical download commands are executed
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | T1059.001 Command and Scripting Interpreter: PowerShell |
| Command & Control | T1105 Ingress Tool Transfer |
Event coverage
| Provider | Event | Title |
|---|---|---|
| Security-Auditing | Event ID 4688 | A new process has been created. |
Rule body yaml
id: '5443.5591'
title: Invoke-WebRequest Command
description: 'Detects when typical download commands are executed -- Threat Actor
Association: APT28/Fancy Bear, FIN13, Flax Typhoon, Kimsuky, Memento Team, NewsPenguin,
Prophet Spider, TA2541, TA505, WinterVivern/UAC-0114, Wizard Spider -- Software
Association: ALPHV/BlackCat, Alchimist, Bazar, Babuk, Clop, Cuba, DarkGate, LV,
Qakbot/Qbot, TargetCompany, Trickbot, Remcos RAT, XingLocker, Yanluowang, Zloader
-- Atomics T1041 Test#1 Atomics T1074.001 Test#1 Atomics T1572 Test#1 Atomics T1566.001
#Test1 Atomics T1087.002 Test #4'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
"<EventID>4688<") (TERM(IWR) OR TERM(Invoke-WebRequest) OR TERM("Invoke-RestMethod")
OR TERM(curl) OR TERM(wget)) | rex field=process (?<uri>"(?i)(https?\:|ftp(\:|\.)|(\d{1,3}\.){3}\d{1,3})[A-Za-z0-9\x5c\/\_\+\-\%\.\:]+")|
rex field=process "(?i)(?<cmd>invoke-webrequest|invoke-restmethod|wget|iwr|curl)"
| where isnotnull(cmd) | table _time, host, user cmd, signature_id, process, process_*,
parent_process_*, uri | bin span=1s | stats values(*) as * by _time, host, process '
techniques:
- execution:command and scripting interpreter:powershell
- command-and-control:ingress tool transfer
technique_id:
- T1059.001
- T1105
data_category:
- Windows event logs
references: null
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<") (TERM(IWR) OR TERM(Invoke-WebRequest) OR TERM("Invoke-RestMethod") OR TERM(curl) OR TERM(wget))
Stage 2: eval
| rex field=process (?<uri>"(?i)(https?\:|ftp(\:|\.)|(\d{1,3}\.){3}\d{1,3})[A-Za-z0-9\x5c\/\_\+\-\%\.\:]+")
Stage 3: rex
| rex field=process "(?i)(?<cmd>invoke-webrequest|invoke-restmethod|wget|iwr|curl)"
Stage 4: where
| where isnotnull(cmd)
Stage 5: table
| table _time, host, user cmd, signature_id, process, process_*, parent_process_*, uri
Stage 6: bucket
| bin span=1s
Stage 7: stats
| stats values(*) as * by _time, host, process
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.
Search terms
Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.
| Stage | Term |
|---|---|
| 1 | TERM |
| 1 | "<EventID>4688<" |
| 1 | TERM |
| 1 | IWR |
| 1 | "Invoke-WebRequest" |
| 1 | "Invoke-RestMethod" |
| 1 | TERM |
| 1 | curl |
| 1 | TERM |
| 1 | wget |