Timeline Analysis & Log Forensics
A super timeline correlates timestamps from dozens of artifact types into a single chronological view — turning scattered evidence into a clear narrative of attacker activity.
Timeline Analysis Methodology
log2timeline.py --parsers all plaso.dump image.ddpsort.py -o l2tcsv plaso.dump "date > '2025-03-01' AND date < '2025-03-07'"Super Timeline — Plaso & log2timeline
The super timeline aggregates timestamps from hundreds of artifact types into a single chronological view. Plaso is the parsing engine; log2timeline is the command-line interface; psort filters and formats output.
log2timeline.py --parsers win_evtx,mft,prefetch plaso.dump /mnt/
| Artifact | What It Contributes to the Timeline | Key Forensic Use |
|---|---|---|
| $MFT — $SI timestamps | Modified, Accessed, Changed, Created for every file (user-visible) | File system activity; timestomping target (can be backdated) |
| $MFT — $FN timestamps | Kernel-set creation, modification timestamps | Compare to $SI — discrepancy reveals timestomping |
| $USNJrnl | Sequence-numbered record of every file operation: create, write, rename, delete, security change | Proves files existed even after deletion; file operation sequencing |
| $I30 (Directory Index) | B-Tree entries for files in each directory | Slack space may reveal deleted files that aren't in $MFT unallocated entries |
| Timestomping in Timeline | $SI Created timestamp predates $FN Created timestamp for the same file | Definitive anti-forensics indicator — $FN is harder to fake |
Sysmon & Windows Event Log Correlation
Sysmon (System Monitor) dramatically enriches Windows logging — adding process hashes, command lines, network connections, and injection detection that standard event logs miss.
Sysmon Event IDs — Complete Reference
RDP Forensics — Multiple Log Sources
- 4624 Logon Type 10 — Remote Interactive (RDP logon success)
- 4634/4647 Logoff — session end
- 4648 Explicit credentials — pass-the-hash / runas via RDP
- 4778/4779 Session reconnected / disconnected
- Event 21 Session logon succeeded — user + session ID + source IP
- Event 22 Shell start notification — desktop loaded
- Event 23 Session logoff succeeded
- Event 24 Session disconnected — RDP disconnect without logoff
- Event 25 Session reconnected — resuming a disconnected session
- Event 1149 User authentication succeeded — logged BEFORE full logon; no credentials required to generate this event; records source IP
- Event 261 Listener received a connection
- Event 1024 RDP client connecting to server — logged on the SOURCE machine (who connected outbound)
- Event 1102 Connection error / failure
- These events show which systems THIS machine connected TO via RDP
- Prefetch: mstsc.exe — RDP client execution evidence
- Registry:
HKCU\Software\Microsoft\Terminal Server Client\Servers— servers connected to - Registry:
HKCU\...\Default— last RDP server username - Jump Lists: mstsc.exe AppID — recently connected servers
- Bitmap cache:
%APPDATA%\Microsoft\Terminal Server Client\Cache\
- 1. RemoteConnectionManager Event 1149 — connection attempt recorded
- 2. Security Event 4624 (Type 10) — full authentication
- 3. LocalSessionManager Event 21 — session created
- 4. LocalSessionManager Event 24 — disconnect (not logoff)
- 5. LocalSessionManager Event 25 — reconnect to existing session
| Scenario | Event Sequence | What It Proves |
|---|---|---|
| Brute force → success | 4625 × N → 4624 same account/source | Attacker guessed password after multiple failures |
| Pass-the-Hash | 4624 Type 3 + Logon Process = NtLmSsp + No MFA event | NTLM hash used directly, no password; lateral movement |
| Credential theft | 4688 (procdump/taskmgr) + Sysmon 10 (lsass access) + 4656 (handle to lsass) | Attacker dumped LSASS memory for credentials |
| Lateral movement via PsExec | 4648 (explicit creds) → 4624 Type 3 on target → 7045 (PSEXESVC service) on target | PsExec execution path; target system shows new service |
| Scheduled task persistence | 4698 (task created) → 4702 (task updated) → 4688 matching task binary at scheduled time | Persistence via scheduled task; execution confirmed by process event |
| Log clearing | 1102 (Security log cleared) + 104 (System log cleared) | Attacker covering tracks; check for adjacent artifacts in other logs |
| Account creation for persistence | 4720 (account created) → 4728/4732 (added to group) → 4624 (new account logon) | Attacker created backdoor account; group addition reveals privilege level |
Web Server & Linux Log Forensics
Web server logs record every HTTP request — revealing exploit attempts, web shell usage, and data exfiltration. Linux logs provide authentication, process, and system activity evidence when Windows artifacts are absent.
IIS W3C Log Format — Field Reference
| Attack Type | Log Signature | Key Indicators |
|---|---|---|
| Web Shell Upload | POST /uploads/shell.aspx HTTP/1.1 200 | POST + 200 to unusual path; subsequent GET with cmd parameter |
| Web Shell Execution | GET /images/a.php?cmd=whoami 200 | GET to uploaded file + cmd/exec/pass in query string; small sc-bytes (cmd output) |
| SQL Injection | GET /search?id=1'+OR+'1'='1 500 | SQL keywords in uri-query; mix of 200/500 responses (probing); sqlmap user-agent |
| Directory Traversal | GET /../../../etc/passwd 200 or 404 | ../ sequences in uri-stem; URL-encoded variations (%2e%2e%2f) |
| Brute Force / Scanning | High rate of 404/401 from single IP | Burst of requests to same path; sequential paths (/admin, /login, /wp-admin); uniform User-Agent |
| Data Exfiltration | Large sc-bytes on unusual path GET requests | High sc-bytes to attacker IP; repeated requests to same resource; off-hours activity |
Linux Log Forensics
(Debian/Ubuntu)
/var/log/secure
(RHEL/CentOS)
last command. Shows username, terminal, source IP (for SSH), login and logout times, and duration. Survives log rotation.lastb. A burst of entries from one IP = brute force. Missing or empty btmp may indicate log clearing. Complement to wtmp for full authentication picture.lastlog. Useful for identifying dormant accounts that suddenly logged in — backdoor accounts or compromised service accounts./var/spool/cron/
| Persistence Method | Location / Log Evidence | Detection |
|---|---|---|
| Cron job | /var/spool/cron/, /etc/cron.*, /etc/crontab | Check for unusual commands, URLs (wget/curl), base64-encoded payloads |
| SSH authorized_keys | ~/.ssh/authorized_keys | Attacker adds their public key for passwordless SSH; check modification timestamp vs account creation |
| Systemd service | /etc/systemd/system/*.service; journalctl -u servicename | New .service file with ExecStart pointing to malicious binary |
| LD_PRELOAD hijack | /etc/ld.so.preload; LD_PRELOAD env var | Malicious shared library loaded before all others — can hide processes, files, network connections |
| SUID binary | find / -perm -u=s -type f | New SUID binaries or modified existing ones grant root shell without sudo |
| ~/.bashrc / ~/.profile | User shell initialization files | Persistent commands executed on every login; reverse shell payloads, alias hiding commands |
Practice Quiz
Ten GCFA-style questions on timeline analysis and log forensics. Select your answers and submit to see your score.
Review the explanations above for any questions you missed.
Memory Hooks
Mnemonics and high-yield patterns for GCFA timeline and log forensics questions.
last). btmp = failed logins binary log (read with lastb). btmp empty or missing = attacker may have cleared it. lastlog = most recent login per user.| Concept | Key Fact | Exam Tip |
|---|---|---|
| log2timeline | Creates .plaso file from disk image or directory; parses 100s of artifact types in one pass | psort filters it; Timeline Explorer analyzes it |
| Sysmon Event 2 | File creation time changed — only Sysmon event that directly catches timestomping | Records original + new timestamp + responsible process |
| Sysmon Event 10 | ProcessAccess to lsass.exe = credential theft indicator | Mimikatz, ProcDump, Task Manager all generate this |
| Sysmon Event 8 | CreateRemoteThread = injection indicator | DLL injection, thread hijacking core API step |
| RDP Event 1149 | Pre-auth RDP connection record; logged even without full logon; has source IP | In RemoteConnectionManager log, not Security |
| RDP Event 21/24/25 | LocalSessionManager: 21=logon, 24=disconnect, 25=reconnect | Distinguish disconnect (24) from logoff (23) |
| IIS POST+200 | POST to unusual path + 200 = web shell upload success | Follow with GET + cmd= query for execution confirmation |
| SI < FN timestamp | $SI Created earlier than $FN Created = timestomping | $USNJrnl first entry corroborates true creation time |
| auth.log vs wtmp | auth.log = text, SSH+sudo details; wtmp = binary login sessions (last command) | btmp = failed logins (lastb command) |
| Plaso anchor event | Find one confirmed malicious event → expand outward chronologically | Filter by directory, username, or process to reduce noise |
Ready for More Practice?
Test yourself with full-length GCFA practice exams on FlashGenius.
Unlock Full Practice Tests on FlashGenius →Flashcards
Click any card to flip it and reveal the answer.
What are the three main tools in the Plaso timeline workflow and what does each do?
log2timeline.py: parses disk image / directory → creates .plaso storage file (run once). psort.py: reads .plaso file, applies date/keyword filters, outputs l2tcsv / JSON (run many times). Timeline Explorer (Eric Zimmermann): GUI tool to load CSV for interactive search, filtering, and bookmarking of the final timeline.
What do Sysmon Events 1, 2, 8, 10, and 22 each record?
Event 1: Process created — full command line, parent, hashes (MD5/SHA256/IMPHASH). Event 2: File creation time changed — timestomping detection. Event 8: CreateRemoteThread — process injection indicator. Event 10: ProcessAccess — handle to another process; lsass as target = credential theft. Event 22: DNS query — process + queried hostname.
Name the four RDP log sources and the key Event IDs in each.
Security.evtx: 4624 Type 10 (RDP logon), 4634 (logoff). LocalSessionManager: 21 (logon), 23 (logoff), 24 (disconnect), 25 (reconnect). RemoteConnectionManager: 1149 (pre-auth, source IP, even without full logon). RDPClient/Operational: 1024 (outbound RDP connection from THIS machine to another server).
How do you detect timestomping in a timeline, and what three sources confirm the true creation time?
Detection rule: $SI Created < $FN Created → timestomping (attacker backdated SI via SetFileTime; FN is kernel-set and harder to change). Three sources for true creation time: (1) $FN timestamp, (2) $USNJrnl — first entry for the file (CREATE record), (3) Sysmon Event 2 — logs original timestamp before the change was made.
What IIS W3C log pattern indicates a web shell upload followed by execution?
Upload: cs-method=POST, cs-uri-stem=/unusual/path/shell.aspx, sc-status=200. Execution: cs-method=GET, same uri-stem, cs-uri-query=cmd=whoami (or similar), sc-status=200. Key fields: c-ip (attacker), cs(User-Agent) (tool fingerprint), sc-bytes (small for command output), cs-bytes (large for upload). Also check for non-standard user-agent strings (curl, python-requests).
What are the differences between auth.log, wtmp, btmp, and lastlog?
auth.log (/var/log/secure on RHEL): text log of SSH success/fail + sudo commands — most detail. wtmp: binary login session record — read with 'last'; records logon/logoff/reboot. btmp: binary failed login record — read with 'lastb'; brute force detection. lastlog: most recent login only per user — read with 'lastlog'; useful for spotting dormant accounts that suddenly logged in.
For lateral movement via PsExec, what event sequence appears across source and target systems?
Source system: Event 4648 (logon with explicit credentials — the stolen account used). Network: SMB connection on port 445. Target system: Event 4624 Type 3 (network logon from source IP), Event 7045 (new service installed: PSEXESVC), Event 4688 (cmd.exe / payload launched under PSEXESVC parent). Also: PsExec Prefetch on source, PSEXESVC Prefetch on target.
What are the 7 steps of the timeline analysis methodology?
1) Define incident timeframe (approximate window). 2) Acquire all artifacts (disk, memory, logs). 3) Create super timeline with log2timeline. 4) Filter to incident window with psort. 5) Identify anchor events (confirmed malicious activity). 6) Expand and correlate around anchors. 7) Reconstruct and document — every claim must have a timestamped artifact source. Corroborate across two or more independent artifact types.
Study Advisor
Choose a category for targeted guidance.
Exam Strategy — Timeline & Log Forensics
- Sysmon Event 2 is unique: No other standard Windows log records timestomping. If a GCFA question asks how to detect file time manipulation in logs, the answer is Sysmon Event 2 (FileCreateTimeChanged).
- RDP Evidence 1149 is pre-auth: Unlike 4624, Event 1149 appears in the RemoteConnectionManager log and is generated even before full authentication completes. Questions about early-stage RDP evidence or RDP from an IP with no corresponding Security log entry often hinge on this event.
- Know your Plaso tool roles: log2timeline creates, psort filters, Timeline Explorer analyzes. Questions may describe a step and ask which tool. The .plaso file is the bridge between creation and filtering.
- IIS log field abbreviations: cs- = client-to-server (what the client sent), sc- = server-to-client (what the server returned), c- = client attribute, s- = server attribute. Knowing this decodes any W3C field name instantly.
- Timestomping SI vs FN: The rule is always the same — SI earlier than FN is suspicious; $USNJrnl and Sysmon 2 provide the true creation time. This appears in multiple GCFA question formats.
Common Mistakes — Timeline & Log Forensics
- Confusing psort and log2timeline roles: log2timeline creates the .plaso file (parsing); psort only reads and filters it (output). You cannot use psort against a raw disk image. Run log2timeline first.
- Missing RDP Event 1149 location: Event 1149 is in the TerminalServices-RemoteConnectionManager log, NOT Security.evtx. Many analysts only check Security and miss pre-auth connection evidence.
- Confusing RDP disconnect (24) and logoff (23): Event 24 = session disconnected (session preserved, user can reconnect with Event 25). Event 23 = session fully terminated. Attackers often disconnect without logging off to preserve their session.
- Assuming SI > FN is always legitimate: While SI < FN is definitely suspicious, SI = FN is normal. The key test is SI EARLIER than FN, which is physically impossible in a clean system (FN is set first during file creation).
- Ignoring cs-uri-query in IIS logs: Web shell execution evidence is in cs-uri-query, not just cs-uri-stem. A GET to shell.aspx without a query string is just a request. GET to shell.aspx?cmd=whoami is execution evidence. Always parse both fields.
- Treating bash_history as reliable: Attackers commonly clear bash history (HISTSIZE=0, unset HISTFILE, rm .bash_history). The absence of history should be noted as suspicious itself. Check /proc/PID/fd for in-memory history on live systems.
Quick Review — Timeline & Log Forensics
- log2timeline.py: Create .plaso storage file from disk image
- psort.py: Filter .plaso by date/keyword → CSV/JSON
- Timeline Explorer: GUI analysis of psort CSV output
- Sysmon 1: Process create + hash + cmdline + parent
- Sysmon 2: File time changed = timestomping detection
- Sysmon 8: CreateRemoteThread = injection indicator
- Sysmon 10: ProcessAccess to lsass = credential theft
- Sysmon 22: DNS query with process attribution
- RDP 1149: Pre-auth connection record with source IP (RemoteConnectionManager)
- RDP 21/24/25: Logon / disconnect / reconnect (LocalSessionManager)
- IIS POST+200: Web shell upload success
- IIS GET+cmd+200: Web shell execution confirmation
- SI < FN: Timestomping; USNJrnl + Sysmon 2 = true creation time
- auth.log: SSH + sudo text log (primary Linux auth source)
- wtmp / btmp: Binary login / failed login (last / lastb commands)
Deep Dive — Advanced Timeline Concepts
- IMPHASH in Sysmon Event 1: Import Hash — computed from the DLL import table of a PE file. Unlike file hash, IMPHASH is similar across malware families that use the same framework (e.g., all Metasploit payloads have related IMPHASHes). Useful for clustering related malware samples even when the file content differs.
- Plaso bodyfile format and mactime: An alternative to l2tcsv; Plaso can output MACB bodyfile format readable by mactime (from The Sleuth Kit). This enables timeline generation at the command line without Timeline Explorer. Format: MD5|name|inode|mode_as_string|UID|GID|size|atime|mtime|ctime|crtime.
- $USNJrnl reason codes in timeline: Each USN record has a Reason field: FILE_CREATE, DATA_EXTEND, DATA_TRUNCATION, FILE_DELETE, RENAME_OLD_NAME, RENAME_NEW_NAME, SECURITY_CHANGE, CLOSE. Combining reason codes reveals full file lifecycle — create → write → close → delete — even after the file is gone.
- Sysmon Event 25 (Process Tampering): Added in Sysmon v13, Event 25 fires when a process image changes at runtime — this is specifically designed to detect process hollowing and doppelgänging, which were difficult to catch with earlier Sysmon versions. It records the process, image path, and type of tampering detected.
- Named pipe forensics (Sysmon 17/18): Cobalt Strike's default communication uses named pipes (\\.\pipe\MSSE-[hex]-server). Sysmon 17/18 records pipe creation and connection with the process name. Matching known C2 framework pipe name patterns is a high-fidelity detection method that appears in advanced GCFA scenarios.
- Log correlation across systems: For lateral movement detection, timestamps on the source and target systems must be correlated. Time skew between systems (even seconds) can cause apparent timeline inconsistencies. Always normalize to UTC and check NTP sync status (System event 37 = time sync, 36 = error) before drawing conclusions from cross-system event ordering.
Practice Tips — Timeline & Log Forensics
- Build Plaso from scratch: Install Plaso in a VM, grab a sample forensic image (from DFIR.training or CFReDS), and run the full workflow: log2timeline → psort → Timeline Explorer. Seeing real output internalizes the tool roles far better than reading.
- Sysmon event ID drill: Write Event ID numbers on one side of cards; event name and forensic significance on the other. Drill until you can go from number → meaning and meaning → number for the top 12 events. This is tested directly.
- RDP log sequence practice: Draw the timeline of a complete RDP session (1149 → 4624 → 21 → 24 → 25 → 23 → 4634) and know which log each event appears in. GCFA scenarios often present partial sequences and ask you to identify the gap.
- IIS log analysis with grep/Python: Practice parsing IIS logs with simple grep or Python pandas to find POST+200 patterns, identify unique client IPs, and extract all requests to specific paths. Speed matters under exam conditions.
- DFIR.training CTF challenges: Several free CTF challenges at DFIR.training are timeline-focused and use real Plaso/log2timeline output. Completing these builds the pattern recognition needed for GCFA scenario questions.
- Linux log practice on a VM: Set up a Linux VM with auditd and Syslog, then run an SSH brute force against it from another VM. Analyze auth.log, wtmp, and btmp to see exactly what each records. Understanding the difference from actual log output is more durable than memorizing from text.