
In-Band
The result of your injected query shows up directly in the response. Splits into error-based, where database error messages leak data, and union-based, using
UNION SELECT to pull data into the page’s normal output. Fast to exploit once confirmed.Blind
Nothing comes back directly, so you infer data indirectly. Splits into boolean-based, reading true/false differences in the response, and time-based, reading delays like
SLEEP() instead.Out-of-band is the third, much rarer type: data gets exfiltrated through a completely separate channel, usually DNS or HTTP requests the database server makes on its own. It only works when the database can actually reach outside the network and in-band or blind methods are blocked or too slow.
Confirming the Injection
Before building out a full UNION chain, confirm injection actually exists and figure out what’s running behind it.Union-Based Injection
UNION injection appends your own query to the original and returns its result inline with the page’s normal output. It only works once the column count and data types line up with the original query. Find the column count by incrementing until the query errors out:INFORMATION_SCHEMA through the same injection point:
File read/write and webshells via injection
File read/write and webshells via injection
Depending on database privileges, UNION injection can go beyond reading tables.
SQLMap
Manual injection is worth understanding, but sqlmap automates the actual extraction once you’ve confirmed a parameter is injectable. It’s usually the faster path from “this looks vulnerable” to a full data dump.More sqlmap flags
More sqlmap flags
NoSQL Injection
Document databases like MongoDB don’t use SQL syntax, but the same core problem applies: unsanitized input lets an attacker change the logic of the query itself, usually by injecting query operators instead of string payloads.
The classic case is an auth bypass, where
$ne makes the condition true for any value other than the expected one:
NoSQL Injection payloads (PayloadsAllTheThings) has a much deeper payload list for both MongoDB and other NoSQL engines.
Quick Reference Tools
SQL Injection Techniques
Overview of injection techniques across different database engines.
SQL Injection Payload List
Ready-to-use payloads for manual testing.
PayloadsAllTheThings: SQL Injection
Deep, engine-specific reference covering MySQL, MSSQL, PostgreSQL, and more.

