Suspicious Execution of Visual Studio Code Tunnel (via process_creation)

This rule detects Visual Studio Code tunnel execution. Adversaries can misuse this functionality to establish a C2 channel

SigmamediumWindowsv1
sigma
title: Suspicious Execution of Visual Studio Code Tunnel (via process_creation)
id: 291f523e-7b90-5c83-afd4-d88224db285a
status: stable
description: This rule detects Visual Studio Code tunnel execution. Adversaries can misuse this functionality to establish a C2 channel
references:
    - https://attack.mitre.org/techniques/T1219/
    - https://attack.mitre.org/techniques/T1071/001/
    - https://ipfyx.fr/post/visual-studio-code-tunnel/
    - https://badoption.eu/blog/2023/01/31/code_c2.html
    - https://code.visualstudio.com/docs/remote/tunnels
author: Huntrule Team
date: 2026-02-20
tags:
    - attack.command-and-control
    - attack.t1071.001
    - attack.t1219
logsource:
    category: process_creation
    product: windows
detection:
    selection_only_tunnel:
        OriginalFileName:
        CommandLine|endswith: '.exe tunnel'
    selection_tunnel_args:
        CommandLine|contains|all:
            - '.exe tunnel'
            - '--accept-server-license-terms'
    selection_parent_tunnel:
        ParentCommandLine|endswith: ' tunnel'
        Image|endswith: '\cmd.exe'
        CommandLine|contains|all:
            - '/d /c '
            - '\servers\Stable-'
            - 'code-server.cmd'
    condition: 1 of selection_*
falsepositives:
    - Unknown
level: medium

Known false positives

  • Unknown

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.