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.
Published on infosecwriteups.com
Hello there, I am Veshraj Ghimire all the way from Nepal. This is my first bounty write up.
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
- Enumerate subdomains and probe them for titles, status codes and content lengths.
- Open the interesting admin subdomain and search for a category using the jbscategory parameter.
- Change the category value and observe that the page content changes.
- Balance the query with a simple integer-based comment to confirm injection.
- Determine the number of columns using an ORDER BY query.
- 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.