Detection rules › Splunk

Event Logs Queried for RDP Sessions (PowerShell)

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

Threat actors may query Windows Terminal Services logs for RDP session information. - Example 1: During post-compromise reconnaissance activities, Lazarus was observed using wevtutil to query Windows Terminal Services logs for RDP sessions (Event Code 25) in order to gather session reconnection information. - Example 2: Threat actor tracked as Cluster Charlie (STAC1305) searched Windows Event Logs for Windows Remote Connection Manager event ID 1149 -- This use case detects commands querying Terminal Services logs for event 25 for user disconnection or event 1149 for records of successful Remote Desktop Services (RDP) logon attempt. While threat actors will most likely be using wevtutil to perform the queries, it has been omitted from the logic to account for instances where it has been renamed

MITRE ATT&CK coverage

TacticTechniques
Discovery

References

Telemetry coverage

Rule body

id: '25100.46549'
title: Event Logs Queried for RDP Sessions
description: 'Threat actors may query Windows Terminal Services logs for RDP session
  information. - Example 1: During post-compromise reconnaissance activities, Lazarus
  was observed using wevtutil to query Windows Terminal Services logs for RDP sessions
  (Event Code 25) in order to gather session reconnection information. - Example 2:
  Threat actor tracked as Cluster Charlie (STAC1305) searched Windows Event Logs for
  Windows Remote Connection Manager event ID 1149 -- This use case detects commands
  querying Terminal Services logs for event 25 for user disconnection or event 1149
  for records of successful Remote Desktop Services (RDP) logon attempt. While threat
  actors will most likely be using wevtutil to perform the queries, it has been omitted
  from the logic to account for instances where it has been renamed. -- Threat Actor
  Association: Cluster Charlie (STAC1305), Lazarus'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4104) OR
  "<EventID>4104<") ("qe" OR "Query-Event") "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational"
  ("EventID=25" OR "EventID=1149") | table _time, host, user, process, process_*,
  user, parent_process_name, parent_process_path | bin span=1s | stats values(*) as
  * by _time, host '
techniques:
- discovery:system information discovery
technique_id: 
- T1082
data_category:
- PowerShell logs
references:
- https://blog.talosintelligence.com/lazarus_new_rats_dlang_and_telegram/
- https://news.sophos.com/en-us/2024/09/10/crimson-palace-new-tools-tactics-targets/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4104) OR "<EventID>4104<") ("qe" OR "Query-Event") "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational" ("EventID=25" OR "EventID=1149")

Stage 2: table

| table _time, host, user, process, process_*, user, parent_process_name, parent_process_path

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
  • 4104 corpus 269 (splunk 269)
field:"EventID" kind:eq value:"4104"

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4104<"
1"qe"
1"Query-Event"
1"Microsoft-Windows-TerminalServices-LocalSessionManager/Operational"
1"EventID=25"
1"EventID=1149"