Detection rules › Sigma

Potentially Suspicious Child Process Of VsCode

Severity
medium
Author
Nasreddine Bencherchali (Nextron Systems)
Source
upstream

Detects uncommon or suspicious child processes spawning from a VsCode "code.exe" process. This could indicate an attempt of persistence via VsCode tasks or terminal profiles.

MITRE ATT&CK coverage

TacticTechniques
Defense EvasionT1202 Indirect Command Execution, T1218 System Binary Proxy Execution

Event coverage

ProviderEvent IDTitle
Sysmon1Process creation
Security-Auditing4688A new process has been created.

Stages and Predicates

Stage 1: selection_parent

ParentImage|endswith: '\code.exe'

Stage 2: 1 of selection_children_images

or:
Image|endswith: '\calc.exe'
Image|endswith: '\cscript.exe'
Image|endswith: '\regsvr32.exe'
Image|endswith: '\rundll32.exe'
Image|endswith: '\wscript.exe'

Stage 3: 1 of selection_children_cli

or:
CommandLine|contains: DownloadString
CommandLine|contains: ICM
CommandLine|contains: IEX
CommandLine|contains: Invoke-Command
CommandLine|contains: Invoke-Expressions
CommandLine|contains: cscript
CommandLine|contains: regsvr32
CommandLine|contains: rundll32
CommandLine|contains: wscript
or:
Image|endswith: '\cmd.exe'
Image|endswith: '\powershell.exe'
Image|endswith: '\pwsh.exe'

Stage 4: 1 of selection_children_paths

or:
Image|contains: ':\Temp\'
Image|contains: ':\Users\Public\'
Image|contains: ':\Windows\Temp\'

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
  • DownloadString corpus 5 (sigma 5)
  • ICM
  • IEX
  • Invoke-Command corpus 2 (sigma 2)
  • Invoke-Expressions
  • cscript corpus 12 (sigma 12)
  • regsvr32 corpus 11 (sigma 11)
  • rundll32 corpus 19 (sigma 19)
  • wscript corpus 12 (sigma 12)
Imageends_with
  • \calc.exe corpus 13 (sigma 13)
  • \cmd.exe corpus 92 (sigma 92)
  • \cscript.exe corpus 64 (sigma 64)
  • \powershell.exe corpus 143 (sigma 143)
  • \pwsh.exe corpus 140 (sigma 140)
  • \regsvr32.exe corpus 57 (sigma 57)
  • \rundll32.exe corpus 76 (sigma 76)
  • \wscript.exe corpus 64 (sigma 64)
Imagematch
  • :\Temp\ corpus 12 (sigma 12)
  • :\Users\Public\ corpus 14 (sigma 14)
  • :\Windows\Temp\ corpus 9 (sigma 9)
ParentImageends_with
  • \code.exe corpus 2 (sigma 2)