Detection rules › Sigma

Outbound RDP Connections Over Non-Standard Tools

Status
test
Severity
high
Log source
category network_connection, product windows
Author
Markus Neis
Source
github.com/SigmaHQ/sigma

Detects Non-Standard tools initiating a connection over port 3389 indicating possible lateral movement. An initial baseline is required before using this utility to exclude third party RDP tooling that you might use.

Known false positives

  • Third party RDP tools

MITRE ATT&CK coverage

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 3: Network connection

Rule body

title: Outbound RDP Connections Over Non-Standard Tools
id: ed74fe75-7594-4b4b-ae38-e38e3fd2eb23
status: test
description: |
    Detects Non-Standard tools initiating a connection over port 3389 indicating possible lateral movement.
    An initial baseline is required before using this utility to exclude third party RDP tooling that you might use.
references:
    - https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-0708
author: Markus Neis
date: 2019-05-15
modified: 2024-02-09
tags:
    - attack.lateral-movement
    - attack.t1021.001
    - car.2013-07-002
logsource:
    category: network_connection
    product: windows
detection:
    selection:
        DestinationPort: 3389
        Initiated: 'true'
    filter_main_mstsc:
        Image:
            - 'C:\Windows\System32\mstsc.exe'
            - 'C:\Windows\SysWOW64\mstsc.exe'
    filter_optional_dns:
        # Note: https://github.com/SigmaHQ/sigma/pull/2249
        Image: 'C:\Windows\System32\dns.exe'
        SourcePort: 53
        Protocol: 'udp'
    filter_optional_avast:
        Image|endswith:
            - '\Avast Software\Avast\AvastSvc.exe'
            - '\Avast\AvastSvc.exe'
    filter_optional_sysinternals_rdcman:
        Image|endswith: '\RDCMan.exe'
    filter_optional_chrome:
        Image: 'C:\Program Files\Google\Chrome\Application\chrome.exe'
    filter_optional_third_party:
        Image|endswith:
            - '\FSAssessment.exe'
            - '\FSDiscovery.exe'
            - '\MobaRTE.exe'
            - '\mRemote.exe'
            - '\mRemoteNG.exe'
            - '\Passwordstate.exe'
            - '\RemoteDesktopManager.exe'
            - '\RemoteDesktopManager64.exe'
            - '\RemoteDesktopManagerFree.exe'
            - '\RSSensor.exe'
            - '\RTS2App.exe'
            - '\RTSApp.exe'
            - '\spiceworks-finder.exe'
            - '\Terminals.exe'
            - '\ws_TunnelService.exe'
    filter_optional_thor:
        Image|endswith:
            - '\thor.exe'
            - '\thor64.exe'
    filter_optional_splunk:
        Image|startswith: 'C:\Program Files\SplunkUniversalForwarder\bin\'
    filter_optional_sentinel_one:
        Image|endswith: '\Ranger\SentinelRanger.exe'
    filter_optional_firefox:
        Image: 'C:\Program Files\Mozilla Firefox\firefox.exe'
    filter_optional_tsplus:  # Some RAS
        Image:
            - 'C:\Program Files\TSplus\Java\bin\HTML5service.exe'
            - 'C:\Program Files (x86)\TSplus\Java\bin\HTML5service.exe'
    filter_optional_null:
        Image: null
    filter_optional_empty:
        Image: ''
    filter_optional_unknown:
        Image: '<unknown process>'
    condition: selection and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
    - Third party RDP tools
level: high

Stages and Predicates

Stage 0: condition

selection and not 1 of filter_main_* and not 1 of filter_optional_*

Stage 1: selection

selection:
    DestinationPort: 3389
    Initiated: 'true'

Stage 2: not filter_main_mstsc

filter_main_mstsc:
    Image:
        - 'C:\Windows\System32\mstsc.exe'
        - 'C:\Windows\SysWOW64\mstsc.exe'

Stage 3: not filter_optional_*

filter_optional_dns:
    Image: 'C:\Windows\System32\dns.exe'
    SourcePort: 53
    Protocol: 'udp'
filter_optional_avast:
    Image|endswith:
        - '\Avast Software\Avast\AvastSvc.exe'
        - '\Avast\AvastSvc.exe'
filter_optional_sysinternals_rdcman:
    Image|endswith: '\RDCMan.exe'
filter_optional_chrome:
    Image: 'C:\Program Files\Google\Chrome\Application\chrome.exe'
filter_optional_third_party:
    Image|endswith:
        - '\FSAssessment.exe'
        - '\FSDiscovery.exe'
        - '\MobaRTE.exe'
        - '\mRemote.exe'
        - '\mRemoteNG.exe'
        - '\Passwordstate.exe'
        - '\RemoteDesktopManager.exe'
        - '\RemoteDesktopManager64.exe'
        - '\RemoteDesktopManagerFree.exe'
        - '\RSSensor.exe'
        - '\RTS2App.exe'
        - '\RTSApp.exe'
        - '\spiceworks-finder.exe'
        - '\Terminals.exe'
        - '\ws_TunnelService.exe'
filter_optional_thor:
    Image|endswith:
        - '\thor.exe'
        - '\thor64.exe'
filter_optional_splunk:
    Image|startswith: 'C:\Program Files\SplunkUniversalForwarder\bin\'
filter_optional_sentinel_one:
    Image|endswith: '\Ranger\SentinelRanger.exe'
filter_optional_firefox:
    Image: 'C:\Program Files\Mozilla Firefox\firefox.exe'
filter_optional_tsplus:
    Image:
        - 'C:\Program Files\TSplus\Java\bin\HTML5service.exe'
        - 'C:\Program Files (x86)\TSplus\Java\bin\HTML5service.exe'
filter_optional_null:
    Image: null
filter_optional_empty:
    Image: ''
filter_optional_unknown:
    Image: '<unknown process>'

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
ImageeqC:\Windows\SysWOW64\mstsc.exeexcludes:Image field:"Image" value:"C:\Windows\SysWOW64\mstsc.exe"
ImageeqC:\Windows\System32\mstsc.exeexcludes:Image field:"Image" value:"C:\Windows\System32\mstsc.exe"
ImageeqC:\Windows\System32\dns.exeexcludes:Image field:"Image" value:"C:\Windows\System32\dns.exe"
Protocolequdpexcludes:Protocol field:"Protocol" value:"udp"
SourcePorteq53excludes:SourcePort field:"SourcePort" value:"53"
Imageends_with\Avast Software\Avast\AvastSvc.exeexcludes:Image field:"Image" value:"\Avast Software\Avast\AvastSvc.exe"
Imageends_with\Avast\AvastSvc.exeexcludes:Image field:"Image" value:"\Avast\AvastSvc.exe"
Imageends_with\FSAssessment.exeexcludes:Image field:"Image" value:"\FSAssessment.exe"
Imageends_with\FSDiscovery.exeexcludes:Image field:"Image" value:"\FSDiscovery.exe"
Imageends_with\MobaRTE.exeexcludes:Image field:"Image" value:"\MobaRTE.exe"
Imageends_with\Passwordstate.exeexcludes:Image field:"Image" value:"\Passwordstate.exe"
Imageends_with\RDCMan.exeexcludes:Image field:"Image" value:"\RDCMan.exe"
Imageends_with\RSSensor.exeexcludes:Image field:"Image" value:"\RSSensor.exe"
Imageends_with\RTS2App.exeexcludes:Image field:"Image" value:"\RTS2App.exe"
Imageends_with\RTSApp.exeexcludes:Image field:"Image" value:"\RTSApp.exe"
Imageends_with\Ranger\SentinelRanger.exeexcludes:Image field:"Image" value:"\Ranger\SentinelRanger.exe"
Imageends_with\RemoteDesktopManager.exeexcludes:Image field:"Image" value:"\RemoteDesktopManager.exe"
Imageends_with\RemoteDesktopManager64.exeexcludes:Image field:"Image" value:"\RemoteDesktopManager64.exe"
Imageends_with\RemoteDesktopManagerFree.exeexcludes:Image field:"Image" value:"\RemoteDesktopManagerFree.exe"
Imageends_with\Terminals.exeexcludes:Image field:"Image" value:"\Terminals.exe"
Imageends_with\mRemote.exeexcludes:Image field:"Image" value:"\mRemote.exe"
Imageends_with\mRemoteNG.exeexcludes:Image field:"Image" value:"\mRemoteNG.exe"
Imageends_with\spiceworks-finder.exeexcludes:Image field:"Image" value:"\spiceworks-finder.exe"
Imageends_with\thor.exeexcludes:Image field:"Image" value:"\thor.exe"
Imageends_with\thor64.exeexcludes:Image field:"Image" value:"\thor64.exe"
Imageends_with\ws_TunnelService.exeexcludes:Image field:"Image" value:"\ws_TunnelService.exe"
Imageeq<unknown process>excludes:Image field:"Image" value:"<unknown process>"
ImageeqC:\Program Files (x86)\TSplus\Java\bin\HTML5service.exeexcludes:Image field:"Image" value:"C:\Program Files (x86)\TSplus\Java\bin\HTML5service.exe"
ImageeqC:\Program Files\Google\Chrome\Application\chrome.exeexcludes:Image field:"Image" value:"C:\Program Files\Google\Chrome\Application\chrome.exe"
ImageeqC:\Program Files\Mozilla Firefox\firefox.exeexcludes:Image field:"Image" value:"C:\Program Files\Mozilla Firefox\firefox.exe"
ImageeqC:\Program Files\TSplus\Java\bin\HTML5service.exeexcludes:Image field:"Image" value:"C:\Program Files\TSplus\Java\bin\HTML5service.exe"
Imageis_null(no value, null check)excludes:Image
Imagestarts_withC:\Program Files\SplunkUniversalForwarder\bin\excludes:Image field:"Image" value:"C:\Program Files\SplunkUniversalForwarder\bin\"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
DestinationPorteq
  • 3389 corpus 12 (elastic 4, kusto 4, sigma 2, splunk 2)
field:"DestinationPort" kind:eq value:"3389"
Initiatedeq
  • true corpus 50 (sigma 50)
field:"Initiated" kind:eq value:"true"