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 & ControlT1572 Protocol Tunneling

References

Event coverage

Rule body yaml

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

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
EventCodeeq
  • 4779 corpus 3 (splunk 3)

Search terms

Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.

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