Skip to content
SQL injection Write-up Intermediate

Automating a Thorny SQL Injection With SQLMap

A search parameter was vulnerable to SQL injection, but a web application firewall or blacklist blocked common payloads and whitespace. The author bypassed these restrictions and used SQLMap to extract data from the database.

research.aurainfosec.io

Published on research.aurainfosec.io

SQL injection, one of the common server-side vulnerability that is found in web applications. The attack consists of insertion or “injection” of a SQL query through the input data from the client to the application.

The author, on research.aurainfosec.io

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, and its input filtering was incomplete.

Impact

An attacker could read sensitive data from the database, and potentially modify or delete data, execute administrative operations, or issue operating system commands, though the text only demonstrates data extraction.

What the attacker needed

Access to the search page; no authentication mentioned

How it was found

  1. Send a single quote in the Code parameter to trigger a SQL error and confirm injection.
  2. Try a boolean payload with a space, observe it is blocked.
  3. Remove spaces and use a comment to bypass the filter, confirming true/false responses.
  4. Use Burp Intruder to enumerate the database version character by character.
  5. Configure SQLMap with prefix, suffix, timeout, and a custom tamper script to automate extraction.

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 user input is inserted into a database query without proper handling, letting an attacker change the query's meaning. Here, the search box for map codes was vulnerable, but the site had filters that blocked simple attacks. The author found ways around those filters and used a tool to pull data from the database.

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.