Skip to content
SQL injection Write-up Intermediate

From Code to Compromise: My Hands‑On Journey Creating a Vulnera

The author built a deliberately insecure car-dealer web application and found multiple vulnerabilities, including SQL injection in a GET parameter and an admin search, stored XSS in reviews, unrestricted PHP file upload leading to remote code execution, broken access control allowing admin panel access, and CSRF in the add-user form. An attacker could dump the database, execute code on the server, and create new admin accounts.

Ian Zammit Follow

Published on medium.com

This project is one I created as part of my journey to deepen my cybersecurity skills. The goal was to deliberately build an insecure car‑dealer web application, explore how common vulnerabilities emerge in real-world code, and then learn how to identify, exploit, and ultimately patch them using secure coding best…

Ian Zammit, 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 trusted user input without validation or sanitisation, and relied on weak access controls such as encoded credentials and missing CSRF tokens.

Impact

An attacker could dump the database, execute arbitrary code on the server, access sensitive files including a Stripe API key, and create new admin accounts via CSRF.

What the attacker needed

Access to the web application; ability to submit reviews and upload files; admin user logged in for CSRF

How it was found

  1. Add a single quote to the id parameter in details.php to trigger a MySQL error.
  2. Use SQLmap on the same parameter to list databases, tables, and dump the customers table.
  3. Submit a review with bold tags, then a script tag, to confirm stored XSS.
  4. Upload a PHP file through the review form and access it to confirm code execution.
  5. Find a path that bypasses the admin login page.
  6. Use a single quote in the admin search parameter to trigger SQL injection and dump the database.

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.

This is a write-up about a practice website the author built on purpose to be insecure. They show how small mistakes, like not checking what a user types or what file they upload, let an attacker read private data or run their own code on the server. It is a learning exercise, not a real company being hacked.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

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.