This week, we focus on logs as evidence: where they come from, where Windows and Linux store them, how to collect them centrally, and which tools help investigators aggregate, correlate, and analyse them.
Log Sources
Evidence can come from many different log sources:
- Operating System Logs: Windows Event Logs and Linux syslog.
- Application Logs: SMTP (mail) logs and server logs.
- Physical Device Logs: Camera logs and UPS logs.
- Network Equipment Logs: Logs from routers, switches, firewalls, and other network devices.
Operating System Logs
Operating system logs are stored records of system-level events, such as logins and logouts, privileged command execution, startup and shutdown, service activity, and system errors or crashes.
- Default Logging: By default, systems usually log only the minimum.
- Regulation and Policy: The level of logging is often set by law or regulation (such as HIPAA or SOX) or by organizational policy.
- Security Pressure: Recent security concerns are pushing organizations toward more extensive system logging.
Windows Event Logs
Windows keeps several logs that are useful in an investigation, including Event Logs, Setup Logs, browsing history, firewall logs, and jump lists/shortcuts. The Event Logs themselves are split into:
- Application: Errors, warnings, and information written by applications.
- Security: Logons and logoffs, dropped packets, and successful connections.
- System: Events from devices and system components.
- Setup: Events related to application setup.
- Forwarded Events: Events collected from remote systems.
Where Windows Stores Its Logs
- Windows XP: Logs are stored as
.evtfiles inC:\Windows\System32\config, namelyAppEvent.Evt,SecEvent.Evt, andSysEvent.Evt. - Windows Vista and Windows 7: Logs are stored as
.evtxfiles inC:\Windows\System32\winevt\Logs. - Registry Configuration: Event log settings are held in the registry under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog, with a subkey for each log (Application, Security, System). Each subkey records values such as the log file's location (File), its maximum size (MaxSize), how long entries are kept (Retention), and the registered event sources (Sources).
Security, Application and System Logging
- Security Logging: On Windows XP, security logging is not on by default and the log size is 512 KB by default. It is enabled through Control Panel > Administrative Tools > Local Security Policy, where audit policies define which successes and failures are recorded.
- Application and System Logging: These are on by default, also with a default size of 512 KB, and their entries are written by the applications and system components themselves.
- Reading Security Events: The Security log shows "Success Audit" and "Failure Audit" entries. For example, a series of failed logons appears as repeated event ID 529 on Windows XP (event ID 4625 on Vista and later), while successful logons appear as 528 (4624 on Vista and later).
Viewing and Parsing Event Logs
- Event Viewer: Found under Control Panel > Administrative Tools > Event Viewer, it displays the Application, Security, and System logs. Each event's properties include its date-time group (DTG), which is important for building timelines.
- Limitations: Event Viewer is convenient and easy to read, but it only works on live systems and not on a forensic image, so investigators have to parse the event logs themselves.
- Log Structure: Event logs have a binary structure made up of a header followed by a series of records.
- Understanding Event IDs: Security event IDs are well documented by resources such as Ultimate Windows Security's event encyclopedia. Application log entries are vendor-specific, and EventID.net (a paid service) is a good source for decoding them.
Other Windows Evidence
- Other Logs: Setup logs, the Windows XP firewall log, the Recycle Bin, and shortcut files can all provide evidence.
- Internet Explorer Browsing History: Older versions of IE store browsing history in
index.datfiles, which can be examined with tools such as DiscoverPro, NetAnalysis, Index.dat Spy, and SuperWinSpy. Be careful when using these tools, as handling the evidence incorrectly can affect its integrity.
Linux Logs
- Syslog: Linux uses syslog (or syslog-ng) as its logging facility. It records system errors and alerts, and other applications can also write to it.
- Location: Logs are usually stored in
/var/log, and the rules for what is logged where are defined insyslog.conf. - Common Logs: These include general messages, authentication messages, mail logs, cron activity, and
boot.log. Which logs exist varies from system to system.
Centralized Logging
- rsyslog: Centralized logging can be set up with rsyslog, which requires a central server and a client on each system and uses a flexible configuration file.
- Problems to Address: Time skew between sensors and loggers must be accounted for. Confidentiality should be protected with encryption, and integrity by securing the network that carries the logs.
Collecting Logs for an Investigation
When collecting logs, investigators need to consider:
- Cooperative IT Staff: Whether the organization's IT team is willing and able to help.
- Sensitivity of the Investigation: How discreet the collection needs to be.
- Resources Available: What time, people, and tools can be used.
- Acquisition Method: Whether logs can be acquired passively or require active access to the log sources.
Log Analysis Tools
- Commercial: Splunk, Microsoft System Center Operations Manager (SCOM), and Cisco's offerings.
- Open Source: DAD (Distributed Log Aggregation and Data Analysis).
- Third Party: ArcSight.
- Splunk in Detail: Splunk is proprietary and not free for enterprise use, but it offers a free tier for under 500 MB of data per day. It runs on many platforms and requires an account with a valid email address to download. Splunk lets investigators search and investigate across their logs and correlate complex events from different sources.
Reference: Davidoff, S., & Ham, J. (2012). Network Forensics: Tracking Hackers Through Cyberspace. Boston: Prentice Hall.
Top comments (0)