Mastering Information Gathering: How I Discovered an SQL Injectio
A search filter on an e-commerce site did not sanitise user input, allowing SQL injection. An attacker could bypass authentication, retrieve sensitive user data, modify or delete records, and execute administrative commands.
Published on theindiannetwork.medium.com
In the world of ethical hacking, one of the most fundamental skills is information gathering. It’s the first step in any penetration test or security audit, where we collect data about the target system before diving into any active testing.
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
Impact
An attacker could bypass authentication, retrieve sensitive user data including passwords and emails, modify or delete records, and execute administrative commands.
What the attacker needed
Access to the search filter; no authentication needed
The fix
The issue should be fixed by using prepared statements or parameterised queries, validating input, and not displaying detailed database errors.
How it was found
- Find the search filter that accepts a brand parameter.
- Enter a basic SQL injection string into the brand field.
- Submit the search and observe that products are returned instead of an error.
- Try UNION SELECT statements to retrieve database tables and columns.
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 without checking it. An attacker can type special characters that change the command, so the database returns or changes data it should not. Here, the search box let someone do exactly that.
What is SQL injection?
Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.