Query Details
// Detecting Twill Typhoon VSCode Exploit // The Mustang Panda group, a Chinese hacking collective, has leveraged Visual Studio Code’s reverse shell feature to infiltrate Southeast Asian government systems. This method enables unauthorized access, malware deployment, and data exfiltration, marking a notable advancement in cyber espionage techniques. The following KQL detects the VS Code tunnel exploit within an MDE environment. let deviceVScodeTunnel = DeviceEvents | where InitiatingProcessCommandLine contains "code.exe" and InitiatingProcessCommandLine contains "tunnel" | distinct DeviceName; DeviceNetworkEvents | where RemoteUrl contains "tunnels.api.visualstudio.com" or RemoteUrl contains "devtunnels.ms" | where DeviceName has_any (deviceVScodeTunnel) // Based on the behavior described in your query, the associated MITRE ATT&CK techniques are: // Protocol Tunneling (T1572): This technique involves encapsulating one protocol within another to avoid detection and enable access to otherwise unreachable systems1. Your query is looking for network events that suggest tunneling, which aligns with this technique. // Command and Control (TA0011): This tactic involves adversaries trying to communicate with compromised systems to control them. The use of tunneling and specific URLs in your query suggests an attempt to establish a command and control channel.
This KQL query is designed to detect a specific exploit used by the Mustang Panda hacking group, which targets Visual Studio Code's reverse shell feature to gain unauthorized access to systems, deploy malware, and steal data. Here's a simplified breakdown of what the query does:
Identify Devices Running VS Code Tunnels:
Monitor Network Events for Suspicious URLs:
MITRE ATT&CK Techniques:
In summary, this query helps detect if the Visual Studio Code tunnel feature is being exploited on your network, which could indicate a sophisticated cyber espionage attack.

Steven Lim
Released: September 16, 2024
Tables
Keywords
Operators