Event ID 4778 and 4779: session reconnected and disconnected

Event ID 4778, "A session was reconnected to a Window Station", and its partner 4779, "A session was disconnected from a Window Station", are written to the Security log when an existing Remote Desktop or console session is reconnected or disconnected, with the account, the session name and the name and address of the client.

Security logLogons and sessionsChecked 2 December 2026

What events 4778 and 4779 record

Windows keeps a desktop session alive when its user disconnects, so the same session can be picked up later from the same or another computer. Microsoft documents 4778 as written when a user reconnects to an existing Terminal Services session, or switches to an existing desktop with Fast User Switching, and 4779 when a user disconnects or switches away. Both carry the same six fields:

FieldExampleWhat it tells you
Account Name, Account Domaina.berg, HF-WS01Whose session it is
Logon ID0x3E7A12The session; matches its 4624
Session NameRDP-Tcp#3 or ConsoleRemote Desktop or the physical console
Client NameATTACKER-PCThe computer name the RDP client reported
Client Address10.211.55.2The IP address the client connected from

Two details make these events more useful than their size suggests. The client name is reported by the RDP client itself, so it is often the attacker's own machine name, which appears nowhere else in the logs. And the client address on a 4778 is where the session was picked up from, which can differ from where it was first opened.

When they are written, and when they are not

What happensSecurity logRemote Desktop logs
First RDP connection to a new session4624 type 10 (no 4778)1149, then 21 and 22
User closes the RDP window or the network drops477924
User reconnects to the disconnected session4624 (type 10, or type 7 on some versions), then 47781149, then 25
RDP connection takes over a console session that is logged on4779 for Console, then 4778 for RDP-Tcp24 then 25
User signs out4647, then 463423
Fast User Switching on a workstation4779 and 4778Not applicable

A first-time connection does not produce a 4778, because there was no existing session to reconnect to. That is the most common misreading of these events: an RDP logon is found with 4624 type 10 or with the Remote Desktop events 21 and 1149, and 4778 adds only the reconnects.

Is the auditing on?

Both events belong to "Audit Other Logon/Logoff Events", which is not enabled by default on current Windows. Many hosts will have none at all. The Remote Desktop operational log (Microsoft-Windows-TerminalServices-LocalSessionManager/Operational) records the same disconnects and reconnects as events 24 and 25, needs no audit policy, and is usually the better source. When both exist, the Security events add the client name; the Remote Desktop log adds the session ID and survives Security log roll-over.

Event 4778 fields

The fields an investigator reads first, what they mean, and where Arcsentry stores them.

FieldMeaningArcsentry field
Account Name, Account DomainThe owner of the session.$accountname, $accountdomain
Logon IDThe logon session, for joining to 4624 and 4634.event_log_logon_id
Session NameRDP-Tcp#n for a Remote Desktop session, Console for the physical console.$sessionname
Client NameThe computer name reported by the client. Unknown for console switches.$clientname
Client AddressThe client's IP address. LOCAL for console switches.$clientaddress

What event 4778 proves, and what it does not

It shows

  • That this account's existing session was reconnected (4778) or disconnected (4779) at this time.
  • For 4778, the address and reported computer name the session was picked up from.

It does not show

  • That the client name is real. The RDP client reports it and can be set to anything.
  • That the session was new. First connections appear as 4624 type 10, not 4778.
  • That the user signed out after a 4779. Disconnected sessions keep running.

Attacker activity it reveals

Taking over a logged-on session

Connecting over RDP to an account whose console session is already logged on moves that session to RDP: a 4779 for Console, then a 4778 for RDP-Tcp with the attacker's address. The victim's open programs and files are now on the attacker's screen. MITRE ATT&CK T1021.001

RDP session hijacking

With SYSTEM rights, tscon <id> /dest:<session> attaches someone else's disconnected session without their password. The 4778 names the victim account, while process creation shows tscon.exe running as SYSTEM, often from a service created for the purpose. MITRE ATT&CK T1563.002

The attacker's machine name

Client Name often holds the default hostname of the attacker's machine or virtual machine (DESKTOP- followed by random characters, or a name like KALI). It is a useful indicator to sweep for across hosts.

In a real investigation: Halden Freight office intrusion

On HF-WS01 the attacker guessed a.berg's password from 10.211.55.2, logged on over the network at 22:05:03 UTC and connected over Remote Desktop at 22:05:05 (4624 type 10). a.berg's console session was already logged on, so Windows moved it: the Remote Desktop log recorded the console session disconnecting at 22:05:05 and reconnecting from 10.211.55.2 at 22:05:06 (event 25). This is the take-over pattern above. The reconnect is the record that shows the attacker did not get a fresh desktop: whatever a.berg had open was now on the attacker's screen.

Finding event 4778 in Arcsentry

Arcsentry parses every channel in Windows\System32\winevt\Logs, whether it comes from an Arcsentry Collector archive, a KAPE or Velociraptor collection, or a disk image. Security log records are the event type evtx_security. In Hunt, with that event type selected:

filter event_code in ("4778", "4779")
derive {acct = $accountname, sess = $sessionname, client = $clientname, addr = $clientaddress}
select {timestamp, event_code, acct, sess, client, addr}
sort {timestamp}

Every reconnect and disconnect in order, with the client name and address. Group by client to list every machine name that reconnected sessions on the host.

Or ask in plain English, for example "show event 4778 on every host, oldest first", and Arcsentry shows the AQL it wrote before it runs. The AQL reference lists the operators used here, and the AI investigator reads the same events, citing each one by its event ID when it reports a finding.

Related event IDs

All events by investigation question: Windows security event IDs for incident response. Logon types in full: Windows logon types. The log files themselves: Windows event logs.

Frequently asked

What is event ID 4778?

A Remote Desktop or console session that already existed was reconnected. It records the account, the Logon ID, the session name (RDP-Tcp#n or Console) and the name and IP address of the client that reconnected.

What is event ID 4779?

A session was disconnected without signing out, usually because the RDP window was closed or the network dropped, or because the user switched to another account. The session keeps running.

Why don't I see 4778 for every RDP logon?

Because 4778 is only written for reconnects to an existing session. A new RDP session appears as 4624 with logon type 10 and as events 21 and 1149 in the Remote Desktop logs. Also, 4778 needs "Audit Other Logon/Logoff Events", which is off by default.

How do I find the attacker's computer name from RDP logs?

The Client Name field in 4778 and 4779 holds the computer name the RDP client reported. It is set by the client, so treat it as an indicator to search for, not as proof of identity.

Sources

  • Microsoft Learn: 4778(S) A session was reconnected to a Window Station; 4779(S) A session was disconnected from a Window Station; Audit Other Logon/Logoff Events
  • MITRE ATT&CK: T1021.001 Remote Desktop Protocol; T1563.002 RDP Hijacking
  • Venema Labs lab case: Halden Freight office intrusion, HF-WS01 Remote Desktop and Security logs

Checked 2 December 2026 by Venema Labs against Microsoft's audit documentation and, where an example is shown, the named lab case. Field availability varies by Windows version.

Find event 4778 across every host in minutes.

Load your collections, ask what happened, and check every finding against the event behind it. Free for 7 days.

Request a trial