boot767 notes · 24 posts

Every Shell Leaves a Trace

I keep what I learn about offensive security here: my notes from CTFs, certifications and university, plus the walkthroughs I write when a box is worth sharing. It's organized the way I work a box. Recon first, then a foothold, then privilege escalation, then the rest of the network.

latest transmission · 2026-11-19Collection of OSINT Tools and Resources
boot767 notes · 24 posts

Every Shell Leaves a Trace

I keep what I learn about offensive security here: my notes from CTFs, certifications and university, plus the walkthroughs I write when a box is worth sharing. It's organized the way I work a box. Recon first, then a foothold, then privilege escalation, then the rest of the network.

latest transmission · 2026-11-19Collection of OSINT Tools and Resources

SQLi with Repeater

This is the extra-mile challenge for the Burp Repeater room: a slightly harder, real-world target. If you are already comfortable doing a manual SQL injection, you can skip to the last question and treat it as a blind challenge; otherwise the full steps are below.

If you don't already know the principles of SQLi, the room on the topic is worth your time first. Full steps are provided here, so in-depth knowledge isn't required to finish the task.

The brief:

There is a Union SQL Injection vulnerability in the ID parameter of the /about/ID endpoint. Find this vulnerability and execute an attack to retrieve the notes about the CEO stored in the database.

We know a vulnerability exists and where it is, so this is all about exploiting it.

Capture the Request

Start by capturing a request to http://10.10.234.23/about/2 in the Burp Proxy. Once you have the request, send it to Repeater with Ctrl + R or by right-clicking and choosing "Send to Repeater". With the request primed in Repeater, we can start editing and replaying it freely.

Confirm the Vulnerability

Now we confirm that a vulnerability exists. Adding a single apostrophe (') is usually enough to make the server error when a simple SQLi is present. Either using Inspector or by editing the request path manually, add an apostrophe after the "2" at the end of the path and send the request:

GET /about/2' HTTP/1.1
Host: 10.10.234.23
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: close
Upgrade-Insecure-Requests: 1 

The server responds with a "500 Internal Server Error", which means the query broke:

HTTP/1.1 500 INTERNAL SERVER ERROR<
Server: nginx/1.18.0 (Ubuntu)
Date: Mon, 16 Aug 2021 23:05:21 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 3101 

Around line 40 of the response body, the server tells us the query it tried to run:

<h2>
    <code>Invalid statement: 
        <code>SELECT firstName, lastName, pfpLink, role, bio FROM people WHERE id = 2'</code>
    </code>
</h2>

This is an extremely useful error message the server should absolutely not be sending us, but the fact that we have it makes our job significantly more straightforward. It tells us a couple of things that will be invaluable when exploiting this vulnerability:

With this information, we can skip over the query column-number and table-name enumeration steps.

Enumerate the Column Names

Although we cut out a lot of the usual enumeration, we still need the name of our target column. Since we know the table name and the number of columns, we can use a union query to select the column names for the people table from the columns table in the information_schema default database. A simple query for this is as follows:

/about/0 UNION ALL SELECT column_name,null,null,null,null FROM information_schema.columns WHERE table_name="people"

This creates a union query and selects our target then four null columns, so the query doesn't error out. Notice that we also changed the ID we are selecting from 2 to 0. By setting the ID to an invalid number we ensure that we don't retrieve anything with the original legitimate query, which means the first row returned from the database is our desired response from the injected query.

Looking through the returned response, the first column name (id) has been inserted into the page title:

HTTP/1.1 200 OK
Server: nginx/1.18.0 (Ubuntu)
Date: Mon, 16 Aug 2021 22:12:36 GMT
Content-Type: text/html; charset=utf-8
Connection: close
Front-End-Https: on
Content-Length: 3360

<!DOCTYPE html>
<html lang=en>
    <head>
        <title>
            About | id None
        </title>
-----

Group the Results

We pulled the first column name out of the database, but now we have a problem: the page only displays the first matching item, and we need to see all of the matching items. Fortunately we can use our SQLi to group the results. We can still only retrieve one result at a time, but the group_concat() function lets us amalgamate all of the column names into a single output:

/about/0 UNION ALL SELECT group_concat(column_name),null,null,null,null FROM information_schema.columns WHERE table_name="people"

This successfully identifies eight columns in the table: id, firstName, lastName, pfpLink, role, shortRole, bio, and notes. Considering our task, it seems a safe bet that our target column is notes.

Extract the Flag

Finally we are ready to take the flag from the database, since we have all of the information we need:

Now we craft a query to extract this flag:

0 UNION ALL SELECT notes,null,null,null,null FROM people WHERE id = 1

Hey presto, we have a flag.