Detection rules › Sigma

Mstsc.EXE Execution With Local RDP File

Status
test
Severity
low
Log source
product windows, category process_creation
Author
Nasreddine Bencherchali (Nextron Systems), Christopher Peacock @securepeacock
Source
github.com/SigmaHQ/sigma

Detects potential RDP connection via Mstsc using a local ".rdp" file

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Mstsc.EXE Execution With Local RDP File
id: 5fdce3ac-e7f9-4ecd-a3aa-a4d78ebbf0af
status: test
description: Detects potential RDP connection via Mstsc using a local ".rdp" file
references:
    - https://www.blackhillsinfosec.com/rogue-rdp-revisiting-initial-access-methods/
    - https://web.archive.org/web/20230726144748/https://blog.thickmints.dev/mintsights/detecting-rogue-rdp/
author: Nasreddine Bencherchali (Nextron Systems), Christopher Peacock @securepeacock
date: 2023-04-18
modified: 2023-04-30
tags:
    - attack.command-and-control
    - attack.t1219.002
logsource:
    category: process_creation
    product: windows
detection:
    selection_img:
        - Image|endswith: '\mstsc.exe'
        - OriginalFileName: 'mstsc.exe'
    selection_cli:
        CommandLine|endswith:
            - '.rdp'
            - '.rdp"'
    filter_optional_wsl:
        ParentImage: 'C:\Windows\System32\lxss\wslhost.exe'
        CommandLine|contains: 'C:\ProgramData\Microsoft\WSL\wslg.rdp'
    condition: all of selection_* and not 1 of filter_optional_*
falsepositives:
    - Likely with legitimate usage of ".rdp" files
level: low

Stages and Predicates

Stage 0: condition

all of selection_* and not 1 of filter_optional_*

Stage 1: selection_img

selection_img:
    - Image|endswith: '\mstsc.exe'
    - OriginalFileName: 'mstsc.exe'

Stage 2: selection_cli

selection_cli:
    CommandLine|endswith:
        - '.rdp'
        - '.rdp"'

Stage 3: not filter_optional_wsl

filter_optional_wsl:
    ParentImage: 'C:\Windows\System32\lxss\wslhost.exe'
    CommandLine|contains: 'C:\ProgramData\Microsoft\WSL\wslg.rdp'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
CommandLinematchC:\ProgramData\Microsoft\WSL\wslg.rdp
ParentImageeqC:\Windows\System32\lxss\wslhost.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
CommandLineends_with
  • .rdp corpus 2 (sigma 2)
  • .rdp" corpus 2 (sigma 2)
Imageends_with
  • \mstsc.exe corpus 6 (sigma 6)
OriginalFileNameeq
  • mstsc.exe corpus 5 (sigma 4, elastic 1)