Skip to content
SQL injection Write-up Beginner

First Bug Bounty Ever Sql Injection

A search parameter on a subdomain was vulnerable to SQL injection, allowing an attacker to alter the query and retrieve the database name. The author confirmed the injection by changing the page content and using a UNION query to display the database name.

Veshraj Ghimire Follow

Published on infosecwriteups.com

Hello there, I am Veshraj Ghimire all the way from Nepal. This is my first bounty write up.

Veshraj Ghimire, 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

Likely the application concatenated the user-supplied category parameter directly into an SQL query without parameterisation or validation.

What the attacker needed

Access to the target subdomain; no authentication needed

How it was found

  1. Enumerate subdomains and probe them for titles, status codes and content lengths.
  2. Open the interesting admin subdomain and search for a category using the jbscategory parameter.
  3. Change the category value and observe that the page content changes.
  4. Balance the query with a simple integer-based comment to confirm injection.
  5. Determine the number of columns using an ORDER BY query.
  6. Use a UNION SELECT query to display the database name.

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 change the command. Here, the category number in the URL was not properly checked, letting the author add extra database instructions and see the database name on the page.

What is SQL injection?

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

More by Veshraj Ghimire

View all

1 more disclosed report, best first.

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.