T1563.002

RDP Hijacking

Adversaries may hijack a legitimate user's remote desktop session to move laterally within an environment. Using tscon.exe with SYSTEM-level privileges, an attacker can steal an active or disconnected RDP session without requiring the target user's credentials or generating visible prompts. This technique enables silent lateral movement between systems and can escalate privileges by inheriting the security context of the hijacked session — including Domain Admin accounts. Common execution vectors include creating a transient Windows service to run tscon.exe as SYSTEM, or using PsExec to elevate to SYSTEM before invoking tscon.exe directly.

Microsoft Sentinel / Defender
kusto
// Part 1: Direct tscon.exe execution — primary indicator of RDP session hijacking
let SuspiciousParents = dynamic(["cmd.exe", "powershell.exe", "powershell_ise.exe", "pwsh.exe", "wscript.exe", "cscript.exe", "mshta.exe"]);
let PrivilegedParents = dynamic(["services.exe", "svchost.exe", "psexec.exe", "psexesvc.exe"]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "tscon.exe"
| extend IsSystemContext = (AccountName =~ "SYSTEM" or AccountDomain =~ "NT AUTHORITY")
| extend SuspiciousParent = InitiatingProcessFileName in~ (SuspiciousParents)
| extend PrivilegedParent = InitiatingProcessFileName in~ (PrivilegedParents)
| extend HasSessionArg = ProcessCommandLine matches regex @"tscon\.exe\s+\d+"
| extend HasDestArg = ProcessCommandLine has "/dest:"
| project Timestamp, DeviceName, AccountName, AccountDomain, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine,
         IsSystemContext, SuspiciousParent, PrivilegedParent, HasSessionArg, HasDestArg
| sort by Timestamp desc
| union (
// Part 2: Service creation to run tscon.exe as SYSTEM (privilege escalation vector)
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "sc.exe"
| where ProcessCommandLine has "tscon"
| extend TacticDetail = "Service-based tscon execution — SYSTEM privilege escalation for session hijack"
| project Timestamp, DeviceName, AccountName, AccountDomain, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine, TacticDetail
)
| union (
// Part 3: Session enumeration immediately before potential hijack (recon phase)
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("qwinsta.exe", "query.exe")
| where ProcessCommandLine has_any ("session", "user", "/server:")
| extend TacticDetail = "RDP session enumeration — likely precursor to session hijack"
| project Timestamp, DeviceName, AccountName, AccountDomain, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine, TacticDetail
)
| sort by Timestamp desc
high severity high confidence

Data Sources

Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • Helpdesk and IT support staff using tscon.exe to shadow or take over sessions for authorized remote assistance
  • RDS session management scripts that reconnect disconnected sessions as part of VDI maintenance workflows
  • Terminal Services administrators using qwinsta/query session for routine session inventory and cleanup
  • Automated session management tools for Citrix or RDS environments that legitimately enumerate and transfer sessions

Unlock Pro Content

Get the full detection package for T1563.002 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections