Skip to content
SQL injection Write-up Beginner

How can i get SQL Injection

The author found a hidden employee login endpoint by inspecting JavaScript files, then discovered that the username field was vulnerable to SQL injection. By injecting a single quote they triggered a database error, and they then used UNION-based queries to extract the database version and name.

Mohamed Abdelhady Follow

Published on xthemo.medium.com

at the beginning I trieddefault credentials ,but it didn’t work. the second decision was to check the source code . after a while without find anything interesting.

Mohamed Abdelhady, on xthemo.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

Likely the application concatenated user input directly into a SQL query without parameterisation, so a single quote broke the query syntax.

What the attacker needed

Access to the web application; discovery of the hidden employee login endpoint

How it was found

  1. Browse the normal login page and try default credentials and common bypasses.
  2. Inspect JavaScript files to find a hidden employee login endpoint.
  3. Intercept the login request and inject a single quote in the username field to trigger a SQL error.
  4. Use an ORDER BY injection to determine the number of columns in the query.
  5. Use a UNION SELECT injection to retrieve the database version.
  6. Use a UNION SELECT injection to retrieve 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.

A login page normally checks your username and password against a database. If the page builds its database query by pasting your input directly into the query text, a special character like a single quote can break the query and cause an error. Here the author found a hidden login page for employees and used that error to confirm they could inject their own database commands.

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 Mohamed Abdelhady

View all

2 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.