Detection rules › Splunk
New AutoRun Registry Key (PowerShell)
Detects when common autorun scripts in the Windows registry are modified
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Persistence | |
| Privilege Escalation |
Telemetry coverage
Rule body
id: '1042.1065'
title: New AutoRun Registry Key
description: 'Detects when common autorun scripts in the Windows registry are modified.
-- Threat Actor Association: APT27/Emissary Panda, APT28, APT29/Nobelium/Cozy Bear,
APT33, APT37, APT40, APT43, Blind Eagle/APT-C-36, Carbanak, FIN6, FIN7, FIN13, Lazarus,
MuddyWater, Mustang Panda, NewsPenguin, RedEyes, RomCom, SaintBear (aka UAC-0056,
UNC2589, TA471), Sandworm Team, TA2541, TA505, UAC-0056, UNC4990 - Software Association:
ALPHV/BlackCat, Bazarloader, Blackbyte, Havex, LockBit, MirrorBlast, NanoCore, Phosphorus/Magic
Hound/APT35, Prometheus / Spook, Sodinokibi/REvil, Ransom Cartel, Remcos RAT, Trigona,
Vice Society, Zloader -- Atomics T1547.001 Test#3 Atomics T1547.001 Test#4'
logic_format: Splunk
logic: ' `get_endpoint_data` `get_endpoint_data_powershell` AND ( EventCode=4103 OR
EventCode=4104) AND ("Windows\\CurrentVersion\\RunOnce" OR "Windows\\CurrentVersion\\Run"
OR "Windows\\CurrentVersion\\RunServices" OR "Windows\\CurrentVersion\\RunServicesOnce"
OR "Windows\\CurrentVersion\\RunOnceEx") | table _time, host, user dvc, dvc_nt_host,
event_id, eventtype, host, index, parameters, process, process_id, process_name,
process_path, shell, signature_id, source, sourcetype, src_user, tag, user, user_id
| bin span=60s | stats values(*) as * by _time, host | rex field=process max_match=0
(?<registry_path>"[^\"]+Windows\\\CurrentVersion\\\Run[^\"]{0,}") | eventstats values(registry_path)
as registry_path by _time dvc '
techniques:
- persistence:boot or logon autostart execution:registry run keys / startup folder
- privilege-escalation:boot or logon autostart execution:registry run keys / startup
folder
technique_id:
- T1547.001
data_category:
- Windows Registry
- PowerShell logs
references: null
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_powershell` AND ( EventCode=4103 OR EventCode=4104) AND ("Windows\\CurrentVersion\\RunOnce" OR "Windows\\CurrentVersion\\Run" OR "Windows\\CurrentVersion\\RunServices" OR "Windows\\CurrentVersion\\RunServicesOnce" OR "Windows\\CurrentVersion\\RunOnceEx")
Stage 2: table
| table _time, host, user dvc, dvc_nt_host, event_id, eventtype, host, index, parameters, process, process_id, process_name, process_path, shell, signature_id, source, sourcetype, src_user, tag, user, user_id
Stage 3: bucket
| bin span=60s
Stage 4: stats
| stats values(*) as * by _time, host
Stage 5: rex
| rex field=process max_match=0 (?<registry_path>"[^\"]+Windows\\\CurrentVersion\\\Run[^\"]{0,}")
Stage 6: eventstats
| eventstats values(registry_path) as registry_path by _time dvc
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "Windows\\CurrentVersion\\RunOnce" |
| 1 | "Windows\\CurrentVersion\\Run" |
| 1 | "Windows\\CurrentVersion\\RunServices" |
| 1 | "Windows\\CurrentVersion\\RunServicesOnce" |
| 1 | "Windows\\CurrentVersion\\RunOnceEx" |