Skip to content
SQL injection Write-up Beginner

How i found SQL injection in live website

The admin login form passed user input into a SQL query without sanitising it, so a single quote caused an internal server error. An attacker could use a boolean-based blind SQL injection to extract data from the database, though a WAF initially interfered.

medium.com

Published on medium.com

I was just browsing the internet for something and i found this website after navigating this website i found that the technologies used in this website is very old and the design of this website was also not very modern.

Priyanshu, 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 login handler concatenated user input into a SQL query instead of using parameterised queries, so quote characters altered the query syntax.

Impact

An attacker could extract data from the database through blind SQL injection, although a WAF blocked early attempts until encoding and a tamper script were used.

What the attacker needed

Admin login page reachable; WAF bypass needed for the tool

How it was found

  1. Find the admin login page while browsing the site.
  2. Try common usernames and passwords, then capture the login request in Burp.
  3. Send a single quote in the input and observe an internal server error in the response.
  4. Save the login request to a file and run sqlmap against it.
  5. Work around the WAF with encoding and a tamper script until the injection succeeds.
  6. Dump the database name as proof of concept.

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 login form sends what you type to a database to check it. Here the site built that database command by gluing your text straight in, so special characters like a single quote broke the command and revealed the flaw. The author then used a tool to ask the database yes/no questions and slowly read its contents.

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.