Detection rules › Splunk

Potential ngrok Tunnel - Windows (Windows Event Log)

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

ngrok is a reverse proxy utility with the ability to establish tunnels on targets using reverse SSH, even if the target does not have ngrok installed. Attackers have been observed abusing ngrok to establish persistence and perform lateral movement on compromised targets by exposing RDP services. This use case detects artifacts specific to RDP sessions established using ngrok

MITRE ATT&CK coverage

TacticTechniques
Command & Control

References

Telemetry coverage

Rule body

id: '20681.36836'
title: Potential ngrok Tunnel - Windows
description: 'ngrok is a reverse proxy utility with the ability to establish tunnels
  on targets using reverse SSH, even if the target does not have ngrok installed.
  Attackers have been observed abusing ngrok to establish persistence and perform
  lateral movement on compromised targets by exposing RDP services. This use case
  detects artifacts specific to RDP sessions established using ngrok. -- Threat Actor
  Association: Scattered Spider (aka. Muddled Libra, Scatter Swine, Starfraud, UNC3944)'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4779) OR
  "<EventID>4779<") "%16777216" | table _time, host, user, process_*, src_ip, src_port,
  dest_ip, dest_port | bin span=1s | stats values(*) as * by _time, host '
techniques:
- command-and-control:protocol tunneling
technique_id: 
- T1572
data_category:
- Windows event logs
references:
- https://www.logpoint.com/en/blog/a-deep-look-at-the-darkside-ransomware-operators-and-their-affiliates/
- https://ngrok.com/docs/secure-tunnels/tunnels/ssh-reverse-tunnel-agent/

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4779) OR "<EventID>4779<") "%16777216"

Stage 2: table

| table _time, host, user, process_*, src_ip, src_port, dest_ip, dest_port

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

Search terms

These SPL tokens match against raw event text.

StageTerm
1"<EventID>4779<"
1"%16777216"