Log Analysis and Event IDs

Analysis questions hand you a log line and ask what happened. Knowing which event ID means what, and which file to look in, is most of the work.

Windows security event IDs

Event IDWhat it means
4624Successful logon
4625Failed logon. Repeated means brute force or spraying
4634 / 4647Logoff, and user-initiated logoff
4648Logon using explicit credentials. Often lateral movement
4672Special privileges assigned. An admin logon
4688New process created. The command line is here if auditing is on
4720User account created
4726User account deleted
4728 / 4732Member added to a global or local group
4740Account locked out
4768 / 4769Kerberos TGT and service ticket requested
1102Audit log cleared. Almost always worth investigating
7045New service installed. Common persistence

Windows logon types

TypeMeaning
2Interactive. Someone at the keyboard
3Network. File share or similar
4Batch. Scheduled task
5Service
7Unlock
8Network cleartext. Credentials sent in the clear
9New credentials. RunAs with network credentials
10Remote interactive. RDP
11Cached interactive. No domain controller reachable

Linux log locations

PathWhat is in it
/var/log/auth.logAuthentication, sudo and SSH (Debian family)
/var/log/secureSame, on the Red Hat family
/var/log/syslogGeneral system messages
/var/log/messagesGeneral system messages (Red Hat family)
/var/log/kern.logKernel messages
/var/log/audit/audit.logauditd records
/var/log/faillogFailed login attempts
~/.bash_historyShell history. Often cleared by an attacker
journalctlsystemd journal, where these are unified

Investigation questions to ask of a log

QuestionWhat answers it
WhoAccount name and source IP on the logon event
WhenTimestamp, and whether it is inside working hours
From whereSource workstation and network segment
What ranProcess creation events with the command line
Did it persistNew service, scheduled task or run key
Did it spreadExplicit credential logons, remote logons on other hosts
Did they clean upAudit log cleared, history truncated, timestamps altered

Now test yourself

Memorizing a table is a start. Practice questions are what make it stick, and every answer carries the full explanation.