Skip to content
SQL injection Write-up Beginner

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.

theindiannetwork Follow

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.

TheIndianNetwork, on theindiannetwork.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

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

  1. Find the search filter that accepts a brand parameter.
  2. Enter a basic SQL injection string into the brand field.
  3. Submit the search and observe that products are returned instead of an error.
  4. 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.

More by theindiannetwork

View all

23 more disclosed reports, 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.