Skip to content
SQL injection Write-up Beginner

How I Hacked My School Website (And Reported It!)

The school website's fee-status lookup field was vulnerable to error-based SQL injection, allowing an attacker to extract the database name and table names. The author claims this exposed student data, fee payments and transaction IDs, though the text only shows database and table names being retrieved.

medium.com

Published on medium.com

Yo, what’s up? ChrolloD here.

ChrolloD, on medium.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

Likely the admission-number input was concatenated into a SQL query without parameterisation or proper escaping, so injected SQL was executed by the database.

Impact

An attacker could read database and table names and, according to the author, potentially access student data, fee payments and transaction IDs; the text does not show those records actually being extracted.

What the attacker needed

Access to the public fee-status form; no account needed

The fix

The text says the institution resolved the bug, but does not describe the fix; it should be fixed by using parameterised queries or prepared statements for the admission-number lookup.

How it was found

  1. Enter an apostrophe in the admission-number field and observe an SQL error.
  2. Submit a crafted query that causes an error containing the database name.
  3. Submit further crafted queries to retrieve table names from the information schema.

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.

A website often builds database queries by pasting what you type into a form directly into the query. If the site does not clean that input, a special character like an apostrophe can break the query and make the database reveal information. Here, the author used that flaw to learn the database and table names.

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.