In the landscape of modern cybersecurity, Remote Desktop Protocol (RDP) remains one of the most targeted entry points for attackers. Automated bots scan the internet for exposed RDP services, attempting millions of login combinations per second. For defenders, the ability to distinguish between background noise and a genuine breach within Windows event logs is a critical skill. This guide provides a practical, authorized lab scenario designed for IT students and junior engineers. We will walk through the process of simulating an attack, analyzing specific Event IDs, mapping the attacker’s path, and implementing hardening measures.
The Lab Environment and Attack Simulation
Before diving into log analysis, we must establish a controlled environment. Do not attempt these steps on production systems without explicit authorization. This scenario assumes a Windows 10 or Windows Server 2019/2022 domain member machine with remote administration tools installed.
To simulate the attack, you need two machines:
1. The Victim: A standard Windows workstation with RDP enabled.
2. The Attacker Tool: A Kali Linux machine or a local VM running hydra or crackmapexec.
Prerequisites:
* Ensure your firewall allows traffic on port 3389 between the two machines.
* Create a non-administrative user account named labuser with a weak password (e.g., “Password123”) to simulate a low-hanging fruit target.
* Enable verbose logging in the Security log of the victim machine by setting the registry key LocalSecurityAuthority\Debug or using Group Policy to increase audit levels for logon events.
The Attack Execution:
Using a tool like Hydra, the attacker attempts to brute force the account. The command below illustrates a typical session targeting the victim’s IP address on port 3389:
hydra -l labuser -P /usr/share/wordlists/common-passwords.txt ssh://<VICTIM_IP>:3389
Note: While Hydra is often associated with SSH, it supports RDP via specific modules or can be configured to send raw TCP payloads. Alternatively, use crackmapexec which handles RDP natively.
Once the simulation completes and a successful login occurs, the attacker gains access to the system. The next phase is forensic analysis to detect this event.
Identifying Successful Login Events via Event ID 4624
The primary indicator of a successful authentication attempt in Windows is Event ID 4624. However, seeing an Event ID 4624 does not automatically mean a brute force attack occurred; it could be a legitimate admin logging in from a different location. To identify a brute force scenario, you must look for patterns.
Open the Event Viewer on the victim machine (eventvwr.msc) or use PowerShell to query the logs directly:
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4624} | Where-Object { $_.Properties[5].Value -eq 'labuser' }
Analyzing the Event Properties:
When you expand a specific 4624 event, examine the “Subject” and “Target Account Name”. In our scenario, if you see multiple entries for labuser originating from different source IP addresses (or the same IP with rapid succession), this indicates scanning.
Crucially, look at the Logon Type.
* Logon Type 10: Indicates a Remote Desktop connection.
* Logon Type 2: Indicates network credential passing (often used during lateral movement).
If you see Event ID 4624 with Logon Type 10 for labuser, but the source IP matches your known attacker tool, you have confirmed a successful RDP brute force.
Mapping the Attacker Path and Lateral Movement
A single successful login is a breach; mapping the path reveals the scope of the compromise. After gaining access via RDP, attackers often pivot to other systems. In Windows, this lateral movement frequently leaves traces in Event ID 4624 (new logins) and Event ID 4720 (creation of new objects).
Checking for New Accounts
Attackers often create backdoor accounts if they suspect their initial credentials were compromised or to maintain persistence. Query for recently created user objects:
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4720} | Select-Object TimeCreated, Message
Expected Illustrative Output:
You might see an entry showing a new user named backdoor_admin created by the SYSTEM account or the compromised labuser. This is a red flag indicating the attacker has established persistence.
Analyzing Process Creation (Event ID 4688)
To understand what the attacker did after logging in, investigate Event ID 4688. This event logs every process created on the system. Look for suspicious executables running under the context of labuser.
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4688} | Where-Object { $_.Properties[5].Value -eq 'labuser' } | Select-Object TimeCreated, Message
Common indicators include:
* cmd.exe or powershell.exe spawned with arguments like -enc (encoded commands) or downloading payloads from external IPs.
* Execution of scripts located in %TEMP% folders that were not present prior to the attack.
Hardening and Secure Configuration
Detecting an attack is only half the battle; preventing future incidents requires hardening. The following steps are essential for reducing the attack surface associated with RDP.
- Restrict RDP Access: Do not allow RDP from the internet directly. Use a Jump Host or Network Access Control List (NACL) to whitelist only specific IP ranges.
- Disable Legacy Protocols: Ensure NetBIOS is disabled over TCP/IP and SMB signing is enforced to prevent protocol-level exploits.
- Strong Password Policies: Enforce complexity requirements and account lockout thresholds in Group Policy Objects (GPO). Configure the “Account Lockout Threshold” to 5 attempts after a 15-minute window.
- Application Control: Use Windows Defender Application Control (WDAC) or AppLocker to prevent unauthorized executables from running, even if an attacker gains a shell.
Student Practice Task: The Log Detective Challenge
To solidify these concepts, students should perform the following exercise in their lab environment:
- Generate 50 failed login attempts for
labuserusing a script that sends random passwords over RDP. - Simulate one successful login.
- Create a new user named
persistence_userimmediately after the successful login. - Task: Write a PowerShell script that automatically queries the last 1000 Security events, filters for Event ID 4624 with Logon Type 10, identifies any source IPs appearing more than 5 times, and generates a CSV report listing potential brute force targets.
Common Errors and Fixes:
* Error: “Access Denied” when querying logs.
* Fix: Ensure you are running the PowerShell session as an Administrator or have delegated read access to the Security log.
* Error: Missing Event IDs in the output.
* Fix: Verify that the Windows Audit Policy for “Audit Logon” is set to “Success and Failure”. Navigate to Computer Configuration > Policies > Windows Settings > Security Settings > Local Policies > Audit Policy.
Industry Application: Incident Response Checklist
For experienced practitioners, integrating this analysis into an Incident Response (IR) workflow is vital. When a customer reports potential RDP compromise, follow this checklist:
- Isolate: Immediately disconnect the affected host from the network to prevent lateral movement.
- Preserve: Capture a memory dump and a forensic image of the hard drive before any remediation steps are taken.
- Identify: Run the log analysis queries detailed above to pinpoint the exact time of compromise and the attacker’s entry point.
- Contain: Disable the compromised user account (
labuser) and any backdoor accounts created during the session. - Eradicate: Remove malicious files identified in the Event ID 4688 analysis. Reset all passwords for local and domain accounts.
- Recover: Rebuild the system from a known good image if possible, or apply all security patches and hardening configurations before reconnecting to the network.
Conclusion
Analyzing Windows event logs is a fundamental skill for any defensive security professional. By focusing on Event ID 4624, understanding Logon Types, and investigating subsequent activities like account creation (Event ID 4720) and process execution (Event ID 4688), defenders can effectively identify successful RDP brute force attacks. This lab scenario demonstrates that while automated tools make attacks easier, thorough log analysis and proactive hardening remain the most effective defenses. Remember to always operate within authorized environments and verify specific policy terms with your organization’s security team before deploying detection rules or changing configurations.
Educational-use notice: This tutorial is for learning and controlled lab use only. Test carefully, use backups, and obtain authorization before making changes. Do not run unfamiliar commands on production systems. We accept no responsibility for misuse, damage, data loss, or production issues.

