Skip to content
SQL injection Write-up Beginner

How I Found SQL Injection

The bookid parameter on a book-details page was vulnerable to SQL injection, allowing an attacker to execute arbitrary SQL queries. An attacker could extract sensitive data such as user credentials and order details without authentication.

medium.com

Published on medium.com

Hii all, I’m Ashvin Chouhan — currently in my 3rd year of a Bachelor of Technology, trying to become a security researcher.

ONEDAY24X7, 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

User input from the bookid parameter was concatenated directly into a SQL query instead of using parameterised queries.

Impact

An attacker could have pulled user credentials, personal details, and order/enquiry data straight out of the database without needing to log in.

What the attacker needed

No login required; crafted URL parameter

The fix

The platform has since patched this by properly sanitising and parameterising the input.

How it was found

  1. Pick a target and find an endpoint with a bookid parameter.
  2. Send a request to that endpoint and observe an error when injecting quotes.
  3. Capture the request in Burp Suite and save it to a file.
  4. Run SQLMap against the saved request to confirm injection.
  5. Use SQLMap to enumerate database tables.

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 a website puts user input directly into a database command, so an attacker can trick the database into running their own commands. Here, the bookid value in the URL was not properly handled, letting a tool called SQLMap read data from the database.

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.