Suspicious Execution of Visual Studio Code Tunnel Shell (via process_creation)

This rule detects the execution of a shell (powershell, bash, wsl...) via Visual Studio Code tunnel. Adversaries can misuse this functionality to establish a C2 channel and execute arbitrary commands on the system.

SigmamediumWindowsv1
sigma
title: Suspicious Execution of Visual Studio Code Tunnel Shell (via process_creation)
id: d5d91326-75ae-5aa1-ac83-ac7c8e9668c1
status: stable
description: This rule detects the execution of a shell (powershell, bash, wsl...) via Visual Studio Code tunnel. Adversaries can misuse this functionality to establish a C2 channel and execute arbitrary commands on the system.
references:
    - 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-05-16
tags:
    - attack.command-and-control
    - attack.t1071.001
logsource:
    category: process_creation
    product: windows
detection:
    selection_parent:
        ParentImage|contains: '\servers\Stable-'
        ParentImage|endswith: '\server\node.exe'
        ParentCommandLine|contains: '.vscode-server'
    selection_child_1:
        Image|endswith:
            - '\powershell.exe'
            - '\pwsh.exe'
        CommandLine|contains: '\terminal\browser\media\shellIntegration.ps1'
    selection_child_2:
        Image|endswith:
            - '\wsl.exe'
            - '\bash.exe'
    condition: selection_parent and 1 of selection_child_*
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.