Skip to content
SQL injection Write-up Intermediate

How I hacked the Placement portal of my college to leak the entir

The search field on a college placement portal was vulnerable to SQL injection, allowing an attacker to run boolean queries against the database. The author used a blind SQL injection technique to extract database names, table names, column names, and session data byte by byte.

Adithya M S Follow

Published on infosecwriteups.com

Hello and welcome back to my new blog post! I am Adithya M S a Masters student, cyber and web security enthusiast focused on uncovering hidden endpoints, probing data breaches, and exploring attack vectors in web servers and clients.

Adithya M S, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The server concatenated the user's search key directly into an SQL query without parameterisation or escaping.

Impact

An attacker could extract the entire database contents, including student records and active session identifiers, and potentially log in as other users if sessions had not expired.

What the attacker needed

Access to the placement portal search page; no authentication bypass needed

How it was found

  1. Open the placement portal's Openings page and use the company search box.
  2. Enter a search term with an injected boolean condition to see if the query can be altered.
  3. Observe that a true condition returns two records and a false condition returns none.
  4. Send the search as a POST request to the openings endpoint and automate boolean queries with a script.
  5. Use the script to extract database metadata and session data character by character.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

SQL injection is when user input is inserted into a database query without proper handling, so an attacker can change the query's meaning. Here, the search box built a query like 'company_name LIKE %input%', and by typing extra SQL conditions the author could ask yes/no questions about the database. By observing whether the page returned two results or none, they could slowly read out data one character at a time.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.