Detection rules › Sigma
Suspicious WindowsTerminal Child Processes
Detects suspicious children spawned via the Windows Terminal application which could be a sign of persistence via WindowsTerminal (see references section)
Known false positives
- Other legitimate "Windows Terminal" profiles
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | No specific technique |
| Persistence | No specific technique |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 1: Process creation |
| Security-Auditing | Event ID 4688: A new process has been created. |
Rule body
title: Suspicious WindowsTerminal Child Processes
id: 8de89e52-f6e1-4b5b-afd1-41ecfa300d48
status: test
description: Detects suspicious children spawned via the Windows Terminal application which could be a sign of persistence via WindowsTerminal (see references section)
references:
- https://persistence-info.github.io/Data/windowsterminalprofile.html
- https://twitter.com/nas_bench/status/1550836225652686848
author: Nasreddine Bencherchali (Nextron Systems)
date: 2022-07-25
modified: 2023-02-14
tags:
- attack.execution
- attack.persistence
logsource:
category: process_creation
product: windows
detection:
selection_parent:
ParentImage|endswith:
- '\WindowsTerminal.exe'
- '\wt.exe'
selection_susp:
- Image|endswith:
# Add more LOLBINS
- '\rundll32.exe'
- '\regsvr32.exe'
- '\certutil.exe'
- '\cscript.exe'
- '\wscript.exe'
- '\csc.exe'
- Image|contains:
# Add more suspicious paths
- 'C:\Users\Public\'
- '\Downloads\'
- '\Desktop\'
- '\AppData\Local\Temp\'
- '\Windows\TEMP\'
- CommandLine|contains:
# Add more suspicious commandline
- ' iex '
- ' icm'
- 'Invoke-'
- 'Import-Module '
- 'ipmo '
- 'DownloadString('
- ' /c '
- ' /k '
- ' /r '
filter_builtin_visual_studio_shell:
CommandLine|contains|all:
- 'Import-Module'
- 'Microsoft.VisualStudio.DevShell.dll'
- 'Enter-VsDevShell'
filter_open_settings:
CommandLine|contains|all:
- '\AppData\Local\Packages\Microsoft.WindowsTerminal_'
- '\LocalState\settings.json'
filter_vsdevcmd:
CommandLine|contains|all:
- 'C:\Program Files\Microsoft Visual Studio\'
- '\Common7\Tools\VsDevCmd.bat'
condition: all of selection_* and not 1 of filter_*
falsepositives:
- Other legitimate "Windows Terminal" profiles
level: medium
Stages and Predicates
Stage 0: condition
all of selection_* and not 1 of filter_*Stage 1: selection_parent
selection_parent:
ParentImage|endswith:
- '\WindowsTerminal.exe'
- '\wt.exe'
Stage 2: selection_susp
selection_susp:
- Image|endswith:
- '\rundll32.exe'
- '\regsvr32.exe'
- '\certutil.exe'
- '\cscript.exe'
- '\wscript.exe'
- '\csc.exe'
- Image|contains:
- 'C:\Users\Public\'
- '\Downloads\'
- '\Desktop\'
- '\AppData\Local\Temp\'
- '\Windows\TEMP\'
- CommandLine|contains:
- ' iex '
- ' icm'
- 'Invoke-'
- 'Import-Module '
- 'ipmo '
- 'DownloadString('
- ' /c '
- ' /k '
- ' /r '
Stage 3: not filter_*
filter_builtin_visual_studio_shell:
CommandLine|contains|all:
- 'Import-Module'
- 'Microsoft.VisualStudio.DevShell.dll'
- 'Enter-VsDevShell'
filter_open_settings:
CommandLine|contains|all:
- '\AppData\Local\Packages\Microsoft.WindowsTerminal_'
- '\LocalState\settings.json'
filter_vsdevcmd:
CommandLine|contains|all:
- 'C:\Program Files\Microsoft Visual Studio\'
- '\Common7\Tools\VsDevCmd.bat'
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
CommandLine | match | C:\Program Files\Microsoft Visual Studio\ | excludes:CommandLine field:"CommandLine" value:"C:\Program Files\Microsoft Visual Studio\" |
CommandLine | match | \Common7\Tools\VsDevCmd.bat | excludes:CommandLine field:"CommandLine" value:"\Common7\Tools\VsDevCmd.bat" |
CommandLine | match | Enter-VsDevShell | excludes:CommandLine field:"CommandLine" value:"Enter-VsDevShell" |
CommandLine | match | Import-Module | excludes:CommandLine field:"CommandLine" value:"Import-Module" |
CommandLine | match | Microsoft.VisualStudio.DevShell.dll | excludes:CommandLine field:"CommandLine" value:"Microsoft.VisualStudio.DevShell.dll" |
CommandLine | match | \AppData\Local\Packages\Microsoft.WindowsTerminal_ | excludes:CommandLine field:"CommandLine" value:"\AppData\Local\Packages\Microsoft.WindowsTerminal_" |
CommandLine | match | \LocalState\settings.json | excludes:CommandLine field:"CommandLine" value:"\LocalState\settings.json" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
CommandLine | match |
| field:"CommandLine" kind:match |
Image | ends_with |
| field:"Image" kind:ends_with |
Image | match |
| field:"Image" kind:match |
ParentImage | ends_with |
| field:"ParentImage" kind:ends_with |