Sigma rule: Visual Studio Code Tunnel Shell Execution
A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-e53e922a3579, updated 2023-10-25T00:00:00.000Z.
Rule
- Title
- Visual Studio Code Tunnel Shell Execution
- Status
- test
- Level
- medium
- Author
- Nasreddine Bencherchali (Nextron Systems)
- Date
- 2023-10-25
- File
- rules/windows/process_creation/proc_creation_win_vscode_tunnel_remote_shell_.yml
- Commit
- ccbb0369507f796db0b0ae6854c8a2be471b9d84
Detects the execution of a shell (powershell, bash, wsl...) via Visual Studio Code tunnel. Attackers can abuse this functionality to establish a C2 channel and execute arbitrary commands on the system.
Log source
- product
- windows
- category
- process_creation
Detection
selection_parent:
ParentImage|contains: '\servers\Stable-'
ParentImage|endswith: '\server\node.exe'
ParentCommandLine|contains: '.vscode-server' # Technically one can host its own local server instead of using the VsCode one. And that would probably change the name (requires further research)
# Note: Child processes (ie: shells) can be whatever technically (with some efforts)
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_*False positives (as the rule lists them)
- Legitimate use of Visual Studio Code tunnel and running code from there
Tags
- attack.command-and-control
- attack.t1071.001
MITRE ATT&CK ids this rule names
References
- 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
Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/process_creation/proc_creation_win_vscode_tunnel_remote_shell_.yml
Sources and licences
SigmaHQ
"Visual Studio Code Tunnel Shell Execution" by Nasreddine Bencherchali (Nextron Systems) (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/process_creation/proc_creation_win_vscode_tunnel_remote_shell_.yml.
Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License
Cite this page
Dragons Eye Ransomware Tracker, "Sigma rule: Visual Studio Code Tunnel Shell Execution",
entity page, dataset version ref-e53e922a3579, updated 2023-10-25T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/f4a623c2-4ef5-4c33-b811-0642f702c9f1 (accessed 2026-11-03).
Underlying source: SigmaHQ rule f4a623c2-4ef5-4c33-b811-0642f702c9f1, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.
Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.