Windows DNS Queries to Visual Studio Code Tunnel Domains

Alerts on Windows DNS queries to .tunnels.api.visualstudio.com, matching Visual Studio Code tunnel endpoints.

FreeReviewedSigma · Medium · v2
Product
windows
Category
dns_query
Author
citron_ninja (SigmaHQ), DRL 1.1
Published
2023-10-25
Updated
2026-07-31
title: Windows DNS Queries to Visual Studio Code Tunnel Domains
id: 00de4d85-22e1-4692-bc79-d259fcf97bed
related:
  - id: 9501f8e6-8e3d-48fc-a8a6-1089dd5d7ef4
    type: similar
  - id: 4b657234-038e-4ad5-997c-4be42340bce4
    type: similar
  - id: 1cb0c6ce-3d00-44fc-ab9c-6d6d577bf20b
    type: similar
  - id: b3e6418f-7c7a-4fad-993a-93b65027a9f1
    type: derived
status: test
description: This rule flags DNS query events where the queried name ends with .tunnels.api.visualstudio.com on Windows systems. Such domains can be used by attackers to reach externally hosted endpoints, potentially enabling command-and-control or persistence. The detection relies on DNS query telemetry that includes the queried domain name (QueryName).
references:
  - https://ipfyx.fr/post/visual-studio-code-tunnel/
  - https://badoption.eu/blog/2023/01/31/code_c2.html
  - https://cydefops.com/vscode-data-exfiltration
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/dns_query/dns_query_win_vscode_tunnel_communication.yml
author: citron_ninja, Huntrule Team
date: 2023-10-25
modified: 2023-11-20
tags:
  - attack.command-and-control
  - attack.t1071.001
logsource:
  product: windows
  category: dns_query
detection:
  selection:
    QueryName|endswith: .tunnels.api.visualstudio.com
  condition: selection
falsepositives:
  - Legitimate use of Visual Studio Code tunnel will also trigger this.
level: medium
license: DRL-1.1