{"id":"4b8f6d3a-9c5e-4f2a-a7d8-6b9c3e5f2a8d","title":"RDP Enable or Disable via Win32_TerminalServiceSetting WMI Class","description":"Detects enabling or disabling of Remote Desktop Protocol (RDP) using alternate methods such as WMIC or PowerShell.\nIn PowerShell one-liner commands, the \"SetAllowTSConnections\" method of the \"Win32_TerminalServiceSetting\" class may be used to enable or disable RDP.\nIn WMIC, the \"rdtoggle\" alias or \"Win32_TerminalServiceSetting\" class may be used for the same purpose.\n","author":"Daniel Koifman (KoifSec), Swachchhanda Shrawan Poudel (Nextron Systems)","status":"experimental","level":"medium","date":"2025-11-15","modified":"","tags":["attack.lateral-movement","attack.t1021.001","attack.execution","attack.t1047"],"technique_ids":["T1021.001","T1047"],"logsource":{"category":"process_creation","product":"windows"},"falsepositives":["Legitimate system administrators enabling RDP for remote support","System configuration scripts during deployment"],"references":["https://www.trendmicro.com/en_gb/research/22/e/uncovering-a-kingminer-botnet-attack-using-trend-micro-managed-x.html","https://github.com/HackTricks-wiki/hacktricks/blob/72f20a3fa26775b932bd819f1824c6377802a768/src/windows-hardening/basic-cmd-for-pentesters.md#firewall","https://github.com/Lifailon/RSA/blob/rsa/Sources/RSA-1.4.1.ps1#L1468"],"source_path":"rules/windows/process_creation/proc_creation_win_rdp_enable_or_disable_via_win32_terminalservicesetting_wmi_class.yml","source_sha256":"0a6e176e805d5f4b97b0a7c2851857d2970f98a539310d43f1e07a1351b0e7f0","source_url":"https://github.com/anpa1200/sigma/blob/b249e9683190cffdcaf188ccbfb90bf4759844e1/rules/windows/process_creation/proc_creation_win_rdp_enable_or_disable_via_win32_terminalservicesetting_wmi_class.yml","license":"Detection Rule License 1.1","license_url":"https://github.com/SigmaHQ/Detection-Rule-License/blob/main/LICENSE.Detection.Rules.md","yaml":"title: RDP Enable or Disable via Win32_TerminalServiceSetting WMI Class\nid: 4b8f6d3a-9c5e-4f2a-a7d8-6b9c3e5f2a8d\nrelated:\n    - id: a2863fbc-d5cb-48d5-83fb-d976d4b1743b\n      type: similar\nstatus: experimental\ndescription: |\n    Detects enabling or disabling of Remote Desktop Protocol (RDP) using alternate methods such as WMIC or PowerShell.\n    In PowerShell one-liner commands, the \"SetAllowTSConnections\" method of the \"Win32_TerminalServiceSetting\" class may be used to enable or disable RDP.\n    In WMIC, the \"rdtoggle\" alias or \"Win32_TerminalServiceSetting\" class may be used for the same purpose.\nreferences:\n    - https://www.trendmicro.com/en_gb/research/22/e/uncovering-a-kingminer-botnet-attack-using-trend-micro-managed-x.html\n    - https://github.com/HackTricks-wiki/hacktricks/blob/72f20a3fa26775b932bd819f1824c6377802a768/src/windows-hardening/basic-cmd-for-pentesters.md#firewall\n    - https://github.com/Lifailon/RSA/blob/rsa/Sources/RSA-1.4.1.ps1#L1468\nauthor: Daniel Koifman (KoifSec), Swachchhanda Shrawan Poudel (Nextron Systems)\ndate: 2025-11-15\ntags:\n    - attack.lateral-movement\n    - attack.t1021.001\n    - attack.execution\n    - attack.t1047\nlogsource:\n    category: process_creation\n    product: windows\ndetection:\n    selection_img:\n        - Image|endswith:\n              - '\\wmic.exe'\n              - '\\powershell.exe'\n              - '\\pwsh.exe'\n        - OriginalFileName:\n              - 'wmic.exe'\n              - 'PowerShell.EXE'\n              - 'pwsh.dll'\n    selection_cli_method:\n        CommandLine|contains:\n            - 'rdtoggle'\n            - 'Win32_TerminalServiceSetting'\n    selection_cli_property:\n        CommandLine|contains: 'SetAllowTSConnections'\n    condition: all of selection_*\nfalsepositives:\n    - Legitimate system administrators enabling RDP for remote support\n    - System configuration scripts during deployment\nlevel: medium\n","validation":"yaml_parsed_not_backend_compiled_or_live_validated","techniques":[{"key":"enterprise/T1021.001","id":"T1021.001","name":"Remote Desktop Protocol","page":"techniques/enterprise/T1021.001/"},{"key":"enterprise/T1047","id":"T1047","name":"Windows Management Instrumentation","page":"techniques/enterprise/T1047/"}],"data_path":"data/detection-rules/4b8f6d3a-9c5e-4f2a-a7d8-6b9c3e5f2a8d.json","kind":"sigma"}
