← Back to SOC feed Coverage →

Renamed VsCode Code Tunnel Execution - File Indicator

sigma HIGH SigmaHQ
imFileEvent
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at SigmaHQ →
Retrieved: 2026-03-25T03:05:59Z · Confidence: medium

Hunt Hypothesis

Adversaries may rename a legitimate VSCode code tunnel file to execute malicious code, leveraging the file’s trusted association to evade detection. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential code execution attacks that exploit file name deception.

Detection Rule

Sigma (Original)

title: Renamed VsCode Code Tunnel Execution - File Indicator
id: d102b8f5-61dc-4e68-bd83-9a3187c67377
status: test
description: |
    Detects the creation of a file with the name "code_tunnel.json" which indicate execution and usage of VsCode tunneling utility by an "Image" or "Process" other than VsCode.
references:
    - https://ipfyx.fr/post/visual-studio-code-tunnel/
    - https://badoption.eu/blog/2023/01/31/code_c2.html
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-10-25
tags:
    - attack.command-and-control
logsource:
    category: file_event
    product: windows
detection:
    selection:
        TargetFilename|endswith: '\code_tunnel.json'
    filter_main_legit_name:
        # Note: There might be other legitimate names for VsCode. Please add them if found
        Image|endswith:
            - '\code-tunnel.exe'
            - '\code.exe'
    condition: selection and not 1 of filter_main_*
falsepositives:
    - Unknown
level: high

KQL (Azure Sentinel)

imFileEvent
| where TargetFileName endswith "\\code_tunnel.json" and (not((TargetFilePath endswith "\\code-tunnel.exe" or TargetFilePath endswith "\\code.exe")))

False Positive Guidance

MITRE ATT&CK Context

Original source: https://github.com/SigmaHQ/sigma/blob/master/rules/windows/file/file_event/file_event_win_vscode_tunnel_renamed_execution.yml