Web Server Access & Error Logs

LinuxExecution EvidenceDisk ImageSIEM / Log Aggregator

Location

/var/log/apache2/access.log, /var/log/nginx/access.log, /var/log/httpd/access_log (and corresponding error logs)

Description

HTTP server access logs recording every request with client IP, timestamp, HTTP method, URI path, query parameters, response code, bytes transferred, referrer, and user agent. Error logs capture application errors, CGI failures, and module warnings.

Forensic Value

Web server logs are the primary artifact for web application compromise investigations. SQL injection, path traversal, webshell uploads, and RCE attempts are recorded with the full request URI and parameters. Successful webshell access appears as POST requests to unusual file paths (e.g., /uploads/cmd.php) from attacker IPs. Error logs reveal failed exploitation attempts and the specific vulnerabilities targeted. Response codes and byte sizes distinguish successful attacks from failed attempts.

Tools Required

grepawkGoAccessSIEM (Splunk, Elastic)Apache Scalp

Collection Commands

tar

tar czf /forensics/output/web_logs.tar.gz /var/log/apache2/ /var/log/nginx/ /var/log/httpd/

grep

grep -E "POST.*\.(php|jsp|asp)|cmd=|exec=|/etc/passwd|\.\./" /var/log/apache2/access.log > /forensics/output/web_suspicious.log

awk

awk '{print $1}' /var/log/apache2/access.log | sort | uniq -c | sort -rn > /forensics/output/web_top_ips.txt

grep

grep -i "error\|warn\|fatal" /var/log/apache2/error.log > /forensics/output/web_errors.log

Collection Constraints

  • Paths and log sources vary by distribution, init system, logging stack, and installed packages. Validate the active distro and service set before treating absence as meaningful.
  • Centralized log copies may normalize, truncate, or drop fields relative to the original on-host artifact. Preserve the local source when scope and access permit.

MITRE ATT&CK Techniques

T1190T1505.003T1071.001T1059.004

Related Blockers