Web Log Analysis: The SQL Injection and What It Took
- Intermediate
- 36 min
- Blue Team
- Forensics
- SQL Injection
- nginx
- Kestrel
Overview
The morning of 4 November. Customers have been getting SMS messages that use their names and phone numbers. Harpreet Kaur calls it in at 07:15; Simran Gill rolls back the release that went out at 22:47 the night before and, before anything rotates, copies the server's logs to /srv/evidence/var/log (start with cat /srv/evidence/README.md). This machine is that server, kestrel-api-1, exactly as the attacker left it.
The SMS spam means customer data left Kestrel — and an SSH login does not explain that by itself. nginx's access log (/srv/evidence/var/log/nginx/kestrel.access.log) holds every request the server answered that night, in the combined format:
203.0.113.9 - - [04/Nov/2026:00:52:51 +0530] "GET /search?q=paneer HTTP/1.1" 200 71 "-" "curl/7.81.0"
address, time, request, status, bytes sent, referrer, user agent. Requests are URL-encoded, so the interesting part looks like %27%20UNION. PostgreSQL's own log and the release diff (/srv/evidence/release-2026-11-03.diff) are there to corroborate.
What you will learn
- Read nginx's combined log format by field with awk
- Spot an injection from status codes and encoded quotes
- URL-decode requests and read the SQL an attacker sent
- Work out how many rows were taken and how many bytes left
Before you start
- Comfortable in a Linux shell:
grep, pipes and redirecting with> sudofor files another account owns — you have it here- Seen a SQL
SELECTbefore (the Databases track helps, it is not required)
Tasks
- 01Find the entry point
- 02Decode what they asked for
- 03How many rows?
- 04How much left the building?