Forensic ArtifactWindows: Eventlog

RDP Event Logs

RDP session logs record remote desktop connections including source IP, username, session duration, and disconnection events across multiple event log channels.

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.

Key Insight

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 ChannelFile PathRecorded On
TerminalServices-LocalSessionManager/Operational%SystemRoot%\System32\winevt\Logs\Microsoft-Windows-TerminalServices-LocalSessionManager%4Operational.evtxDestination host
TerminalServices-RemoteConnectionManager/Operational%SystemRoot%\System32\winevt\Logs\Microsoft-Windows-TerminalServices-RemoteConnectionManager%4Operational.evtxDestination host
TerminalServices-RDPClient/Operational%SystemRoot%\System32\winevt\Logs\Microsoft-Windows-TerminalServices-RDPClient%4Operational.evtxSource host
Security.evtx%SystemRoot%\System32\winevt\Logs\Security.evtxDestination 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.

Retention Warning

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 IDDescriptionKey FieldsForensic Value
21Session logon succeededUser, SessionID, Source Network AddressConfirms successful RDP logon with source IP
22Shell start notification receivedUser, SessionID, Source Network AddressDesktop shell loaded; user can interact
23Session logoff succeededUser, SessionIDClean session termination
24Session has been disconnectedUser, SessionID, Source Network AddressSession disconnected but not logged off (may reconnect)
25Session reconnection succeededUser, SessionID, Source Network AddressReconnection to a previously disconnected session; source IP may differ
39Session disconnected by another sessionUser, SessionID, Source SessionIDOne user kicked another off; possible credential sharing
40Session disconnected, reason codeUser, SessionID, ReasonReason code reveals whether disconnect was user-initiated, network failure, or admin action

Destination Host — TerminalServices-RemoteConnectionManager/Operational

Event IDDescriptionKey FieldsForensic Value
261Listener received a connectionNone (pre-authentication)Connection attempt detected before authentication; correlate timestamp with 4625 failures
1149User authentication succeededUser, Domain, Source Network AddressNLA (Network Level Authentication) succeeded; source IP available even if session setup fails

Source Host — TerminalServices-RDPClient/Operational

Event IDDescriptionKey FieldsForensic Value
1024RDP ClientActiveX is trying to connectValue (target hostname or IP)Records the destination the user attempted to RDP into; critical for mapping lateral movement from the source side
1025RDP ClientActiveX connectedValue (target hostname or IP)Confirms successful outbound connection
1026RDP ClientActiveX disconnectedDisconnect ReasonRecords why the outbound session ended
1027Connected to domainDomain nameRecords the domain of the target system

Destination Host — Security.evtx

Event IDDescriptionKey FieldsForensic Value
4624Successful logon (Type 10 = RemoteInteractive)TargetUserName, TargetDomainName, IpAddress, IpPort, LogonProcessName, AuthenticationPackageNameDefinitive proof of RDP logon with source IP; Logon Type 10 is exclusively RDP
4625Failed logon (Type 10)TargetUserName, IpAddress, Status, SubStatusFailed RDP authentication attempts; brute-force or credential-guessing detection
4634Account was logged offTargetUserName, TargetLogonIdSession end; correlate LogonId with 4624 for duration calculation
4647User initiated logoffTargetUserName, TargetLogonIdDistinguishes user-initiated logoff from session timeout
4778Session reconnected (window station)AccountName, SessionName, ClientName, ClientAddressRDP session reconnection with client hostname and IP
4779Session disconnected (window station)AccountName, SessionName, ClientName, ClientAddressRDP session disconnection (user closed window without logging off)
Logon Type Reference

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:

Lateral Movement Chain Reconstruction

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

Collection Warning

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

CMD / ADMIN
:: 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

POWERSHELL / ADMIN
# 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

CMD / ADMIN
:: 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

ToolAuthorLicenseOutputNotes
EvtxECmdEric ZimmermanFreeCSV/JSONBest-in-class EVTX parser; supports custom maps for RDP event extraction
HayabusaYamato SecurityOpen sourceCSV/JSONSigma-based detection; includes RDP lateral movement rules out of the box
ChainsawWithSecureOpen sourceJSON/TableFast Sigma rule matching against EVTX files; excellent for triage
python-evtxWilli BallenthinOpen sourceXML/PythonPython library for programmatic EVTX parsing; basis for custom analysis scripts
LogParserMicrosoftFreeCSV/SQLSQL-like queries against EVTX files; useful for ad-hoc filtering
Event Log ExplorerFSPro LabsCommercialGUI + exportGUI viewer with filtering, bookmarking, and multi-file correlation

Parsing with EvtxECmd

CMD / FORENSICS
:: 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

PYTHON / RDP ANALYSIS
# 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

OUTPUT
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
Reading the Output

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 PhaseStart EventEnd EventDuration Calculation
Active session4624 (Type 10)4634 or 4647End timestamp minus start timestamp; match on TargetLogonId
Disconnected (not logged off)4624 (Type 10)4779 or LSM Event 24Disconnect timestamp minus logon timestamp; session may still be active on server
Reconnected session4778 or LSM Event 254779 or LSM Event 24New source IP may differ; track both original and reconnect IPs
No logoff recorded4624 (Type 10)NoneSession may still be active, or system was rebooted. Check System.evtx Event 6006 (clean shutdown) or 6008 (unexpected shutdown) as a bounding timestamp.
Duration Gotcha

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.

TechniqueClears RDP Events?Detectable?Explanation
wevtutil cl SecurityYes — clears Security.evtxYes — Event 1102 (Audit log cleared) is generated before the clearClears all events but leaves an Event 1102 record. Does not clear TerminalServices logs (must be cleared separately).
wevtutil cl per channelYes — if each RDP channel is cleared individuallyYes — Event 104 (System log cleared) generatedAttacker must know all four channel names. Most attackers only clear Security.evtx and miss the TerminalServices channels.
Mimikatz event::clearPartial — targets Security by defaultYes — Event 1102 generatedMost Mimikatz scripts clear Security only; TerminalServices operational logs survive
CCleaner / BleachBitNoN/AConsumer cleanup tools do not target Windows event logs
Delete .evtx files directlyYes — if service is stopped firstYes — Event Log service stop (7036) recorded in System.evtx; missing files detectableRequires stopping the Event Log service; the service stop itself is logged
Phantom (tool)Yes — kills Event Log threadsDifficult — no log entry generatedAdvanced tool that suspends Event Log service threads without stopping the service. Detection requires process monitoring or memory forensics.
Why RDP Evidence Often Survives

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:

TechniqueNameRDP Log Evidence
T1021.001 T1021.001Remote Services: Remote Desktop ProtocolEvent 4624 Type 10 (successful RDP logon); Event 21 (session created); Event 1024 (outbound RDP attempt)
T1078 T1078Valid AccountsService or admin accounts used for RDP from unexpected source IPs; same account from multiple IPs concurrently
T1110 T1110Brute ForceHigh volume of Event 4625 Type 10 from single or distributed source IPs
T1563.002 T1563.002Remote Service Session Hijacking: RDP HijackingEvent 25 (reconnection) from different IP than original Event 21; Event 39 (session disconnected by another session)
T1070.001 T1070.001Indicator Removal: Clear Windows Event LogsEvent 1102 (Security log cleared); Event 104 (System log cleared); missing TerminalServices logs
T1133 T1133External Remote ServicesEvent 4624 Type 10 from external (non-RFC1918) IP addresses; RDP exposed to the internet

Related Artifacts & References

Corroborating Artifacts

ArtifactRelationship to RDP LogsCross-Correlation Value
BMC-RemoteDesktop CacheBitmap 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 hostRecords the last RDP connection target and settings; persists after session ends
NTUSER.DAT MRUSoftware\Microsoft\Terminal Server Client\Servers\ in NTUSER.DATRegistry key listing all RDP targets the user has connected to, with username hints
ShimCache / AmCacheExecution of mstsc.exe (RDP client)Confirms RDP client was executed; AmCache provides SHA1 hash and first-run timestamp
PrefetchMSTSC.EXE-{hash}.pfRun count and last-run timestamps for the RDP client executable
Firewall LogsInbound connections on TCP 3389Source IP and connection timestamps; available even if event logs were cleared

References

  1. 13Cubed, “RDP Event Log Analysis for DFIR” — https://www.13cubed.com
  2. SANS Institute, “Tracking Lateral Movement with RDP Event Logs” — https://www.sans.org/blog/
  3. Eric Zimmerman, “EvtxECmd — EVTX Parser” — https://ericzimmerman.github.io/
  4. Yamato Security, “Hayabusa — Windows Event Log Analyzer” — https://github.com/Yamato-Security/hayabusa
  5. WithSecure, “Chainsaw — Rapid Event Log Triage” — https://github.com/WithSecureLabs/chainsaw
  6. Microsoft, “Remote Desktop Services Event Logs” — https://learn.microsoft.com
  7. JPCERT/CC, “Detecting Lateral Movement through Tracking Event Logs” — https://www.jpcert.or.jp/english/
  8. 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.

Digital ForensicsIncident ResponseExpert WitnessArtifact AnalysisLateral MovementRansomware

mjolnirsecurity.com — 24/7: +1 833 403 5875