Logs can be a valuable tool for detecting web attacks. Every request sent to a web server can leave evidence in its access and error logs. Defenders can spot patterns that reveal scanning, exploitation attempts, or other attacks by reviewing log entries. In this task, you will review the basics of the access log format and look at how various attacks play out in web server access logs, then practice your skills in a real attack sequence scenario.
Access Log Format
Below is a sample access log entry. Depending on the context, each field can indicate either benign or malicious traffic. While not all access logs follow this exact format, they generally include the following information:
| Log Field |
Example Indicator |
| 1. Client IP Address |
A known malicious or outside of the expected geo range |
| 2. Timestamp and Requested Page |
Requests made at unusual hours or repeated in a short period of time |
| 3. Status Code |
Repeated 404 responses indicating a page could not be found |
| 4. Response Size |
Significantly smaller or larger than normal response sizes |
| 5. Referrer |
Referring pages that don't fit normal site navigation |
| 6. User-Agent |
Outdated browser versions or common attack tools (e.g. sqlmap, wpscan) |
Attacks in Logs
Next, we'll examine an example of a condensed attack sequence. The sequence of log entries will only display the attacker's requests; in a real-world scenario, however, benign traffic would make up the vast majority of log entries, making it essential to develop a sharp eye for spotting malicious patterns amid normal activity. It is also important to note that in the example below, the query string in the SQLi attack is logged, so you will be able to see the full SQLi payloads.
- The attacker tests for potential directories and forms to exploit with a directory fuzz. The
200 response codes signify valid finds for the attacker.
- Next, the attacker exploits the
login.php form found with a brute-force attack. Note the repeated POST requests in quick succession. The last POST request has a different response code, 302 Found, which, in this case, signifies a successful login attempt. The page then redirects to the user's account page at /account.
- Once the attacker gains access to the account, they attempt two SQLi payloads,
' OR '1'='1 and 1' OR 'a'='a, on the /search form. If the application builds SQL queries dynamically instead of using parameterised queries, the attacker could dump the database.
Log Limitations
While access logs are useful, they do not always capture the full contents of a request, particularly the body of POST or GET requests. For example, a login attempt may appear in access logs as:
10.10.10.100 [12/Aug/2025:14:32:10] "POST /login HTTP/1.1" 200 532 "/home.html" "Mozilla/5.0"
The above sample log shows the request method, the requested page, and the status code, but not the actual credentials or payload that was submitted in the request. Importantly, access logs do not record the actual POST body data, such as submitted credentials, so investigators can only see that the request occurred. GET requests may log full paths and query strings, but some log formats won't include them at all. It depends entirely on the server software being used and the logging configuration.
Investigation
TryBankMe, a small online banking platform, has suffered a breach. Attackers broke in and leaked sensitive customer data on a darknet forum. Management believes the intrusion began through the company’s public website, and it’s up to you to uncover exactly how it happened.
Begin by opening up the access.log file on the desktop.
Your mission is to analyze the logs and retrace the attacker’s steps to reveal how the breach unfolded. Good luck!