Detect IDE Extensions in Google Chronicle
Adversaries may abuse an integrated development environment (IDE) extension to establish persistent access to victim systems. IDEs such as Visual Studio Code, IntelliJ IDEA, and Eclipse support extensions — software components that add features like code linting, auto-completion, task automation, or integration with external tools. A malicious extension can be installed through an extension marketplace or side-loaded directly into the IDE via a .vsix package. Once installed, the extension runs every time the IDE is launched, enabling persistent arbitrary code execution, backdoor establishment, cryptocurrency mining, or data exfiltration. Adversaries may also leverage benign extensions: for example, Mustang Panda has abused the VSCode built-in tunnel feature (code.exe tunnel) to establish persistent reverse shells routed through Microsoft infrastructure, bypassing firewall controls.
MITRE ATT&CK
- Tactic
- Persistence
- Technique
- T1176 Software Extensions
- Sub-technique
- T1176.002 IDE Extensions
- Canonical reference
- https://attack.mitre.org/techniques/T1176/002/
YARA-L Detection Query
rule ide_extension_abuse_t1176_002 {
meta:
author = "df00tech Detection Engineering"
description = "Detects malicious IDE extension abuse including VSCode tunnel creation, VSIX side-loading, suspicious IDE child processes, and IDE external non-HTTPS connections. Covers T1176.002."
mitre_attack_tactic = "Persistence"
mitre_attack_technique = "T1176.002"
severity = "HIGH"
priority = "HIGH"
events:
(
// Branch 1: VSCode tunnel reverse shell (Mustang Panda)
(
$e.metadata.event_type = "PROCESS_LAUNCH"
AND re.regex($e.principal.process.file.full_path, `(?i)(code\.exe|code-insiders\.exe|code-server)`)
AND re.regex($e.target.process.command_line, `(?i)\btunnel\b`)
)
OR
// Branch 2: VSIX extension side-load
(
$e.metadata.event_type = "PROCESS_LAUNCH"
AND re.regex($e.principal.process.file.full_path, `(?i)code.*\.exe`)
AND re.regex($e.target.process.command_line, `(?i)--install-extension.*\.vsix`)
)
OR
// Branch 3: IDE spawning suspicious child processes
(
$e.metadata.event_type = "PROCESS_LAUNCH"
AND re.regex($e.principal.process.file.full_path, `(?i)(code\.exe|code-insiders\.exe|idea\.exe|idea64\.exe|eclipse\.exe|webstorm\.exe|pycharm\.exe|pycharm64\.exe|phpstorm\.exe|rider\.exe|goland\.exe|clion\.exe|datagrip\.exe)`)
AND re.regex($e.target.process.file.full_path, `(?i)(cmd\.exe|powershell\.exe|pwsh\.exe|mshta\.exe|wscript\.exe|cscript\.exe|rundll32\.exe|regsvr32\.exe|certutil\.exe|bitsadmin\.exe|schtasks\.exe|whoami\.exe|nltest\.exe|curl\.exe|wget\.exe)`)
AND NOT re.regex($e.target.process.command_line, `(?i)(git |npm |yarn |pip |cargo |dotnet |gradle|mvn |make |cmake|eslint|prettier|tsc )`)
)
OR
// Branch 4: IDE making external non-HTTPS network connection
(
$e.metadata.event_type = "NETWORK_CONNECTION"
AND re.regex($e.principal.process.file.full_path, `(?i)(code\.exe|code-insiders\.exe|idea\.exe|idea64\.exe|eclipse\.exe|webstorm\.exe|pycharm\.exe|pycharm64\.exe)`)
AND NOT re.regex($e.target.ip, `^(10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.|127\.)`)
AND $e.target.port != 80
AND $e.target.port != 443
AND $e.target.ip != ""
)
)
condition:
$e
} Chronicle YARA-L 2.0 rule detecting IDE extension abuse via four behavioral branches using UDM PROCESS_LAUNCH and NETWORK_CONNECTION events: VSCode tunnel creation (Mustang Panda reverse shell TTP), VSIX side-loading, IDE spawning high-risk child processes outside build patterns, and IDE processes making external non-HTTPS network connections.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate VSCode Remote Tunnels feature usage for developer remote work will match Branch 1 — create reference lists of approved developer devices and add a NOT $e.principal.hostname in %approved_developer_hosts condition
- Internal extension distribution workflows where IT pushes custom .vsix packages to developer workstations will trigger Branch 2 — whitelist known software distribution accounts and hosts in a Chronicle reference list
- IDEs running integrated terminal commands (git fetch, npm ci) where the intermediate shell is cmd.exe or PowerShell prior to the build command appearing — tune the negative regex to cover additional observed build invocation patterns
Other platforms for T1176.002
Testing Methodology
Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1VSCode Tunnel Creation (Mustang Panda TTP)
Expected signal: Sysmon Event ID 1: Process Create with Image=code.exe, CommandLine containing 'tunnel --accept-server-license-terms --name df00tech-test'. Sysmon Event ID 3: Network connection from code.exe to Microsoft tunnel infrastructure (*.tunnels.api.visualstudio.com or *.vscode.dev) on port 443. File creation events in %USERPROFILE%\.vscode\cli\servers\
- Test 2VSCode Extension Side-Load from Local VSIX
Expected signal: Sysmon Event ID 1: Process Create with Image=code.exe, CommandLine containing '--install-extension' and '.vsix'. Sysmon Event ID 11: File creation in %USERPROFILE%\.vscode\extensions\df00tech.df00tech-test-* directory. Sysmon Event ID 1 for powershell.exe (Compress-Archive) spawned to create the VSIX.
- Test 3IDE Extension Spawning PowerShell Command
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing '-NoProfile -WindowStyle Hidden', ParentImage=powershell.exe. If executed from within a VSCode terminal or task, ParentImage will be code.exe or extensionHost process. Security Event ID 4688 (if command line auditing enabled).
- Test 4Enumerate Installed VSCode Extensions for Suspicious Entries
Expected signal: Sysmon Event ID 1: Process Create with Image=code.exe, CommandLine='--list-extensions --show-versions'. Output logged to console listing all installed extensions with version numbers. Sysmon Event ID 1 for any spawned processes (code.exe may spawn helpers).
- Test 5VSCode Extension Directory Modification via External Process
Expected signal: Sysmon Event ID 11: File Create with TargetFilename in %USERPROFILE%\.vscode\extensions\ and Image=cmd.exe (not code.exe or node.exe). Sysmon Event ID 1: Process Create for cmd.exe with CommandLine showing the write operation.
References (8)
- https://attack.mitre.org/techniques/T1176/002/
- https://www.mnemonic.io/resources/blog/misuse-of-visual-studio-code-for-traffic-tunnelling/
- https://thehackernews.com/2023/01/hackers-distributing-malicious-visual.html
- https://blog.checkpoint.com/securing-the-cloud/malicious-vscode-extensions-with-more-than-45k-downloads-steal-pii-and-enable-backdoors/
- https://blog.extensiontotal.com/mining-in-plain-sight-the-vs-code-extension-cryptojacking-campaign-19ca12904b59
- https://unit42.paloaltonetworks.com/chinese-threat-actors-using-vscode/
- https://code.visualstudio.com/docs/remote/tunnels
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1176/T1176.md
Unlock Pro Content
Get the full detection package for T1176.002 including response playbook, investigation guide, and atomic red team tests.