Detection rules › Splunk
Invoke-WebRequest Command (Windows Event Log)
Detects when typical download commands are executed
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | |
| Command & Control |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule body
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: rex
| 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
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"4688" |
cmd | is_not_null | field:"cmd" kind:is_not_null |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "<EventID>4688<" |
| 1 | IWR |
| 1 | "Invoke-WebRequest" |
| 1 | "Invoke-RestMethod" |
| 1 | curl |
| 1 | wget |