Detection rules › Splunk

Potential Target Discovery via PowerShell Event Log Queries (PowerShell)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Threat actors may use custom scripts during discovery activities to identify targets on a network. This use case detects PowerShell scripts querying System, Security, and Windows Terminal Services event logs as observed with RagnarLocker

MITRE ATT&CK coverage

TacticTechniques
Discovery

References

Telemetry coverage

Rule body

id: '19995.35576'
title: Potential Target Discovery via PowerShell Event Log Queries
description: 'Threat actors may use custom scripts during discovery activities to
  identify targets on a network. This use case detects PowerShell scripts querying
  System, Security, and Windows Terminal Services event logs as observed with RagnarLocker.
  -- Threat Actor Association: APT28 (aka.Fancy Bear, Fighting Ursa, Forest Blizzard,
  Pawn Storm, TA422, STRONTIUM) - Software Association: RagnarLocker'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4103) OR
  "<EventID>4103<" TERM(EventCode=4104) OR "<EventID>4104<") (TERM(Get-EventLog) OR
  TERM(Get-WinEvent)) ("7001" OR "7002" OR "21" OR "25" OR "4624") | table _time,
  host, user process, process_*, signature_id | bin span=1s | stats values(*) as *
  by _time, host '
techniques:
- discovery:system information discovery
technique_id: 
- T1082
data_category:
- PowerShell logs
references:
- https://blog.sygnia.co/threat-actor-spotlight-ragnarlocker-ransomware?_ga=2.100185502.1673284611.1684933734-1923873697.1682517767
- https://thedfirreport.com/2023/10/30/netsupport-intrusion-results-in-domain-compromise/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4103) OR "<EventID>4103<" TERM(EventCode=4104) OR "<EventID>4104<") (TERM(Get-EventLog) OR TERM(Get-WinEvent)) ("7001" OR "7002" OR "21" OR "25" OR "4624")

Stage 2: table

| table _time, host, user process, process_*, signature_id

Stage 3: bucket

| bin span=1s

Stage 4: stats

| stats values(*) as * by _time, host

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
EventCodeeq
  • 4103 corpus 105 (splunk 105)
  • 4104 corpus 269 (splunk 269)
field:"EventID" kind:eq

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4103<"
1"<EventID>4104<"
1"Get-EventLog"
1"Get-WinEvent"
1"7001"
1"7002"
1"21"
1"25"
1"4624"