# sqlmap
> The standard open-source engine for automated SQL injection detection and database takeover, covering every injection channel across all major DBMS.
## What it does
sqlmap automates the full SQLi lifecycle: detecting injectable parameters, fingerprinting the DBMS, choosing an exploitation technique, and enumerating or exfiltrating the database — down to OS-level takeover where the engine and privileges allow ([[raw/stationx.net/sqlmap-cheat-sheet-commands-options-and-advanced-features-4209|StationX cheat sheet]]). It supports all five technique families, abbreviated **BEUSTQ**: **B**oolean-blind, **E**rror-based, **U**nion, **S**tacked queries, **T**ime-blind, and in-line **Q**ueries, plus out-of-band. It covers MySQL/MariaDB, PostgreSQL, MSSQL, Oracle, SQLite and many more.
## Core workflow
- **Targeting** — point it at a URL, a saved Burp request file (`-r`), or crawl a site; it marks parameters to test across query string, body, cookies, headers, JSON, and path ([[raw/linkedin.com/comprehensive-guide-to-sqlmap-target-options-500|target options]]).
- **Detection tuning** — `--level` (how many parameters/places to probe, incl. headers/cookies) and `--risk` (how aggressive the payloads) trade coverage for noise; `--technique` restricts to specific channels (e.g. boolean-only against a WAF).
- **Fingerprint & enumerate** — identify the DBMS/version, then list databases, tables, columns, and dump rows; search for tables/columns by name.
- **Escalation** — where the role permits: file read/write and OS shell/command primitives (`--os-shell`), reproducing the engine-specific paths in [[SQL Injection to RCE]].
## Against WAFs and in bug bounty
- **Tamper scripts** apply bypass transforms (encoding, comment/space substitution, case) to defeat signature filters; the usual flow is to confirm the injection manually in Burp Repeater, then hand sqlmap the exact request plus the tamper(s) and technique that worked ([[raw/vaadata.com/exploiting-an-sql-injection-with-waf-bypass-2837|WAF bypass with sqlmap]], [[WAF Bypass for SQL Injection]]). A proxy option routes traffic through Burp; a modified User-Agent and `--not-string` help in filtered/blind contexts.
- **Bug-bounty use** — scope it to in-scope hosts, feed saved requests rather than blind crawling, and prefer low `--level/--risk` first to avoid disruptive payloads ([[raw/vavkamil.cz/understanding-the-full-potential-of-sqlmap-during-bug-bounty-hunting-497|full potential of sqlmap]]). Pairing content discovery/fuzzing to find candidate parameters, then sqlmap to confirm, is a common fast path ([[raw/0xmahmoudjo0.medium.com/how-i-found-multiple-sql-injection-with-ffuf-and-sqlmap-in-a-few-minut-5161|ffuf + sqlmap]]).
## In practice (cases)
- **`--level 5 --risk 3` matters.** On Georgia DCSS (IBM DB2) defaults found nothing; level 5 / risk 3 unlocked heavy-query time payloads that confirmed the `ssn` injection ([[raw/infosecwriteups.com/the-devil-went-down-to-georgia-how-i-made-60k-hacking-the-dhs-15835|$60k Georgia DHS]]).
- **Saved request + `-p`** is the standard handoff after manual confirmation: `-r req.txt --dbs` dumped 22 databases on a Bugcrowd P1 ([[raw/medium.com/how-i-discovered-a-blind-sql-injection-in-a-private-program-15837|blind SQLi in a private program]]); `-r request.txt -p q --batch` found boolean and time-based blind on SQLite in picoCTF, where `--dbs` is unsupported so you go straight to `--tables`, and `--threads 10` speeds blind dumping ([[raw/sahandbabali.com/picoctf-2026-sql-map1-writeup-15842|picoCTF Sql Map1]]).
- **`--technique=B --dbms=...`** reproduced a hand-built Oracle boolean extraction in one command ([[raw/blog.martindios.com/sqli-at-nasa-how-i-got-my-letter-of-recognition-15836|SQLi at NASA]]).
## Caveats
Automation misses context-dependent sinks (second-order, identifier-only injection, unusual encodings) that manual testing catches — treat sqlmap as confirmation/extraction, not discovery, for non-trivial targets. Aggressive `--risk`/`--os-shell` can modify data or execute commands; use with authorization and care. Alternatives/complements: **ghauri**, **jSQL**, **BBQSQL**, **SqliSniper** (header-focused time-based), **NoSQLMap** ([[NoSQL Injection]]), surveyed in the detection-tool roundup ([[raw/analyticsinsight.net/9-sqli-detection-tools-you-need-to-know-in-2023-5150|SQLi detection tools]]).
## Related
- [[SQL Injection]]
- [[Blind SQL Injection]]
- [[Union-Based SQL Injection]]
- [[WAF Bypass for SQL Injection]]
- [[SQL Injection to RCE]]
- [[Bug Bounty Methodology]]
## Sources
- [[raw/0xmahmoudjo0.medium.com/how-i-found-multiple-sql-injection-with-ffuf-and-sqlmap-in-a-few-minut-5161|How I Found multiple SQL Injection with FFUF and Sqlmap]]
- [[raw/analyticsinsight.net/9-sqli-detection-tools-you-need-to-know-in-2023-5150|9 SQLi Detection Tools You Need to Know]]
- [[raw/blog.martindios.com/sqli-at-nasa-how-i-got-my-letter-of-recognition-15836|SQLi at NASA: how I got my Letter of Recognition]]
- [[raw/infosecwriteups.com/the-devil-went-down-to-georgia-how-i-made-60k-hacking-the-dhs-15835|The Devil Went Down to Georgia: How I Made $60k Hacking the DHS]]
- [[raw/linkedin.com/comprehensive-guide-to-sqlmap-target-options-500|Comprehensive Guide to Sqlmap (Target Options)]]
- [[raw/medium.com/how-i-discovered-a-blind-sql-injection-in-a-private-program-15837|How I discovered a blind SQL injection in a private program]]
- [[raw/sahandbabali.com/picoctf-2026-sql-map1-writeup-15842|picoCTF 2026 SQL Map1 writeup]]
- [[raw/secnhack.in/website-penetration-testing-and-database-hacking-with-sqlmap-secnhack-492|Website Penetration Testing and Database Hacking with Sqlmap]]
- [[raw/stationx.net/sqlmap-cheat-sheet-commands-options-and-advanced-features-4209|SQLMap Cheat Sheet: Commands, Options, and Advanced Features]]
- [[raw/vaadata.com/exploiting-an-sql-injection-with-waf-bypass-2837|Exploiting an SQL Injection with WAF Bypass]]
- [[raw/vavkamil.cz/understanding-the-full-potential-of-sqlmap-during-bug-bounty-hunting-497|Understanding the full potential of sqlmap during bug bounty hunting]]