Detection logic
Original SigmaHQ detection and related fields from the pinned file. The source file includes its full metadata.
logsource:
category: registry_set
product: windows
detection:
selection_ts_shadow:
TargetObject|contains:
- '\Control\Terminal Server\'
- '\Windows NT\Terminal Services\'
TargetObject|endswith: '\Shadow'
Details:
- 'DWORD (0x00000001)' # Full Control with user’s permission
- 'DWORD (0x00000002)' # Full Control without user’s permission
- 'DWORD (0x00000003)' # View Session with user’s permission
- 'DWORD (0x00000004)' # View Session without user’s permission
selection_ts_key:
TargetObject|contains:
- '\Control\Terminal Server\'
- '\Windows NT\Terminal Services\'
TargetObject|endswith:
- '\DisableRemoteDesktopAntiAlias' # Disable anti-aliasing for remote desktop (DarkGate malware)
- '\DisableSecuritySettings' # Disable security settings, allowing access to programs/entire desktop (DarkGate malware)
- '\fAllowUnsolicited' # Allow unsolicited remote assistance offers
- '\fAllowUnsolicitedFullControl'
Details: 'DWORD (0x00000001)'
selection_ts_tamper_only:
# Any changes to these keys should be suspicious and looked at
- TargetObject|contains:
- '\Control\Terminal Server\InitialProgram' # This value can be set to specify a program to run automatically when a user logs on to a remote computer.
- '\Control\Terminal Server\WinStations\RDP-Tcp\InitialProgram' # This value can be set to specify a program to run automatically when a user logs on to a remote computer.
- '\Terminal Server\WinStations\RDP-Tcp\SecurityLayer'
- '\Windows NT\Terminal Services\InitialProgram' # This value can be set to specify a program to run automatically when a user logs on to a remote computer.
- TargetObject|endswith: '\services\TermService\Parameters\ServiceDll' # RDP hijacking
filter_main_securitylayer_tls:
TargetObject|endswith: '\SecurityLayer'
Details: 'DWORD (0x00000002)' # TLS Enabled
filter_main_termsrv_dll:
TargetObject|endswith: '\services\TermService\Parameters\ServiceDll'
Details:
- '%%SystemRoot%%\System32\termsrv.dll'
- '%%SystemRoot%%\SysWOW64\termsrv.dll'
- '%%windir%%\System32\termsrv.dll'
- '%%windir%%\SysWOW64\termsrv.dll'
- '%SystemRoot%\System32\termsrv.dll'
- '%SystemRoot%\SysWOW64\termsrv.dll'
- '%windir%\System32\termsrv.dll'
- '%windir%\SysWOW64\termsrv.dll'
- 'C:\Windows\System32\termsrv.dll'
- 'C:\Windows\SysWOW64\termsrv.dll'
filter_main_initialprog_empty:
TargetObject|contains:
- '\Control\Terminal Server\InitialProgram'
- '\Control\Terminal Server\WinStations\RDP-Tcp\InitialProgram'
- '\Windows NT\Terminal Services\InitialProgram'
Details:
- '(Empty)'
- ''
filter_optional_container_worker:
Image|startswith:
- 'C:\Windows\System32\'
- 'C:\Windows\SysWOW64\'
- 'C:\Windows\WinSxS\'
Image|endswith: '\containerworker.exe'
TargetObject|contains: '\Windows\Containers\Layers\'
condition: 1 of selection_ts_* and not 1 of filter_main_* and not 1 of filter_optional_*
falsepositives:
- Some of the keys mentioned here could be modified by an administrator while setting group policy (it should be investigated either way)