Visual Studio Code Tunnel Shell Execution

Last updated on:

About the rule

Rule Type

Standard

Rule Description

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.

Severity

Trouble

Rule Requirement

Criteria

Action1: actionname = "Process started" AND (PARENTPROCESSNAME contains "\servers\Stable-" AND PARENTPROCESSNAME endswith "\server\node.exe" AND PARENTPROCESSCOMMANDLINE contains ".vscode-server") AND ((PROCESSNAME endswith "\powershell.exe,\pwsh.exe" AND COMMANDLINE contains "\terminal\browser\media\shellIntegration.ps1") OR PROCESSNAME endswith "\wsl.exe,\bash.exe") select Action1.HOSTNAME,Action1.MESSAGE,Action1.COMMANDLINE,Action1.FILE_NAME,Action1.PROCESSNAME,Action1.USERNAME,Action1.PARENTPROCESSNAME

Detection

Execution Mode

realtime

Log Sources

Windows

Author

Nasreddine Bencherchali (Nextron Systems)