Skip to content

MoriartyPuth-Labs/Full-Chain-SQLi-Case-Study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ Exploitation Showcase: SQLi to Full Database Takeover

A comprehensive technical walk-through of a successful vulnerability chain discovery and data exfiltration.

Status Type Target

๐Ÿ“‹ Executive Summary

This repository documents a complete end-to-end security audit. Using proprietary automation, I identified a critical SQL injection (SQLi) vulnerability in a web application running on Nginx 1.19.0 and PHP 5.6.40. The vulnerability allowed for unauthorized access to the backend database, leading to the successful exfiltration of the entire users table, including plaintext credentials and sensitive PII.


๐Ÿ”ฌ Phase 1: Automated Discovery with Bubble-Bash

The exploitation lifecycle began with a scan using Bubble-Scanner. The scanner's event-driven engine identified a hidden endpoint and immediately flagged a potential SQLi vulnerability by detecting backend syntax errors upon injecting an escape character (').

Initial Reconnaissance Log:

Screenshot 2026-02-18 013405
  • Scan Start: Tue Feb 17 01:14:11 PM EST 2026
  • Target: http://testphp.vulnweb.com
  • Finding: โ””โ”€ [!!!] SQLi VULNERABILITY DETECTED

๐Ÿ”“ Phase 2: Vulnerability Confirmation & Mapping

Following discovery, sqlmap was utilized to validate the injection point on the cat parameter of the listproducts.php endpoint.

Screenshot 2026-02-18 013631Screenshot 2026-02-18 013658

Technical Findings:

  • Back-end DBMS: MySQL >= 5.6
  • Operating System: Linux Ubuntu
  • Injection Types Identified:
    • Boolean-based blind: AND boolean-based blind - WHERE or HAVING clause
    • Error-based: MySQL >= 5.6 AND error-based
    • Time-based blind: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    • UNION query: Generic UNION query (NULL) - 11 columns

๐Ÿ—„๏ธ Phase 3: Database & Schema Enumeration

The vulnerability provided deep access to the database architecture, allowing for the mapping of the acuart database and the extraction of sensitive tables.

Screenshot 2026-02-18 014138Screenshot 2026-02-18 014201

Database Inventory:

  1. acuart
  2. information_schema

Target Table: users

The acuart.users table was found to contain 8 critical columns, including uname (Username), pass (Password), email, and cc (Credit Card / Sensitive Data).


๐Ÿ’พ Phase 4: Data Exfiltration (Proof of Concept)

Final exfiltration demonstrated a complete breach of confidentiality. I successfully dumped records from the users table, revealing insecure data storage practices.

Screenshot 2026-02-18 014217Screenshot 2026-02-18 014237

Extracted Entry Preview:

  • Username: test
  • Password: test
  • Email: you
  • Notes: Includes stored XSS vectors such as <script>window.location=...</script>

๐Ÿ›ก๏ธ Technical Conclusion & Risk Assessment

The successful exploitation of this vulnerability represents a Critical Risk to organizational data integrity and citizen privacy.

  • Mass Data Exfiltration: Unauthorized access to PII and credentials constitutes a major security breach.
  • Account Takeover (ATO): Access to plaintext passwords allows for immediate account compromise.
  • Persistent Threat Vector: Stored XSS vectors identified in the database dump suggest a secondary attack surface for session hijacking.
  • Legacy Risk: The use of end-of-life software (PHP 5.6.40) significantly increases the attack surface.

โš–๏ธ Ethics & Disclaimer

This documentation is for Educational and Ethical Security Testing only. All screenshots and data were gathered from a legally authorized vulnerability testing environment (testphp.vulnweb.com).

About

A comprehensive technical walk-through of an end-to-end SQL Injection (SQLi) attack chain conducted in a controlled lab environment for research and learning.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors