Detection rules › Splunk
Visual Studio Code Tunnel Execution (PowerShell)
Adversaries may communicate using application layer protocols associated with web traffic to avoid detection/network filtering by blending in with existing traffic. Commands to the remote system, and often the results of those commands, will be embedded within the protocol traffic between the client and server. This use case detects the execution of Visual Studio Code tunnel in attempt to establish a C2 channel, accounting for instances where the binary has been renamed.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Command & Control |
References
Telemetry coverage
Rule body
id: '40420.73845'
title: Visual Studio Code Tunnel Execution
description: Adversaries may communicate using application layer protocols associated
with web traffic to avoid detection/network filtering by blending in with existing
traffic. Commands to the remote system, and often the results of those commands,
will be embedded within the protocol traffic between the client and server. This
use case detects the execution of Visual Studio Code tunnel in attempt to establish
a C2 channel, accounting for instances where the binary has been renamed.
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_powershell` ((TERM(EventCode=4103)
OR "<EventID>4103<") OR (TERM(EventCode=4104) OR "<EventID>4104<")) "tunnel" OR
("tunnel" ("--name " "--accept-server-license-terms") OR "--cli-data-dir") | where
match(process, "(?i)\.exe(\x22)?\s+tunnel\s?") or ((match(process, "\.exe(\x22)?\s+tunnel\s?$")
and like(process, "%--name %") and like(process, "%--accept-server-license-terms%"))
or like(process, "%--cli-data-dir%") | table _time, host, user, process, process_*
| bin span=1s | stats values(*) as * by _time, host '
techniques:
- command-and-control:application layer protocol:web protocols
technique_id:
- T1071.001
data_category:
- PowerShell logs
references:
- https://detection.fyi/sigmahq/sigma/windows/process_creation/proc_creation_win_vscode_tunnel_execution/
- https://attack.mitre.org/techniques/T1071/001/
- https://www.sentinelone.com/labs/operation-digital-eye-chinese-apt-compromises-critical-digital-infrastructure-via-visual-studio-code-tunnels/