Skip to content
SQL injection Write-up Intermediate

SQL Injection Vulnerability on a Security Awareness website: From

A PHP endpoint was vulnerable to SQL injection, allowing the tester to dump the database and obtain an administrator email address. That email was also used as the cPanel login, so the tester gained full control of the hosting environment.

Anonymousshetty Follow

Published on medium.com

As a penetration tester, my goal is to identify security flaws in web applications before malicious actors can exploit them. During a recent security assessment of a PHP-based application, I stumbled upon a critical vulnerability that led from a simple SQL injection to full system compromise — eventually granting me…

Anonymousshetty, on 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 built SQL queries by concatenating user input instead of using parameterised queries, and the same email was reused for cPanel authentication.

Impact

The tester could access the entire file system, upload web shells, alter DNS settings, and fully control the hosting environment.

What the attacker needed

Access to the vulnerable endpoint; SQL injection tool (e.g., GHAURI); cPanel found on another subdomain

The fix

The application should use prepared statements and parameterised queries, validate input, apply least privilege to the database user, and avoid reusing administrator emails for hosting control panel logins.

How it was found

  1. Identify a PHP endpoint that fetches chapters or post_id.
  2. Use a SQL injection tool on the endpoint to dump the database.
  3. Find an adminLogin table containing an administrator email address.
  4. Use that email address to log in to cPanel found on another subdomain.

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 tester used a tool to extract all database records, found an admin email, and because that email was also the hosting control panel login, they could take over the server.

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 Anonymousshetty

View all

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