Investigation · Access
Who connected to this host over RDP, from where, and when did they leave?
Reconstruct inbound RDP on a host: who authenticated, the source IP, and whether they logged off or just disconnected, across RDP and Security logs.
When you would ask thisYou have a host of interest and need a defensible record of who reached it over RDP, from which address, and how long each session lasted.
Steps
- 1
List inbound RDP connections at the transport level
Start with connections that happen before any logon. RdpCoreTS event 131 records each inbound RDP TCP connection with the client IP, including connections that never authenticate, so it exposes scanning and failed attempts. RemoteConnectionManager 261 shows the listener accepting a connection. These two establish the full set of addresses that reached the RDP port, which you then narrow to the ones that actually authenticated in the next step.
- 2
Confirm which connections authenticated
RemoteConnectionManager event 1149, 'User authentication succeeded', fires when network authentication passes, before a full session exists. It records the user, domain and source address in its UserData fields. Treat it as 'someone passed NLA from this IP', not 'a session started'. The username is frequently blank on the first negotiation, so do not read a blank 1149 as anonymous access; pair it with the session events below to attribute it to an account.
- 3
Pin each session's lifecycle
LocalSessionManager is the backbone of the timeline and survives Security log clearing. Event 21 is session logon (User, SessionID, Address), 22 is shell start, 25 is reconnection, 24 is disconnect, and 23 is logoff. Events 39 and 40 record who disconnected a session and the reason. Join every event on SessionID to see one session from logon to exit. Address holds the source IP, or 'LOCAL' for a console session rather than a true RDP client.
RDP sessions21Remote Desktop session logon succeededRDP sessions22Remote Desktop shell start notification receivedRDP sessions25Remote Desktop session reconnection succeededRDP sessions24Remote Desktop session was disconnectedRDP sessions23Remote Desktop session logoff succeededRDP sessions39Session was disconnected by another sessionRDP sessions40Session was disconnected with reason codeList every RDP session logon with its source address (collected .evtx)Get-WinEvent -Path .\Microsoft-Windows-TerminalServices-LocalSessionManager%4Operational.evtx ` -FilterXPath "*[System[EventID=21]]" | ForEach-Object { $x = [xml]$_.ToXml(); [pscustomobject]@{ Time = $_.TimeCreated User = $x.Event.UserData.EventXML.User Session = $x.Event.UserData.EventXML.SessionID Address = $x.Event.UserData.EventXML.Address } } - 4
Corroborate with the Security log
On the Security log an RDP logon is 4624 with LogonType 10 (RemoteInteractive); record IpAddress, TargetUserName and TargetLogonId. Event 4778 marks a session reconnect and 4779 a disconnect, both carrying the client name and address. Logoff is 4634 or the user-initiated 4647. Join 4624 to 4634/4647 on TargetLogonId to measure session duration, and cross-check that duration against the LocalSessionManager 23/24 events so a disconnect is not mistaken for a logoff.
- 5
Trace the connection back to the source host
If you can collect the suspected source machine, its RDPClient log names the servers it connected out to. Event 1024 records the target server name the client tried to reach, and 1102 marks the multitransport connection. This is how you prove the direction of movement: the destination's 1149 and LSM 21 show an inbound session, and the source's 1024 shows the same host as an outbound target at the same time.
Where it goes wrong
- With Network Level Authentication, RDP first produces a Type 3 network logon (CredSSP) and only then the Type 10 RemoteInteractive logon, so a Type 3 immediately before a Type 10 from the same address is the same RDP session, not separate activity.
- RemoteConnectionManager 1149 frequently logs a blank username on the initial negotiation; do not treat that as anonymous access.
- 'When did they leave' depends on which event you trust: LSM 24 (disconnect) leaves the session running, while 23 (logoff) ends it. A disconnect with no later logoff means the session was still live.
- LogonIds are only unique until the next reboot, so do not join a 4624 TargetLogonId to a 4634 from before a restart.
- RdpCoreTS, RemoteConnectionManager and LocalSessionManager are on by default, but the Security log's Type 10 4624 needs Logon auditing enabled, so the two sources will not always agree.
- LocalSessionManager Address can read 'LOCAL' for a console session; that is not an RDP client.
Beyond event logs
Default.rdp and connection MRU
On the source: %USERPROFILE%\Documents\Default.rdp and HKCU\Software\Microsoft\Terminal Server Client\Servers
The Servers key lists every host the user typed into mstsc, with the username hint last used. Default.rdp holds the most recent connection settings. Both place the source user at the keyboard choosing RDP targets.
RDP bitmap cache
On the source: %LOCALAPPDATA%\Microsoft\Terminal Server Client\Cache\ (bcache*.bmc, Cache*.bin)
Fragments of the remote screen are cached as tiles. Tools can reassemble them to show what the operator actually saw during the session, which matters when the destination logs are thin.
mstsc.exe execution evidence
On the source: C:\Windows\Prefetch\MSTSC.EXE-*.pf
Prefetch confirms the RDP client ran and gives first and last run times and run count, independent of the RDP logs.