Detection rules › Sigma

Visual Studio Code Tunnel Shell Execution

Severity
medium
Author
Nasreddine Bencherchali (Nextron Systems)
Source
upstream

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.

MITRE ATT&CK coverage

TacticTechniques
Command & ControlT1071.001 Application Layer Protocol: Web Protocols

Event coverage

ProviderEvent IDTitle
Sysmon1Process creation

Stages and Predicates

Stage 1: selection_parent

ParentCommandLine|contains: .vscode-server
ParentImage|endswith: '\server\node.exe'
ParentImage|contains: '\servers\Stable-'

Stage 2: 1 of selection_child_1

or:
Image|endswith: '\powershell.exe'
Image|endswith: '\pwsh.exe'
CommandLine|contains: '\terminal\browser\media\shellIntegration.ps1'

Stage 3: 1 of selection_child_2

or:
Image|endswith: '\bash.exe'
Image|endswith: '\wsl.exe'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
CommandLinematch
  • \terminal\browser\media\shellIntegration.ps1
Imageends_with
  • \bash.exe corpus 17 (sigma 17)
  • \powershell.exe corpus 143 (sigma 143)
  • \pwsh.exe corpus 140 (sigma 140)
  • \wsl.exe corpus 8 (sigma 8)
ParentCommandLinematch
  • .vscode-server
ParentImageends_with
  • \server\node.exe
ParentImagematch
  • \servers\Stable-