Splunk SPL Β· Elastic KQL/EQL Β· IBM QRadar AQL β three platforms in one place, plus a full Windows Event ID and
Sysmon reference with explanations. Click any query to copy. Custom queries saved in your browser.
Splunk SPL β Search Processing Language. Runs against Splunk indexes. Use
| stats to aggregate, | where to filter results, | timechart
for time-based views, | table to select fields. All queries use pipe-chaining.
// ADD CUSTOM SPL QUERY
Elastic KQL / EQL β KQL (Kibana Query Language) filters events with
field:value syntax in Kibana Discover and Detection Rules. EQL (Event Query Language) uses sequence
by to detect multi-step attack chains. Works with Elastic Security, SIEM rules, and Timeline.
// ADD CUSTOM ELASTIC QUERY
IBM QRadar AQL β Ariel Query Language. SQL-like syntax querying the Ariel
database. SELECT from events (log data) or flows (network). Filter with
WHERE, group with GROUP BY, limit time with LAST X
MINUTES/HOURS. Offense rules are built on top of AQL in the Rules Wizard.
// ADD CUSTOM QRADAR QUERY
Windows Event IDs + Sysmon β The most important event IDs for
investigations. Windows Security events come from Security.evtx. Sysmon events from
Microsoft-Windows-Sysmon/Operational. Always correlate multiple IDs to reconstruct the full
attack chain.
// WINDOWS SECURITY EVENT IDs
LOGON & SESSION
4624
Successful Logon
User logged on. Check LogonType: 2=Interactive, 3=Network, 7=Unlock, 10=RDP, 4=Batch,
5=Service. Type 3 with NTLM may be Pass-the-Hash.
LOW
4625
Failed Logon
Login attempt failed. High count from one IP = brute force. SubStatus:
0xC000006A=wrong password, 0xC0000064=unknown user, 0xC0000234=account locked.
HIGH
4648
Explicit Credential Logon
Logon with explicit credentials (runas / network logon with supplied creds). Common
in lateral movement when attacker uses alternate credentials to pivot.
HIGH
4672
Special Privileges Assigned
Sensitive privileges (SeDebugPrivilege, SeTcbPrivilege etc.) assigned to new session.
Correlate with 4624 to detect privileged admin logins.
HIGH
4634
Logoff
Account logged off. Pair with 4624 to calculate session duration. Useful for timeline
building and spotting very short sessions (automated tools).
LOW
4778
RDP Session Reconnected
A disconnected RDP session was reconnected. Pair with 4779 to track full RDP session
lifecycle. May indicate an attacker resuming an existing session.
MED
4779
RDP Session Disconnected
RDP session disconnected (not logged off). Attacker may disconnect instead of logoff
to leave session alive for later re-use.
MED
ACCOUNT MANAGEMENT
4720
User Account Created
New user account created. May indicate attacker backdoor account. Check who created
it and at what time. Common in post-exploitation persistence.
HIGH
4722
Account Enabled
Disabled account was re-enabled. Attackers re-enable dormant accounts to avoid alerts
triggered by new account creation.
HIGH
4724
Password Reset Attempt
An attempt to reset an account password. Combined with 4672 may indicate privilege
escalation or admin-level account takeover.
HIGH
4726
Account Deleted
User account deleted. May indicate an attacker removing a backdoor account after
completing their objective (covering tracks).
HIGH
4728
Added to Global Group
Member added to a security-enabled global group. If that group is Domain Admins β
this is critical privilege escalation via group membership.
CRIT
4732
Added to Local Group
Member added to a local security group. Adding any user to the Administrators group
is a major privilege escalation indicator. Alert immediately.
CRIT
4740
Account Locked Out
Account was locked out after repeated failures. Multiple lockouts across accounts
from one source = password spray. Multiple from many sources = distributed attack.
HIGH
PROCESS & POWERSHELL
4688
Process Created
New process created. Requires "Audit Process Creation" GPO + command line auditing.
Check NewProcessName, CommandLine, and ParentProcessName for suspicious chains.
MED
4689
Process Terminated
Process ended. Correlate with 4688 to measure runtime. Very short-lived processes
running commands (loaders, stagers) are highly suspicious.
LOW
4103
PowerShell Module Logging
Logs individual PowerShell pipeline execution. Records every command even in
interactive sessions. Requires Module Logging Group Policy. Good for catching PS abuse without script
blocks.
HIGH
4104
PowerShell Script Block Logging
Captures full PowerShell script content as it executes, AFTER deobfuscation by the PS
engine. Best event to catch encoded/obfuscated payloads. Requires Script Block Logging GPO.
CRIT
PERSISTENCE & OBJECT ACCESS
4697
Service Installed
New service installed on the system. Malware uses services for persistence. Check
ServiceFileName β suspicious paths include Temp, AppData, or randomly named binaries.
CRIT
4698
Scheduled Task Created
New scheduled task created. Heavily abused for persistence and lateral execution.
Inspect TaskContent for encoded commands, suspicious executables, or unusual user contexts.
CRIT
4702
Scheduled Task Updated
Existing task modified. Attackers modify legitimate existing tasks instead of
creating new ones to stay under the radar of new-task creation alerts.
HIGH
4657
Registry Value Modified
Registry value was changed. Requires Object Access auditing. Monitor Run/RunOnce keys
for persistence changes. Also watch SAM, LSA Secrets, and AppInit_DLLs.
HIGH
4663
Object Access Attempt
Attempt to access an audited object (file, key, etc.). Use to detect access to SAM
hive, NTDS.dit, lsass memory dumps, or sensitive documents.
HIGH
4703
Token Rights Adjusted
User right adjusted on a token. Indicates token manipulation/impersonation β
technique used to steal or elevate privileges without creating a new visible logon session.
HIGH
// SYSMON EVENT IDs (Microsoft Sysinternals)
PROCESS EXECUTION
ID 1
Process Create
Richer than 4688. Includes full CommandLine, MD5/SHA256 hash, ParentImage,
ParentCommandLine, and ProcessGUID. Primary source for detecting malicious execution chains like Office
β PowerShell or Explorer β mshta.
HIGH
ID 5
Process Terminated
Process exited. Correlate with ID 1 using ProcessGUID to calculate runtime.
Short-lived processes executing commands (stagers, loaders) indicate automation.
LOW
ID 10
Process Access
Process opened another process. Critical for catching credential dumpers β Mimikatz
opens lsass.exe with GrantedAccess 0x1010 or 0x1fffff. Alert on any non-system process accessing
lsass.exe.
CRIT
ID 25
Process Tampering
Process hollowing or process herpaderping detected β malicious image replaces a
legitimate process in memory. Indicates advanced loader technique used by sophisticated malware.
CRIT
NETWORK & DNS
ID 3
Network Connection
Process made a network connection. Logs SourceIP, DestIP, DestPort, Protocol, and
initiating process name+hash. Best event for catching C2 beaconing β suspicious when Office/Notepad
makes outbound connections.
HIGH
ID 22
DNS Query
DNS query made by a process. Logs the process name, query, and resolved IP. Use to
detect DGA domains, DNS tunneling (long query strings), or C2 beaconing to suspicious TLDs like .xyz .tk
.pw.
HIGH
FILE & REGISTRY
ID 2
File Creation Time Changed
Timestomping detected β file's creation timestamp was modified. Attackers do this to
make malicious files look like old legitimate system files, evading timeline-based analysis.
CRIT
ID 11
File Created
New file written to disk. Alert on .exe/.ps1/.bat/.vbs dropped in Temp, AppData, or
Downloads especially by Office or browser processes β this is the dropper writing its payload.
HIGH
ID 12
Registry Object Added/Deleted
Registry key or value created/deleted. Monitor persistence paths: Run, RunOnce,
Services, Winlogon, AppInit_DLLs. Deletion may indicate post-exploitation cleanup.
HIGH
ID 13
Registry Value Set
Registry value was written. Primary event for detecting RunKey persistence, COM
hijacking, AppInit_DLLs abuse, and DebuggerValue injection. Always correlate with the writing process.
CRIT
ID 23
File Deleted (Archived)
File was deleted (Sysmon can archive copies). Attackers delete tools, scripts, and
droppers after use. This catches that cleanup activity, especially in the minutes after execution
completes.
HIGH
INJECTION & LOADING
ID 7
Image Loaded
DLL loaded into a process. Detect DLL injection and DLL hijacking. Alert on unsigned
DLLs loaded by system processes, or DLLs loaded from user-writable paths like Temp or AppData.
HIGH
ID 8
CreateRemoteThread
Process created a thread in another process β the primary mechanism for classic DLL
injection and shellcode injection. Non-system process injecting into lsass, svchost, or explorer is
critical.
CRIT
ID 9
RawAccessRead
Process read disk using raw I/O, bypassing the file system. Used by credential
dumpers to read SAM hive or NTDS.dit directly, and by some evasion tools to read locked files.
CRIT
ID 17
Pipe Created
Named pipe created. Cobalt Strike uses pipes for C2 communication (e.g.
\\.\pipe\msagent_*). Metasploit uses meterpreter pipes. Alert on pipes with random-looking or unusual
names.
CRIT
ID 18
Pipe Connected
Process connected to a named pipe. PsExec uses \\pipe\PSEXECSVC. Lateral movement via
SMB named pipes shows as ID 18 followed by ID 3 to the remote host.
CRIT
WMI & DRIVERS
ID 6
Driver Loaded
Kernel driver loaded into the system. Rootkits and kernel exploits load drivers for
ring-0 access. Alert on unsigned drivers or drivers loaded from user-writable paths.
CRIT
ID 19
WMI Event Filter
WMI event filter registered β defines the TRIGGER for WMI persistence (e.g. on logon,
on process start). Part 1 of the WMI subscription trio (19β20β21).
CRIT
ID 20
WMI Event Consumer
WMI consumer registered β defines WHAT TO RUN when the filter triggers (typically
executes a command or script). Part 2 of WMI subscription trio.
CRIT
ID 21
WMI Consumer Bound
Consumer bound to filter β persistence is now fully installed. Alert on any new WMI
subscription. Legitimate software almost never uses WMI subscriptions this way.
CRIT
INVESTIGATION CHAINS
LSASS DUMP
Credential Dumping Chain
ID 10 (lsass access, GrantedAccess 0x1fffff) β ID 11 (file with .dmp extension
created in Temp) β ID 7 (suspicious DLL loaded in lsass). Three events together = credential dump in
progress.
CRIT
MACROβEXEC
Office Macro Execution
ID 1 (ParentImage=winword.exe/excel.exe,
NewProcess=powershell.exe/cmd.exe/wscript.exe) β ID 3 or ID 22 (outbound network connection or DNS
query). Classic malicious document execution flow.
CRIT
HOLLOW
Process Hollowing
ID 1 (process created, usually a legitimate binary like svchost) β ID 8
(CreateRemoteThread into that process) β ID 25 (process tampering). Parent is typically a dropper or
loader binary.
CRIT
PERSIST
Registry Persistence Install
ID 11 (payload file dropped to disk) β ID 13 (Run key written pointing to that file)
β ID 1 (process spawned from that Run key on next logon). Full persistence chain in 3 Sysmon events.
CRIT
C2 BEACON
C2 Beaconing Pattern
ID 22 (periodic DNS queries to same domain at regular intervals) + ID 3 (outbound
connection to resolved IP on non-standard port). Regular interval = automated beacon. Check process name
β should NOT be a browser or OS process.