Skip to content
Lab 2 of 6

Web Log Analysis: The SQL Injection and What It Took

Before the SSH brute force, the same address talked to nginx. Find the endpoint it injected, decode what it asked the database, and say what left the building and how much.
  • 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 >
  • sudo for files another account owns — you have it here
  • Seen a SQL SELECT before (the Databases track helps, it is not required)

Tasks

  1. 01Find the entry point
  2. 02Decode what they asked for
  3. 03How many rows?
  4. 04How much left the building?

Next in this course