Detection rules › Elastic

Potential Remote Desktop Protocol Tunneling

Time window
2m
Source
github.com/elastic/protections-artifacts

Identifies remote interactive logon attempt with from the localhost as a source address. This may indicate the initiation of a Remote Desktop Tunneling session.

MITRE ATT&CK coverage

TacticTechniques
Command & Control

Rule body

[rule]
description = """
Identifies remote interactive logon attempt with from the localhost as a source address. This may indicate the
initiation of a Remote Desktop Tunneling session.
"""
id = "2ad77d41-b36a-49b2-a54b-7be157e7a8c3"
license = "Elastic License v2"
name = "Potential Remote Desktop Protocol Tunneling"
os_list = ["windows"]
reference = [
    "https://blog.netspi.com/how-to-access-rdp-over-a-reverse-ssh-tunnel/",
    "https://github.com/sbousseaden/EVTX-ATTACK-SAMPLES/blob/4ceed2f4706daf601c212a8f91c113dd85349a2c/Command%20and%20Control/DE_RDP_Tunneling_4624.evtx",
]
version = "1.0.13"

query = '''
sequence with maxspan=2m
 [api where process.Ext.api.name == "connect" and process.Ext.api.summary like "connect( ipv4, tcp, 127.0.*, 3389 )" and
  not (process.code_signature.trusted == true and process.code_signature.subject_name in ("UiPath, Inc.", "Automation Anywhere, Inc.", "Google LLC", "Tanium Inc.",
      "Mozilla Corporation", "Nmap Software LLC", "N-ABLE TECHNOLOGIES LTD", "Connectwise, LLC", "Datto, LLC", "Zabbix SIA", "d.velop AG",
      "ESET, spol. s r.o.", "NoMachine S.a.r.l.", "Check Point Software Technologies Ltd.", "Amazon.com Services LLC", "Ericom Software Ltd",
      "ZABBIX, Sabiedriba ar ierobezotu atbildibu", "Intuit Inc", "TYCHON, LLC", "Siber Systems", "Axeda Corporation", "Kaseya Holdings Inc.",
      "OpsRamp, Inc.", "Paessler GmbH", "Ecosia GmbH")) and
  process.thread.Ext.call_stack_final_user_module.name != "Kernel" and process.executable != null and
  not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
  not process.thread.Ext.call_stack_final_user_module.path like
                                              ("c:\\windows\\assembly\\nativeimages_*.ni.dll",
                                               "c:\\program files\\*", "c:\\program files (x86)\\*") and
  not process.thread.Ext.call_stack_final_user_module.name in ("Undetermined", "Unknown") and
  not process.executable :
                 ("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
                  "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
                  "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
                  "C:\\Program Files (x86)\\N-able Technologies\\Windows Agent\\bin\\agent.exe",
                  "C:\\Program Files\\Tenable\\Nessus Agent\\nessus-agent-module.exe",
                  "C:\\Program Files\\Intuit\\QuickBooks Enterprise Solutions *\\CefSharp.BrowserSubprocess.exe",
                  "C:\\Program Files\\WindowsApps\\DuckDuckGo.DesktopBrowser_*\\WindowsBrowser\\WebView2\\msedgewebview2.exe",
                  "C:\\Windows\\LTSvc\\LTSVC.exe") and
  not (process.name : "powershell.exe" and
       process.parent.executable : ("C:\\Program Files\\Tychon\\TychonEngine.exe",
                                    "C:\\Program Files\\Windows Defender Advanced Threat Protection\\SenseIR.exe",
                                    "C:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\*\\SenseIR.exe"))
  ]
 [authentication where event.action == "log_on" and
  process.Ext.session_info.logon_type in ("RemoteInteractive", "Network") and cidrmatch(source.ip, "127.0.0.0/8", "::1")]
'''

min_endpoint_version = "8.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1572"
name = "Protocol Tunneling"
reference = "https://attack.mitre.org/techniques/T1572/"


[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

[internal]
min_endpoint_version = "8.15.0"

Stages and Predicates

Stage 1: api

[api where process.Ext.api.name == "connect" and process.Ext.api.summary like "connect( ipv4, tcp, 127.0.*, 3389 )" and
  not (process.code_signature.trusted == true and process.code_signature.subject_name in ("UiPath, Inc.", "Automation Anywhere, Inc.", "Google LLC", "Tanium Inc.",
      "Mozilla Corporation", "Nmap Software LLC", "N-ABLE TECHNOLOGIES LTD", "Connectwise, LLC", "Datto, LLC", "Zabbix SIA", "d.velop AG",
      "ESET, spol. s r.o.", "NoMachine S.a.r.l.", "Check Point Software Technologies Ltd.", "Amazon.com Services LLC", "Ericom Software Ltd",
      "ZABBIX, Sabiedriba ar ierobezotu atbildibu", "Intuit Inc", "TYCHON, LLC", "Siber Systems", "Axeda Corporation", "Kaseya Holdings Inc.",
      "OpsRamp, Inc.", "Paessler GmbH", "Ecosia GmbH")) and
  process.thread.Ext.call_stack_final_user_module.name != "Kernel" and process.executable != null and
  not _arraysearch(process.thread.Ext.call_stack_final_user_module.code_signature, $entry, $entry.trusted == true) and
  not process.thread.Ext.call_stack_final_user_module.path like
                                              ("c:\\windows\\assembly\\nativeimages_*.ni.dll",
                                               "c:\\program files\\*", "c:\\program files (x86)\\*") and
  not process.thread.Ext.call_stack_final_user_module.name in ("Undetermined", "Unknown") and
  not process.executable :
                 ("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
                  "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
                  "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
                  "C:\\Program Files (x86)\\N-able Technologies\\Windows Agent\\bin\\agent.exe",
                  "C:\\Program Files\\Tenable\\Nessus Agent\\nessus-agent-module.exe",
                  "C:\\Program Files\\Intuit\\QuickBooks Enterprise Solutions *\\CefSharp.BrowserSubprocess.exe",
                  "C:\\Program Files\\WindowsApps\\DuckDuckGo.DesktopBrowser_*\\WindowsBrowser\\WebView2\\msedgewebview2.exe",
                  "C:\\Windows\\LTSvc\\LTSVC.exe") and
  not (process.name : "powershell.exe" and
       process.parent.executable : ("C:\\Program Files\\Tychon\\TychonEngine.exe",
                                    "C:\\Program Files\\Windows Defender Advanced Threat Protection\\SenseIR.exe",
                                    "C:\\ProgramData\\Microsoft\\Windows Defender Advanced Threat Protection\\Platform\\*\\SenseIR.exe"))
  ]

Stage 2: authentication

[authentication where event.action == "log_on" and
  process.Ext.session_info.logon_type in ("RemoteInteractive", "Network") and cidrmatch(source.ip, "127.0.0.0/8", "::1")]

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameinAmazon.com Services LLC, Automation Anywhere, Inc., Axeda Corporation, Check Point Software Technologies Ltd., Connectwise, LLC, Datto, LLC, ESET, spol. s r.o., Ecosia GmbH, Ericom Software Ltd, Google LLC, Intuit Inc, Kaseya Holdings Inc., Mozilla Corporation, N-ABLE TECHNOLOGIES LTD, Nmap Software LLC, NoMachine S.a.r.l., OpsRamp, Inc., Paessler GmbH, Siber Systems, TYCHON, LLC, Tanium Inc., UiPath, Inc., ZABBIX, Sabiedriba ar ierobezotu atbildibu, Zabbix SIA, d.velop AGexcludes:process.code_signature.subject_name
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.nameeqpowershell.exeexcludes:process.name field:"process.name" value:"powershell.exe"
process.parent.executablewildcardC:\Program Files\Tychon\TychonEngine.exe, C:\Program Files\Windows Defender Advanced Threat Protection\SenseIR.exe, C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Platform\*\SenseIR.exeexcludes:process.parent.executable field:"process.parent.executable" value:"C:\Program Files\Tychon\TychonEngine.exe" field:"process.parent.executable" value:"C:\Program Files\Windows Defender Advanced Threat Protection\SenseIR.exe" field:"process.parent.executable" value:"C:\ProgramData\Microsoft\Windows Defender Advanced Threat Protection\Platform\*\SenseIR.exe"
process.thread.Ext.call_stack_final_user_module.code_signaturearray_any(no value, null check)excludes:process.thread.Ext.call_stack_final_user_module.code_signature
process.executablewildcardC:\Program Files (x86)\Google\Chrome\Application\chrome.exe, C:\Program Files\Google\Chrome\Application\chrome.exe, C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe, C:\Program Files (x86)\N-able Technologies\Windows Agent\bin\agent.exe, C:\Program Files\Tenable\Nessus Agent\nessus-agent-module.exe, C:\Program Files\Intuit\QuickBooks Enterprise Solutions *\CefSharp.BrowserSubprocess.exe, C:\Program Files\WindowsApps\DuckDuckGo.DesktopBrowser_*\WindowsBrowser\WebView2\msedgewebview2.exe, C:\Windows\LTSvc\LTSVC.exeexcludes:process.executable
process.thread.Ext.call_stack_final_user_module.nameinUndetermined, Unknownexcludes:process.thread.Ext.call_stack_final_user_module.name field:"process.thread.Ext.call_stack_final_user_module.name" value:"Undetermined" field:"process.thread.Ext.call_stack_final_user_module.name" value:"Unknown"
process.thread.Ext.call_stack_final_user_module.pathwildcardc:\windows\assembly\nativeimages_*.ni.dll, c:\program files\*, c:\program files (x86)\*excludes:process.thread.Ext.call_stack_final_user_module.path field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\windows\assembly\nativeimages_*.ni.dll" field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files\*" field:"process.thread.Ext.call_stack_final_user_module.path" value:"c:\program files (x86)\*"

Indicators

These rows show field, operator, and value matches.