When an attacker moves laterally across a Windows network, Remote Desktop Protocol is the tool of choice in the vast majority of intrusions. Windows records every RDP session across multiple independent event log channels — from the initial authentication in Security.evtx to the session lifecycle in TerminalServices logs. Cross-correlating these channels reconstructs the complete lateral movement path, including source IPs, usernames, session durations, and disconnection patterns.
What Are RDP Event Logs?
Remote Desktop Protocol (RDP) event logs are a collection of Windows Event Log channels that collectively record every phase of a remote desktop session. Unlike a single monolithic log, RDP telemetry is distributed across at least four distinct EVTX files, each capturing a different aspect of the connection lifecycle. The TerminalServices-LocalSessionManager/Operational log records session creation, reconnection, and disconnection on the destination host. The TerminalServices-RDPClient/Operational log records outbound connection attempts on the source host, including the target hostname. The Security.evtx log records the authentication event (Event ID 4624, Logon Type 10) with the source IP address. The TerminalServices-RemoteConnectionManager/Operational log records the initial connection attempt before authentication completes.
This distribution means that a single RDP session produces evidence on both the source and destination machines. An investigator who collects logs from only one endpoint will recover a partial picture. Collecting from both endpoints — and cross-correlating timestamps — produces a complete timeline showing who connected from where, when the session started, how long it lasted, and whether the session was cleanly closed or abnormally terminated.
RDP has been the dominant lateral movement technique in enterprise intrusions since at least 2015. It is used by ransomware operators (Conti, LockBit, BlackSuit), nation-state actors (APT29, APT41), and insider threats. The protocol is enabled by default on Windows Server and is frequently enabled on workstations for IT administration. Because RDP uses legitimate Windows authentication, it blends with normal administrative traffic — making log analysis the primary detection and forensic reconstruction method.
A single RDP session produces artifacts on both the source and destination hosts across four or more event log channels. No single log tells the whole story. The source IP is only in Security.evtx (4624 Type 10) on the destination. The target hostname is only in TerminalServices-RDPClient/Operational (Event 1024) on the source. Full reconstruction requires both endpoints.
Location & Format
Event Log File Paths
| Log Channel | File Path | Recorded On |
|---|---|---|
| TerminalServices-LocalSessionManager/Operational | %SystemRoot%\System32\winevt\Logs\Microsoft-Windows-TerminalServices-LocalSessionManager%4Operational.evtx | Destination host |
| TerminalServices-RemoteConnectionManager/Operational | %SystemRoot%\System32\winevt\Logs\Microsoft-Windows-TerminalServices-RemoteConnectionManager%4Operational.evtx | Destination host |
| TerminalServices-RDPClient/Operational | %SystemRoot%\System32\winevt\Logs\Microsoft-Windows-TerminalServices-RDPClient%4Operational.evtx | Source host |
| Security.evtx | %SystemRoot%\System32\winevt\Logs\Security.evtx | Destination host |
Log Format
All Windows Event Logs use the EVTX (Event Log XML) binary format introduced in Windows Vista. Each event is stored as a binary XML record with a standard header containing the event ID, timestamp (UTC, 100-nanosecond precision), provider name, and channel. The event-specific data is stored in structured XML fields that vary by provider. EVTX files have a configurable maximum size (default: 1 MB for operational logs, 20 MB for Security.evtx) and use a circular buffer — when the file reaches capacity, the oldest events are overwritten.
The TerminalServices operational logs default to only 1 MB. On a busy RDP server, this can mean retention of only a few days. Security.evtx defaults to 20 MB but on a domain controller may retain only hours of events. Always check the MaxSize setting in the registry at HKLM\SYSTEM\CurrentControlSet\Services\EventLog\{LogName} and increase it proactively in environments where RDP forensics may be needed.
Key Event IDs
Destination Host — TerminalServices-LocalSessionManager/Operational
| Event ID | Description | Key Fields | Forensic Value |
|---|---|---|---|
21 | Session logon succeeded | User, SessionID, Source Network Address | Confirms successful RDP logon with source IP |
22 | Shell start notification received | User, SessionID, Source Network Address | Desktop shell loaded; user can interact |
23 | Session logoff succeeded | User, SessionID | Clean session termination |
24 | Session has been disconnected | User, SessionID, Source Network Address | Session disconnected but not logged off (may reconnect) |
25 | Session reconnection succeeded | User, SessionID, Source Network Address | Reconnection to a previously disconnected session; source IP may differ |
39 | Session disconnected by another session | User, SessionID, Source SessionID | One user kicked another off; possible credential sharing |
40 | Session disconnected, reason code | User, SessionID, Reason | Reason code reveals whether disconnect was user-initiated, network failure, or admin action |
Destination Host — TerminalServices-RemoteConnectionManager/Operational
| Event ID | Description | Key Fields | Forensic Value |
|---|---|---|---|
261 | Listener received a connection | None (pre-authentication) | Connection attempt detected before authentication; correlate timestamp with 4625 failures |
1149 | User authentication succeeded | User, Domain, Source Network Address | NLA (Network Level Authentication) succeeded; source IP available even if session setup fails |
Source Host — TerminalServices-RDPClient/Operational
| Event ID | Description | Key Fields | Forensic Value |
|---|---|---|---|
1024 | RDP ClientActiveX is trying to connect | Value (target hostname or IP) | Records the destination the user attempted to RDP into; critical for mapping lateral movement from the source side |
1025 | RDP ClientActiveX connected | Value (target hostname or IP) | Confirms successful outbound connection |
1026 | RDP ClientActiveX disconnected | Disconnect Reason | Records why the outbound session ended |
1027 | Connected to domain | Domain name | Records the domain of the target system |
Destination Host — Security.evtx
| Event ID | Description | Key Fields | Forensic Value |
|---|---|---|---|
4624 | Successful logon (Type 10 = RemoteInteractive) | TargetUserName, TargetDomainName, IpAddress, IpPort, LogonProcessName, AuthenticationPackageName | Definitive proof of RDP logon with source IP; Logon Type 10 is exclusively RDP |
4625 | Failed logon (Type 10) | TargetUserName, IpAddress, Status, SubStatus | Failed RDP authentication attempts; brute-force or credential-guessing detection |
4634 | Account was logged off | TargetUserName, TargetLogonId | Session end; correlate LogonId with 4624 for duration calculation |
4647 | User initiated logoff | TargetUserName, TargetLogonId | Distinguishes user-initiated logoff from session timeout |
4778 | Session reconnected (window station) | AccountName, SessionName, ClientName, ClientAddress | RDP session reconnection with client hostname and IP |
4779 | Session disconnected (window station) | AccountName, SessionName, ClientName, ClientAddress | RDP session disconnection (user closed window without logging off) |
In Security.evtx Event 4624, Logon Type 10 is exclusively Remote Desktop (RemoteInteractive). Logon Type 7 indicates a reconnection to an existing session (unlock). Logon Type 3 (Network) may appear for RDP-related NLA authentication but is not the primary RDP logon event. Always filter on Type 10 first, then correlate with Type 7 for reconnections.
What It Reveals
Cross-correlating RDP event logs across all four channels answers the following investigative questions:
- Which user accounts were used for lateral movement? — Event 4624 (Type 10) records the TargetUserName and TargetDomainName on every destination host, building a map of which credentials were used at each hop.
- What was the source IP of each RDP connection? — The
IpAddressfield in Security.evtx 4624 and theSource Network Addressin LocalSessionManager Event 21 both record the connecting host’s IP. Discrepancies between these two fields may indicate NAT or proxy traversal. - What was the complete lateral movement path? — By collecting RDPClient/Operational (Event 1024) from each compromised host, the investigator can chain outbound connections: Host A connected to Host B, Host B connected to Host C, Host C connected to the domain controller.
- How long did each session last? — Subtracting the 4624 timestamp from the 4634/4647 timestamp gives the total session duration. For disconnected sessions, Event 24 provides the disconnect time.
- Were there failed authentication attempts before success? — Event 4625 (Type 10) records failed RDP logon attempts. A cluster of 4625 events followed by a 4624 indicates credential guessing. The
StatusandSubStatusfields distinguish between wrong password (0xC000006A), nonexistent account (0xC0000064), and account locked out (0xC0000234). - Did the attacker reconnect to existing sessions? — Event 25 (LocalSessionManager) and Event 4778 (Security) record session reconnections. A reconnection from a different source IP than the original logon may indicate session hijacking or attacker infrastructure rotation.
- Was RDP used during off-hours? — Timestamp analysis of 4624 Type 10 events against the organization’s working hours identifies anomalous access patterns. An RDP session from an external IP at 03:00 local time on a Saturday warrants investigation.
- Which systems were targeted but not compromised? — Event 1024 on the source host records attempted connections. If a 1024 event has no corresponding 4624 on the target, the connection was attempted but authentication failed or the target was unreachable.
To map the full attack path, collect TerminalServices-RDPClient/Operational (Event 1024) from every compromised host. Each 1024 event records the outbound target. Chain them: the 1024 on Host A points to Host B, the 1024 on Host B points to Host C. The Security.evtx 4624 Type 10 on each destination confirms the connection succeeded. This dual-source correlation is the gold standard for RDP lateral movement reconstruction.
Forensic Use Cases
1. Ransomware Lateral Movement Reconstruction
A ransomware operator compromises an external-facing RDP server via brute force (Event 4625 x 3,400 followed by Event 4624 Type 10). From the initial foothold, they use the same compromised credentials to RDP into internal hosts. Event 1024 on the initial server records connections to 14 internal systems. Event 4624 Type 10 on each internal host confirms successful authentication. Event 4634 timestamps show sessions lasting 3–15 minutes each — consistent with manual reconnaissance. The final hop to the domain controller shows a 2-hour session during which Group Policy was modified to deploy ransomware. The complete chain is reconstructed from event logs alone, even after the attacker wiped their tools.
2. Insider Threat Session Analysis
An employee under investigation for data theft RDPs from their home IP to their office workstation at 23:47 on a Saturday. Security.evtx Event 4624 Type 10 records the home IP address. LocalSessionManager Event 21 confirms the session start. The session remains active for 4 hours and 12 minutes (calculated from Event 21 to Event 24). During this window, file access logs (Event 4663) on the file server show 2,300 files opened from the same user account. Event 4779 records the final disconnection at 03:59. The RDP timestamps bracket the entire data access window.
3. Credential Sharing Detection
Security Event 4624 Type 10 shows the same service account authenticating via RDP from three different source IPs within a 20-minute window. LocalSessionManager Event 39 records that each new session disconnected the previous one. This pattern proves that multiple individuals are sharing a single credential — a policy violation and a security risk. The three source IPs resolve to workstations assigned to three different employees, identifying all participants.
4. External Brute-Force Attack Analysis
Security.evtx contains 47,000 Event 4625 (Type 10) entries from 230 unique source IPs over 72 hours, all targeting the local Administrator account. The SubStatus field shows 0xC000006A (wrong password) for all attempts. On the third day, a single 4624 Type 10 succeeds from a new IP not seen in the brute-force cluster — the attacker rotated infrastructure after obtaining the correct password through credential stuffing from a separate breach dataset. The 4624 timestamp establishes the exact moment of initial access.
5. Session Hijacking via Disconnected Sessions
An administrator RDPs to a server and disconnects (Event 24) rather than logging off. The session remains active on the server. Two hours later, Event 25 records a reconnection from a completely different source IP. Security.evtx Event 4778 confirms the reconnection with the new client address. This pattern indicates session hijacking — an attacker with local administrator access on the server used tscon.exe to attach to the disconnected session without needing the original user’s credentials.
Acquisition Methods
Security.evtx and TerminalServices logs are locked by the Event Log service on a live system. Use wevtutil epl (export log) which handles the lock correctly, or collect via VSS. Never simply copy the .evtx files without using a lock-aware method — the copy may be corrupt or incomplete. On the destination host, collect all four RDP-related channels. On suspected source hosts, collect TerminalServices-RDPClient/Operational.
Live System — wevtutil Export
:: Export all four RDP-related logs from the destination host wevtutil epl Microsoft-Windows-TerminalServices-LocalSessionManager/Operational C:\Evidence\TSLocalSM.evtx wevtutil epl Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational C:\Evidence\TSRemoteCM.evtx wevtutil epl Security C:\Evidence\Security.evtx wevtutil epl System C:\Evidence\System.evtx :: Export the RDPClient log from the source host wevtutil epl Microsoft-Windows-TerminalServices-RDPClient/Operational C:\Evidence\TSRDPClient.evtx
Live System — PowerShell Targeted Export
# Export only RDP-relevant events from Security log (faster than full export) Get-WinEvent -FilterHashtable @{LogName='Security';ID=4624,4625,4634,4647,4778,4779} | Where-Object { $_.Properties[8].Value -eq 10 -or $_.Id -in @(4778,4779) } | Export-Csv C:\Evidence\RDP_Security_Events.csv -NoTypeInformation # Export LocalSessionManager events Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-TerminalServices-LocalSessionManager/Operational';ID=21,22,23,24,25,39,40} | Export-Csv C:\Evidence\RDP_LocalSM_Events.csv -NoTypeInformation
KAPE Collection
:: KAPE target for event logs collects all relevant channels kape.exe --tsource C: --tdest C:\Evidence\KAPE_Output --target EventLogs :: For targeted RDP analysis, also collect from source hosts: kape.exe --tsource C: --tdest C:\Evidence\KAPE_Source --target EventLogs,RemoteDesktopCache
Parsing Tools & Analysis
| Tool | Author | License | Output | Notes |
|---|---|---|---|---|
| EvtxECmd | Eric Zimmerman | Free | CSV/JSON | Best-in-class EVTX parser; supports custom maps for RDP event extraction |
| Hayabusa | Yamato Security | Open source | CSV/JSON | Sigma-based detection; includes RDP lateral movement rules out of the box |
| Chainsaw | WithSecure | Open source | JSON/Table | Fast Sigma rule matching against EVTX files; excellent for triage |
| python-evtx | Willi Ballenthin | Open source | XML/Python | Python library for programmatic EVTX parsing; basis for custom analysis scripts |
| LogParser | Microsoft | Free | CSV/SQL | SQL-like queries against EVTX files; useful for ad-hoc filtering |
| Event Log Explorer | FSPro Labs | Commercial | GUI + export | GUI viewer with filtering, bookmarking, and multi-file correlation |
Parsing with EvtxECmd
:: Parse all EVTX files in the evidence directory EvtxECmd.exe -d C:\Evidence\ --csv C:\Analysis\RDP_Events --csvf RDP_Timeline.csv :: Parse only the LocalSessionManager log EvtxECmd.exe -f C:\Evidence\TSLocalSM.evtx --csv C:\Analysis\ --csvf TSLocalSM_Parsed.csv
Analysis Script — RDP Session Reconstruction
# Reconstruct RDP sessions from Security.evtx parsed output import pandas as pd df = pd.read_csv('/analysis/rdp/Security_Parsed.csv') # Filter for RDP logon events (Type 10 = RemoteInteractive) logons = df[(df['EventId'] == 4624) & (df['LogonType'] == 10)].copy() logoffs = df[df['EventId'].isin([4634, 4647])].copy() # Match logon to logoff by TargetLogonId sessions = logons.merge( logoffs[['TargetLogonId', 'TimeCreated']], on='TargetLogonId', suffixes=('_start', '_end'), how='left' ) # Calculate session duration sessions['Duration'] = pd.to_datetime(sessions['TimeCreated_end']) - pd.to_datetime(sessions['TimeCreated_start']) # Display sessions sorted by start time print(sessions[['TimeCreated_start', 'TargetUserName', 'IpAddress', 'Duration', 'TargetLogonId']].sort_values('TimeCreated_start').to_string())
Sample Output — Lateral Movement Timeline
TimeCreated_start TargetUserName IpAddress Duration TargetLogonId
2026-02-14 02:17:33 svc_backup 185.220.101.42 0 days 06:42:15 0x1A3F7C2
2026-02-14 02:31:08 svc_backup 10.10.5.20 0 days 00:08:44 0x1B22A01
2026-02-14 02:40:22 svc_backup 10.10.5.20 0 days 00:12:33 0x1C18F30
2026-02-14 02:53:41 administrator 10.10.5.22 0 days 00:03:17 0x1D09E44
2026-02-14 02:57:19 administrator 10.10.5.22 0 days 02:14:08 0x1E42B10
The external IP (185.220.101.42) is the initial access point — a known Tor exit node. From there, the svc_backup account hops to internal hosts at 10.10.5.20 (two short sessions, reconnaissance) and 10.10.5.22 (account escalation). The final 2-hour session as administrator on 10.10.5.22 (the domain controller) is where the attacker deployed ransomware. Total time from initial access to domain compromise: 40 minutes.
Session Duration Reconstruction
Calculating RDP session duration requires correlating events across multiple logs because no single event records both start and end times. The most reliable method uses the TargetLogonId field, which is a unique identifier assigned to each logon session and recorded in both the 4624 (logon) and 4634/4647 (logoff) events.
| Session Phase | Start Event | End Event | Duration Calculation |
|---|---|---|---|
| Active session | 4624 (Type 10) | 4634 or 4647 | End timestamp minus start timestamp; match on TargetLogonId |
| Disconnected (not logged off) | 4624 (Type 10) | 4779 or LSM Event 24 | Disconnect timestamp minus logon timestamp; session may still be active on server |
| Reconnected session | 4778 or LSM Event 25 | 4779 or LSM Event 24 | New source IP may differ; track both original and reconnect IPs |
| No logoff recorded | 4624 (Type 10) | None | Session may still be active, or system was rebooted. Check System.evtx Event 6006 (clean shutdown) or 6008 (unexpected shutdown) as a bounding timestamp. |
A missing 4634 event does not mean the session is still active. If the system rebooted, all sessions were terminated without generating 4634 events. Check System.evtx for Event 6005 (Event Log service started) and Event 6006 (Event Log service stopped cleanly) to establish reboot boundaries. Use the reboot timestamp as the session end time when no explicit logoff is recorded.
Anti-Forensics Resilience
Event logs are a common target for attackers who want to cover their tracks. Understanding which cleanup methods affect RDP evidence — and which do not — is essential for assessing evidence integrity.
| Technique | Clears RDP Events? | Detectable? | Explanation |
|---|---|---|---|
wevtutil cl Security | Yes — clears Security.evtx | Yes — Event 1102 (Audit log cleared) is generated before the clear | Clears all events but leaves an Event 1102 record. Does not clear TerminalServices logs (must be cleared separately). |
wevtutil cl per channel | Yes — if each RDP channel is cleared individually | Yes — Event 104 (System log cleared) generated | Attacker must know all four channel names. Most attackers only clear Security.evtx and miss the TerminalServices channels. |
Mimikatz event::clear | Partial — targets Security by default | Yes — Event 1102 generated | Most Mimikatz scripts clear Security only; TerminalServices operational logs survive |
| CCleaner / BleachBit | No | N/A | Consumer cleanup tools do not target Windows event logs |
| Delete .evtx files directly | Yes — if service is stopped first | Yes — Event Log service stop (7036) recorded in System.evtx; missing files detectable | Requires stopping the Event Log service; the service stop itself is logged |
| Phantom (tool) | Yes — kills Event Log threads | Difficult — no log entry generated | Advanced tool that suspends Event Log service threads without stopping the service. Detection requires process monitoring or memory forensics. |
RDP artifacts are distributed across four or more event log channels on two different hosts (source and destination). An attacker who clears Security.evtx on the destination host still leaves TerminalServices logs intact on both the destination and source hosts. Clearing all channels on the destination still leaves the RDPClient log on the source host. Complete evidence destruction requires administrative access to every host in the lateral movement chain — a level of cleanup that most attackers do not achieve.
MITRE ATT&CK Detection Mapping
RDP event log analysis provides evidentiary support for detecting the following MITRE ATT&CK techniques:
| Technique | Name | RDP Log Evidence |
|---|---|---|
T1021.001 T1021.001 | Remote Services: Remote Desktop Protocol | Event 4624 Type 10 (successful RDP logon); Event 21 (session created); Event 1024 (outbound RDP attempt) |
T1078 T1078 | Valid Accounts | Service or admin accounts used for RDP from unexpected source IPs; same account from multiple IPs concurrently |
T1110 T1110 | Brute Force | High volume of Event 4625 Type 10 from single or distributed source IPs |
T1563.002 T1563.002 | Remote Service Session Hijacking: RDP Hijacking | Event 25 (reconnection) from different IP than original Event 21; Event 39 (session disconnected by another session) |
T1070.001 T1070.001 | Indicator Removal: Clear Windows Event Logs | Event 1102 (Security log cleared); Event 104 (System log cleared); missing TerminalServices logs |
T1133 T1133 | External Remote Services | Event 4624 Type 10 from external (non-RFC1918) IP addresses; RDP exposed to the internet |
Related Artifacts & References
Corroborating Artifacts
| Artifact | Relationship to RDP Logs | Cross-Correlation Value |
|---|---|---|
| BMC-RemoteDesktop Cache | Bitmap cache files in %LocalAppData%\Microsoft\Terminal Server Client\Cache\ | Contains thumbnail images of the remote desktop session; visual evidence of what the attacker saw |
| Default.rdp | %USERPROFILE%\Documents\Default.rdp on source host | Records the last RDP connection target and settings; persists after session ends |
| NTUSER.DAT MRU | Software\Microsoft\Terminal Server Client\Servers\ in NTUSER.DAT | Registry key listing all RDP targets the user has connected to, with username hints |
| ShimCache / AmCache | Execution of mstsc.exe (RDP client) | Confirms RDP client was executed; AmCache provides SHA1 hash and first-run timestamp |
| Prefetch | MSTSC.EXE-{hash}.pf | Run count and last-run timestamps for the RDP client executable |
| Firewall Logs | Inbound connections on TCP 3389 | Source IP and connection timestamps; available even if event logs were cleared |
References
- 13Cubed, “RDP Event Log Analysis for DFIR” — https://www.13cubed.com
- SANS Institute, “Tracking Lateral Movement with RDP Event Logs” — https://www.sans.org/blog/
- Eric Zimmerman, “EvtxECmd — EVTX Parser” — https://ericzimmerman.github.io/
- Yamato Security, “Hayabusa — Windows Event Log Analyzer” — https://github.com/Yamato-Security/hayabusa
- WithSecure, “Chainsaw — Rapid Event Log Triage” — https://github.com/WithSecureLabs/chainsaw
- Microsoft, “Remote Desktop Services Event Logs” — https://learn.microsoft.com
- JPCERT/CC, “Detecting Lateral Movement through Tracking Event Logs” — https://www.jpcert.or.jp/english/
- MITRE ATT&CK, “T1021.001 — Remote Desktop Protocol” — https://attack.mitre.org/techniques/T1021/001/
Mjolnir Security — Digital Forensics & Incident Response
Mjolnir Security provides 24/7 incident response, digital forensics, and expert witness testimony. Our DFIR team specializes in RDP lateral movement reconstruction, ransomware intrusion analysis, and credential compromise investigations.
mjolnirsecurity.com — 24/7: +1 833 403 5875