Visual Studio Code Tunnel Execution

Detects Visual Studio Code tunnel execution. Attackers can abuse this functionality to establish a C2 channel

Sigma rule (View on GitHub)

 1title: Visual Studio Code Tunnel Execution
 2id: 90d6bd71-dffb-4989-8d86-a827fedd6624
 3status: test
 4description: Detects Visual Studio Code tunnel execution. Attackers can abuse this functionality to establish a C2 channel
 5references:
 6    - https://ipfyx.fr/post/visual-studio-code-tunnel/
 7    - https://badoption.eu/blog/2023/01/31/code_c2.html
 8    - https://code.visualstudio.com/docs/remote/tunnels
 9author: Nasreddine Bencherchali (Nextron Systems), citron_ninja
10date: 2023-10-25
11modified: 2025-10-29
12tags:
13    - attack.command-and-control
14    - attack.t1071.001
15    - attack.t1219
16logsource:
17    category: process_creation
18    product: windows
19detection:
20    selection_only_tunnel:
21        OriginalFileName: null
22        CommandLine|endswith: '.exe tunnel'
23    selection_tunnel_args:
24        CommandLine|contains|all:
25            - '.exe tunnel'
26            - '--accept-server-license-terms'
27    selection_parent_tunnel:
28        ParentCommandLine|endswith: ' tunnel'
29        Image|endswith: '\cmd.exe'
30        CommandLine|contains|all:
31            - '/d /c '
32            - '\servers\Stable-'
33            - 'code-server.cmd'
34    condition: 1 of selection_*
35falsepositives:
36    - Legitimate use of Visual Studio Code tunnel
37level: medium

References

Related rules

to-top